Esempio n. 1
0
    private void SendEmailsAsAppropriate()
    {
        float secondsIntoGame = totalLevelLength - secondsRemaining;

        if ((secondsIntoGame / totalLevelLength) >= (1.0f / 3.0f) && !firstEmailSent)
        {
            if (OnTrack())
            {
                emailController.AddEmailToInbox(1, true);
            }
            else
            {
                emailController.AddEmailToInbox(1, false);
            }
            firstEmailSent = true;
            source.PlayOneShot(newEmail, 1.0f);
        }
        else if ((secondsIntoGame / totalLevelLength) >= (2.0f / 3.0f) && !secondEmailSent)
        {
            if (OnTrack())
            {
                emailController.AddEmailToInbox(2, true);
            }
            else
            {
                emailController.AddEmailToInbox(2, false);
            }
            secondEmailSent = true;
            source.PlayOneShot(newEmail, 1.0f);
        }
    }