コード例 #1
0
 void Update()
 {
     if (stop && sound != null)
     {
         sound.StopAll();
         stop = false;
     }
 }
コード例 #2
0
    void Update()
    {
        if (sound != null)
        {
            timer += Time.deltaTime;
            if (retrigger && timer > retriggerThreshhold)
            {
                timer = 0;
                sound.Play();
            }
        }

        if (stop)
        {
            sound.StopAll();
            stop = false;
        }
    }