void Awake()
    {
        player      = GetComponent <PlayerCoreController> ();
        lightObject = GameObject.Find("Directional Light");
        lightSet    = FindObjectOfType <Light> ();

        if (_instance != null && _instance != this)
        {
            Destroy(this.gameObject);
        }
        else
        {
            _instance = this;
        }
    }
Exemple #2
0
    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;
 }
Exemple #4
0
 void Awake()
 {
     player = FindObjectOfType <PlayerCoreController> ();
 }