Exemple #1
0
    void OnTriggerStay(Collider other)
    {
        if (!activated && other.name == "_P_Clown_Fish_Character_")
        {
            triggerTimer += Time.deltaTime;
            //Debug.Log("loading...");
            //Debug.Log(triggerTimer);
            //lightToDim.intensity = lightToDim.intensity - .08f;

            // activate after timerLimit seconds
            if (triggerTimer > timerLimit)
            {
                gui.TurnOnGUI(this.gameObject);

                if (playAudio)
                {
                    if (!audio.isPlaying)
                    {
                        audio.Play();
                        playAudio = false;                         //signal that it is not okay for audio to continuously repeat
                    }
                }
            }
        }
    }
Exemple #2
0
    void OnTriggerStay()
    {
        if (!activated)
        {
            triggerTimer += Time.deltaTime;
            Debug.Log("loading...");

            // activate after a few seconds
            if (triggerTimer > timerLimit)
            {
                activated = true;
                gui.TurnOnGUI(this.gameObject);

                // start knowledge drop
                kDrop.TurnOn();
            }
        }
    }