예제 #1
0
 public override void OnEnter()
 {
     if (DebugMode.Value)
     {
         DDebug.Log("Playmaker - State Name [" + State.Name + "] - Unmute All Sounds");
     }
     SoundyManager.UnmuteAllSounds();
     if (FinishImmediately.Value)
     {
         Finish();
     }
 }
        public override void OnEnter(Node previousActiveNode, Connection connection)
        {
            base.OnEnter(previousActiveNode, connection);
            if (ActiveGraph == null)
            {
                return;
            }

            switch (SoundAction)
            {
            case SoundActions.Play:
                if (HasSound)
                {
                    SoundyManager.Play(SoundData);
                }
                break;

            case SoundActions.Stop:
                SoundyManager.StopAllSounds();
                break;

            case SoundActions.Pause:
                SoundyManager.PauseAllSounds();
                break;

            case SoundActions.Unpause:
                SoundyManager.UnpauseAllSounds();
                break;

            case SoundActions.Mute:
                SoundyManager.MuteAllSounds();
                break;

            case SoundActions.Unmute:
                SoundyManager.UnmuteAllSounds();
                break;

            default: throw new ArgumentOutOfRangeException();
            }

            if (!FirstOutputSocket.IsConnected)
            {
                return;
            }
            ActiveGraph.SetActiveNodeByConnection(FirstOutputSocket.FirstConnection);
        }