コード例 #1
0
ファイル: PlayerMutter.cs プロジェクト: natewinck/LightsOut
  void PlayMutter(SoundBank otherSoundBank, Collider other) {
    // Get a mutter if exists.
    var clip = otherSoundBank.Draw(SoundBank.MUTTERS);
    if (clip == null) return;

    // Get the child of this (which should be the hand) and add this audio clip to it, then play
    m_MutterAudioSource.clip = clip;
    m_MutterAudioSource.PlayDelayed(0.5f);

    if (m_StateMachine.GetState() == "penalty") {
      Debug.Log("delaying penalty to playing");
      StartCoroutine(m_StateMachine.DelayedTransitionTo("playing", clip.length + 0.5f));
    }
  }