private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
    }
Example #2
0
    void Start()
    {
        initialMonster[0] = new List <GameObject>();
        initialMonster[1] = new List <GameObject>();
        initialMonster[2] = new List <GameObject>();

        mixerManager = GameObject.Find("Gestor de monstruos").GetComponent <MonsterMixerManager>();
        ObtainCreatedMonsters();

        uiManager = GameObject.Find("Main Camera/Canvas").GetComponent <UiManager>();
        uiManager.UpdateMonsterType1Qty(initialMonster[0].Count);
        uiManager.UpdateMonsterType2Qty(initialMonster[1].Count);
        uiManager.UpdateMonsterType3Qty(initialMonster[2].Count);
        uiManager.SetButtonType1Text(mixerManager.creaciones[0].name);
        uiManager.SetButtonType2Text(mixerManager.creaciones[1].name);
        uiManager.SetButtonType3Text(mixerManager.creaciones[2].name);
    }