void Awake() { player = GetComponent <PlayerCoreController> (); lightObject = GameObject.Find("Directional Light"); lightSet = FindObjectOfType <Light> (); if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { _instance = this; } }
void Awake() { //Singleton Setup if (mInstance == null) { mInstance = this; } else if (mInstance != this) { Destroy(this.gameObject); } GameObject playerGO = GameObject.FindGameObjectWithTag("Player"); if (playerGO) { player = playerGO.GetComponent <PlayerCoreController>(); } else { Debug.LogError("GameManager: Unable to find Player!"); } }
public void SetPlayer(PlayerCoreController m_Player) { this.m_Player = m_Player; }
void Awake() { player = FindObjectOfType <PlayerCoreController> (); }