void Awake() { _instance = null; if (_instance == null) { _instance = this; DontDestroyOnLoad(gameObject); } else { if (_instance != this) { Destroy(gameObject); return; } } Client = new GameClient(); Client.AppId = appId; Client.AppVersion = appVersion; Client.onReceiveMove += OnReceiveMove; }
public override void OnAgentDestroy() { Destroy(gameObject); _instance = null; }