Exemplo n.º 1
0
    // Start is called before the first frame update
    void Awake()
    {
        if (instance != null)
        {
            Debug.LogError("Only one GameManager can exist");
        }
        instance = this;

        //On remplis les listes de coffres , d'entree et de sortie au debut (avec les tags correspondant)
        foreach (var coffre in GameObject.FindGameObjectsWithTag("Coffre"))
        {
            listCoffres.Add(coffre.transform);
        }

        foreach (var sortie in GameObject.FindGameObjectsWithTag("Sortie"))
        {
            listSorties.Add(sortie.transform);
        }
        foreach (var entree in GameObject.FindGameObjectsWithTag("Entree"))
        {
            listEntrees2.Add(entree);
        }

        // Retrieve jauge controller
        jaugeScoreController = jaugeScore.GetComponent <JaugeController>();
        jaugeDashController  = jaugeDash.GetComponent <JaugeController>();

        StartGame();
    }
Exemplo n.º 2
0
 private void Awake()
 {
     Instance = this;
 }