Ejemplo n.º 1
0
    void UpdateSlider(TeamProperty team, float health)
    {
        Slider teamSlider = null;

        switch (team.team)
        {
        case PlayerTeam.CYAN:
            teamSlider = cyanSlider;
            StartFadingRoutine(ref cyanFadingRoutine, ref cyanBackgroundSlider, health);
            break;

        case PlayerTeam.MAGENTA:
            teamSlider = magentaSlider;
            StartFadingRoutine(ref magentaFadingRoutine, ref magentaBackgroundSlider, health);
            break;

        default:
            Debug.Log("Can't update player!");
            return;
        }

        teamSlider.value = health;
        if (health <= 0)
        {
            pause.Win(team);
        }
    }
Ejemplo n.º 2
0
    public void Win(TeamProperty team)
    {
        SetPaused(true);
        gameActive = false;

        if (team == null)
        {
            textComponent.text  = drawText;
            textComponent.color = Color.white;
        }
        else
        {
            textComponent.text  = string.Format(winText, team.name);
            textComponent.color = team.teamColor;
        }
        StartCoroutine(Interactable());
    }
Ejemplo n.º 3
0
 private set => SetValue(TeamProperty, value);