Ejemplo n.º 1
0
    void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(gameObject);
        }
        instance = this;

        Cursor.visible = false;

        LoadMatchSettings();

        currentMatchTime = timeLimit;
        if (timeLimit > 0)
        {
            gameTimerText.gameObject.SetActive(true);
            gameTimerText.SetText(currentMatchTime);
        }

        if (powerUpManager)
        {
            defaultShieldColor = powerUpManager.GetPowerUpShieldColor(EPowerUp.None);
        }
        else
        {
            defaultShieldColor = Color.white;
        }

        foreach (GameObject go in GameObject.FindGameObjectsWithTag("Player"))
        {
            PlayerController p = go.GetComponent <PlayerController>();
            if (p != null)
            {
                playerControllers.Add(p);
            }
        }
    }