Esempio n. 1
0
    public void Update()
    {
        if (RewiredPlayer.GetButtonDown("Level1"))
        {
            LoadLevel(1);
        }
        if (RewiredPlayer.GetButtonDown("Level2"))
        {
            LoadLevel(2);
        }
        if (RewiredPlayer.GetButtonDown("Level3"))
        {
            LoadLevel(3);
        }

        List <int> combinedVotes = new List <int>();

        for (int i = 0; i < votes.Length; i++)
        {
            for (int j = 0; j < votes[i]; j++)
            {
                combinedVotes.Add(i);
            }
        }

        if (combinedVotes.Count > 0)
        {
            if (spawning == false)
            {
                Invoke("SelectLevel", voteTime);
            }
        }
        else if (combinedVotes.Count <= 0)
        {
            CancelInvoke("SelectLevel");
            spawning = false;
        }
    }
Esempio n. 2
0
 public bool GetButtonDown(InputActions input)
 {
     return(RewiredPlayer.GetButtonDown(input.ToString()));
 }