示例#1
0
    void OnTriggerEnter()
    {
        // Dodaj czas oraz odegraj dzwiek
        GameObject timeText = GameObject.Find("timeText");

        timeText.GetComponent <TimeCounter>().elapsedTime += 4.0f;
        if (!GameGUI.Mute())
        {
            audio.Play();
        }
    }
示例#2
0
文件: Star.cs 项目: rav3r/AdRally
    void OnTriggerEnter(Collider collider)
    {
        if (collider.CompareTag("Player") && this.enabled)
        {
            // Zdobyles gwiazdke - odjecie czasu, odegranie dzwieku i schowanie gwiazdki

            GameObject  timeText = GameObject.Find("timeText");
            TimeCounter counter  = timeText.GetComponent <TimeCounter>();
            counter.elapsedTime -= 2.0f;
            if (counter.elapsedTime < 0)
            {
                counter.elapsedTime = 0;
            }

            if (!GameGUI.Mute())
            {
                audio.Play();
            }

            renderer.enabled = false;
            this.enabled     = false;
        }
    }