Ejemplo n.º 1
0
 void Awake()
 {
     if (OneShotSound.instance == null)
     {                                 // 인스턴스가 비어있으면
         OneShotSound.instance = this; //이것의 인스턴스를 집어넣는다.
     }
 }
Ejemplo n.º 2
0
    public void PlayOneShot(OneShotSound clip, AudioSource source)
    {
        source.clip = null;
        switch (clip)
        {
        case OneShotSound.FootStep:
            source.clip = footstep;
            break;

        default:
            break;
        }

        if (source.clip != null)
        {
            source.PlayOneShot(footstep);
        }
    }