コード例 #1
0
 public void CheckButtonSelected(Button button)
 {
     if (queueButtons.Any() && button == queueButtons.Peek())
     {
         queueButtons.Dequeue();
         button.Activate();
         SequenceChanged?.Invoke(queueButtons.Count);
     }
     else
     {
         Debug.Log("Game was stopped by losing");
         QueueReady?.Invoke(false);
         LoseLevel?.Invoke();
     }
 }
コード例 #2
0
    private IEnumerator CollectQueue()
    {
        queueButtons = new Queue <Button>();

        Button button;

        for (int i = 0; i < queueLength; i++)
        {
            button = childButtons[UnityEngine.Random.Range(0, childButtons.Count)];
            queueButtons.Enqueue(button);
            button.PutInQueue();

            yield return(new WaitForSeconds(activateButtonDelay));
        }
        QueueReady?.Invoke(true);
    }