using UnityEngine;
namespace Lean.Transition.Method
{
/// This component allows you to specify which transition must finish before the next transition can begin.
[HelpURL(LeanTransition.HelpUrlPrefix + "LeanQueue")]
[AddComponentMenu(LeanTransition.MethodsMenuPrefix + "Queue" + LeanTransition.MethodsMenuSuffix + "(LeanQueue)")]
public class LeanQueue : LeanMethod
{
public override void Register()
{
LeanTransition.CurrentQueue = Target != null ? Target.PreviousState : null;
}
[Tooltip("The next transition will only begin after this transition has finished.")]
public LeanMethodWithState Target;
}
}
namespace Lean.Transition
{
public static partial class LeanExtensions
{
/// This allows you to specify which transition must finish before the next transition can begin.
public static T QueueTransition(this T target, LeanState beginAfter)
where T : Component
{
LeanTransition.CurrentQueue = beginAfter; return target;
}
/// This allows you to specify which transition must finish before the next transition can begin.
public static GameObject QueueTransition(this GameObject target, LeanState beginAfter)
{
LeanTransition.CurrentQueue = beginAfter; return target;
}
}
}