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(data); } private StopSoundtrackGameAction Duplicate(GameActionsController controller = null) { StopSoundtrackGameAction action = new StopSoundtrackGameAction(controller == null ? this.controller : controller); action.controller = controller; action.fadeOutTime = fadeOutTime; return action; } } }