mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-10 06:34:16 +00:00
adapt to singleton
This commit is contained in:
parent
a6b8af5cb9
commit
37930ac861
2 changed files with 7 additions and 13 deletions
|
@ -5,10 +5,10 @@ using SanAndreasUnity.Utilities;
|
|||
namespace SanAndreasUnity.Behaviours
|
||||
{
|
||||
|
||||
public class UIManager : MonoBehaviour
|
||||
public class UIManager : StartupSingleton<UIManager>
|
||||
{
|
||||
|
||||
public static UIManager Instance { get; private set; }
|
||||
public static UIManager Instance => Singleton;
|
||||
|
||||
bool m_useTouchInput = false;
|
||||
public bool UseTouchInput
|
||||
|
@ -45,10 +45,8 @@ namespace SanAndreasUnity.Behaviours
|
|||
|
||||
|
||||
|
||||
void Awake()
|
||||
protected override void OnSingletonAwake()
|
||||
{
|
||||
|
||||
Instance = this;
|
||||
|
||||
// enable touch input by default on mobile platforms
|
||||
if (Application.isMobilePlatform)
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using SanAndreasUnity.Net;
|
||||
using SanAndreasUnity.Utilities;
|
||||
using UnityEngine;
|
||||
|
||||
namespace SanAndreasUnity.GameModes
|
||||
{
|
||||
public class GameModeManager : MonoBehaviour
|
||||
public class GameModeManager : StartupSingleton<GameModeManager>
|
||||
{
|
||||
public static GameModeManager Instance { get; private set; }
|
||||
public static GameModeManager Instance => Singleton;
|
||||
|
||||
public class GameModeInfo
|
||||
{
|
||||
|
@ -31,12 +32,7 @@ namespace SanAndreasUnity.GameModes
|
|||
private GameModeInfo m_selectedGameMode;
|
||||
|
||||
|
||||
void Awake()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
protected override void OnSingletonStart()
|
||||
{
|
||||
NetManager.Instance.onServerStatusChanged += OnServerStatusChanged;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue