Exemplo n.º 1
0
 private void Awake()
 {
     //if (instance == null && name.ToLower().Contains("prefab") == false)
     if (instance == null)
     {
         //UnityEngine.Debug.Log("Found a GameGO: " + gameObject.name);
         instance = this;
         DontDestroyOnLoad(this);
     }
     else
     {
         UnityEngine.Debug.Log("Found a GameGO: " + name);
         Destroy(gameObject);
         return;
     }
 }
Exemplo n.º 2
0
    public static void CreateGameGO()
    {
        //UnityEngine.Debug.Log("Loading GameGO ...");
        GameGO gameGOPrefab = Resources.Load <GameGO>(Folder + "/GameGOPrefab");

        if (gameGOPrefab == null)
        {
            UnityEngine.Debug.Log("Unable to find: GameGOPrefab");
            return;
        }
        GameGO.instance = null;
        GameGO gameGO = GameObject.Instantiate(gameGOPrefab);

        gameGO.name     = "Game-GO";
        GameGO.instance = gameGO;
        UnityEngine.Debug.Log(gameGO.name + " was created");
        //GameObject.Destroy(gameGOPrefab);
    }
Exemplo n.º 3
0
 private void Awake()
 {
     GameGO.Check();
 }