Пример #1
0
    void Update()
    {
        // SOUND RESET
        if (AcknowledgeActive > 0)
        {
            AcknowledgeActive--;
        }
        if (BeingPushedActive > 0)
        {
            BeingPushedActive--;
        }


        // ACKNOWLEDGE SOUND ACTIVATED
        if (AcknowledgeActive >= AcknowledgementThreshold)
        {
            AckScript = AcknowledgeSoundObject.GetComponent <AcknowledgeSoundScript>();
            AckScript.AcknowledgeSound();
            AcknowledgeActive = 0;
            AckGreenLight     = false;
            Invoke("FlipGreen", 1f);
        }


        // BEING PUSHED SOUND ACTIVATED
        if (BeingPushedActive >= BeingPushedThreshold)
        {
            PshdScript = PushedSoundObject.GetComponent <PushedSoundScript>();
            PshdScript.BeingPushedSound();
            BeingPushedActive = 0;
        }

        // RANDOM IN PEACE TIME SOUNDS
        Probability = Time.deltaTime * PerMinutePeaceTalk;
        if (Random.value < Probability)
        {
            if (RandomGreenLight == true)
            {
                ;
            }
            RandomPeaceScript = RandomlySpokenPeace.GetComponent <RandomSpokenScript>();
            RandomPeaceScript.RandomlySpokenP();
            RandomGreenLight = false;
            Invoke("FlipRandomGreen", 2);
        }
    }
    void Update()
    {
        // SOUND RESET
        if (AcknowledgeActive > 0) {AcknowledgeActive--;}
        if (BeingPushedActive > 0) {BeingPushedActive--;}

        // ACKNOWLEDGE SOUND ACTIVATED
        if (AcknowledgeActive >= AcknowledgementThreshold)
        {
            AckScript = AcknowledgeSoundObject.GetComponent<AcknowledgeSoundScript>();
            AckScript.AcknowledgeSound ();
            AcknowledgeActive = 0;
            AckGreenLight = false;
            Invoke ("FlipGreen", 1f);
        }

        // BEING PUSHED SOUND ACTIVATED
        if (BeingPushedActive >= BeingPushedThreshold)
        {
            PshdScript = PushedSoundObject.GetComponent<PushedSoundScript>();
            PshdScript.BeingPushedSound();
            BeingPushedActive = 0;
        }

        // RANDOM IN PEACE TIME SOUNDS
        Probability = Time.deltaTime * PerMinutePeaceTalk;
        if (Random.value < Probability)
        {
            if (RandomGreenLight == true);
            RandomPeaceScript = RandomlySpokenPeace.GetComponent<RandomSpokenScript>();
            RandomPeaceScript.RandomlySpokenP();
            RandomGreenLight = false;
            Invoke ("FlipRandomGreen", 2);
        }
    }