Esempio n. 1
0
    public void ActivateRandomIssue()
    {
        if (amountOfIssues < 4)
        {
            probAcc += Time.deltaTime;
        }

        if (probAcc >= currentTimeTilProblem)
        {
            probAcc = 0;
            bool issueSpawned = false;

            while (!issueSpawned && amountOfIssues < 4)
            {
                int index = Random.Range(0, 4);
                if (index == 0)
                {
                    if (motionManager.game_solved)
                    {
                        motionManager.ResetIssue();
                        issueSpawned = true;
                    }
                }
                else if (index == 1)
                {
                    if (kotzManager.game_solved)
                    {
                        kotzManager.ResetIssue();
                        issueSpawned = true;
                    }
                }
                else if (index == 2)
                {
                    if (whackManager.game_solved)
                    {
                        whackManager.ResetIssue();
                        issueSpawned = true;
                    }
                }
                else if (index == 3)
                {
                    if (waterBallManager.game_solved)
                    {
                        waterBallManager.ResetIssue();
                        issueSpawned = true;
                    }
                }
            }
        }
    }