public override void Initialize( ) { base.Initialize( ); ResourceUI = gameUIList.Find(_ => _ is ResourceCanvas) as ResourceCanvas; new Developers.Net.Protocol.ResourceRequest( ).SendPacket( ); }
// Called on object creation void Awake() { // Singleton pattern // Makes sure there is only ever one GameManager object // Since we store data in this, we need to make sure it is used in the preload scene ONLY if (Instance == null) { Instance = this; } else { Debug.Log("Warning: multiple " + this + " in scene!"); Destroy(gameObject); } if (dontDestroyOnLoad) { DontDestroyOnLoad(gameObject); // Keep the only manager alive across scenes } }