Ejemplo n.º 1
0
    void MakeSingleton()
    {
        Debug.Log("MakeSingleton is called from Main");

        if (CrestIns != null)
        {
            Debug.Log("Game was not null and destroyed the object MakeSingleton in Main");
            Destroy(gameObject);
        }
        else
        {
            Debug.Log("Not Destroy on load Active Make Singleton in Main");
            CrestIns = this;
            DontDestroyOnLoad(gameObject);
        }
    }
Ejemplo n.º 2
0
 void Awake()
 {
     MakeSingleton();
     manager = GameObject.FindGameObjectWithTag("GameController").GetComponent <Main>();
     crest   = GameObject.FindGameObjectWithTag("GameController").GetComponent <CrestTest>();
 }