using UnityEngine; using System.Collections; using System.Collections.Generic; namespace R0bbie.Timeline { /// /// DeactivateCommands StepCmd type, used to deactivate a list of commands which may have been left activated from a previous step /// [AddComponentMenu("Timeline/Commands/Deactivate Commands (Step Command)")] [RequireComponent(typeof(Step))] public class DeactivateCommandsCmd : StepCmd { [SerializeField] private List commandsToDeactivate = new List(); /// /// Initialise command (called before Activate) /// protected override void Init() { init = true; } public override void Activate(Step _parentStep) { base.Activate(_parentStep); // Loop through and deactivate all desired commands foreach (StepCmd command in commandsToDeactivate) { command.DeactivateEarly(); } // Then job of this command is done, complete it and deactivate Complete(); } protected override void Cleanup() { } } }