123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- using System.Collections;
- using System.Linq;
- using System.Collections.Generic;
- using UnityEngine;
- using Sirenix.OdinInspector;
- using KairoEngine.Core;
- using KairoEngine.Core.GameActions;
- namespace KairoEngine.SoundtrackSystem.GameActions
- {
- [System.Serializable, HideReferenceObjectPicker]
- public class StopSoundtrackGameAction : GameActionBase
- {
- public override string name
- {
- get
- {
- return $"Stop Soundtrack";
- }
- }
- public override GameActionsController controller {
- get => _controller;
- set
- {
- _controller = value;
- typeName = "StopSoundtrackGameAction";
- className = this.GetType().AssemblyQualifiedName;
- }
- }
- public override string GetTypeName() => "StopSoundtrackGameAction";
- public override string GetActionName() => "Soundtrack/Stop Soundtrack";
- [FoldoutGroup("@name")]
- public float fadeOutTime = 1f;
-
- public StopSoundtrackGameAction(GameActionsController controller) : base(controller)
- {
- this.controller = controller;
- className = this.GetType().AssemblyQualifiedName;
- }
- public override void Start()
- {
- SoundtrackManager.FadeOutSoundtrack(fadeOutTime);
- _done = true;
- _started = true;
- }
- public override void Update() { }
- public override void Restart()
- {
- _done = false;
- _started = false;
- }
- public static StopSoundtrackGameAction JSONToStopSoundtrackGameAction(string data)
- {
- return JsonUtility.FromJson<StopSoundtrackGameAction>(data);
- }
- private StopSoundtrackGameAction Duplicate(GameActionsController controller = null)
- {
- StopSoundtrackGameAction action = new StopSoundtrackGameAction(controller == null ? this.controller : controller);
- action.controller = controller;
- action.fadeOutTime = fadeOutTime;
- return action;
- }
- }
- }
|