Beispiel #1
0
    public IEnumerator ChallengeBurn(int challengeIndex, int time, bool oneGame)
    {
        float challengeTime = 0;

        if (oneGame)
        {
            while (!gameOver && challengeTime < time)
            {
                if (isBurning)
                {
                    challengeTime += Time.deltaTime;
                }
                yield return(null);
            }
        }
        else
        {
            while (!gameOver && !isPaused && challengeTime < time)
            {
                if (isBurning)
                {
                    challengeTime += Time.deltaTime;
                }
                yield return(null);
            }
        }
        if (challengeTime > time)
        {
            challengeCont.ChallengeCompleted(challengeIndex);
        }
        else if (!oneGame)
        {
            challengeCont.SetChallengeData(challengeIndex, (int)challengeTime);
        }
    }
Beispiel #2
0
    public IEnumerator ChallengeKillSum(int challengeIndex, int killGoal, bool isOneGame)
    {
        int helperInt = killSum;

        if (isOneGame)
        {
            while (!gameOver && killSum - helperInt < killGoal)
            {
                yield return(null);
            }
        }
        else
        {
            while (!gameOver && !isPaused && killSum - helperInt < killGoal)
            {
                yield return(null);
            }
        }
        if (killSum - helperInt >= killGoal)
        {
            challengeCont.ChallengeCompleted(challengeIndex);
        }
        else if (!isOneGame)
        {
            if (gameOver)
            {
                challengeCont.SetChallengeData(challengeIndex, killSum - helperInt);
            }
            else if (isPaused)
            {
                challengeCont.SetChallengeData(challengeIndex, killSum - helperInt);
            }
        }
    }