Пример #1
0
    public void UnlockVote(LevelVoter v)
    {
        int ind = voters.IndexOf(v);

        voters[ind].locked = false;

        indicators[ind].color = voters[ind].color * .75f;
    }
Пример #2
0
    public void LockInVote(LevelVoter v)
    {
        int ind = voters.IndexOf(v);//voters.FindIndex(voter => voter.index == v.index);

        voters[ind].locked = true;

        indicators[ind].color = voters[ind].color;
    }
Пример #3
0
    public void SelectByPlayer(LevelVoter v)
    {
        if (voters.Contains(v))
        {
            return;
        }

        voters.Add(v);

        indicators[voters.Count - 1].color = v.color * .75f;

        numSelectedBy++;
    }
Пример #4
0
    public void DeselectByPlayer(LevelVoter v)
    {
        voters.Remove(v);

        numSelectedBy--;

        for (int j = 0; j < 4; j++)
        {
            if (j < voters.Count)
            {
                indicators[j].color = voters[j].color * (voters[j].locked ? 1 : .75f);
            }
            else
            {
                indicators[j].color = Color.clear;
            }
        }
    }
Пример #5
0
    // Use this for initialization
    void Start()
    {
        gm = GameObject.Find("GameManager").GetComponent <GameManager>();

        Player[] players = gm.AllPlayers;

        voters = new LevelVoter[players.Length];

        for (int i = 0; i < players.Length; i++)
        {
            voters[i] = new LevelVoter(i, players[i].Color);
            levelButtons[0].SelectByPlayer(voters[i]);
        }

        prevStates = new GamePadState[4];

        countdownTimer         = 30;
        levelSelectedCountdown = 3;
    }