39 lines
2.8 KiB
Plaintext
39 lines
2.8 KiB
Plaintext
|
%YAML 1.1
|
||
|
%TAG !u! tag:unity3d.com,2011:
|
||
|
--- !u!114 &11400000
|
||
|
MonoBehaviour:
|
||
|
m_ObjectHideFlags: 0
|
||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||
|
m_PrefabInstance: {fileID: 0}
|
||
|
m_PrefabAsset: {fileID: 0}
|
||
|
m_GameObject: {fileID: 0}
|
||
|
m_Enabled: 1
|
||
|
m_EditorHideFlags: 0
|
||
|
m_Script: {fileID: 11500000, guid: a0e5d060f45ca564cba1173332d781d0, type: 3}
|
||
|
m_Name: Bool
|
||
|
m_EditorClassIdentifier:
|
||
|
Body: "using TARGET = {COMPONENT_FULL};\r\n\r\nnamespace Lean.Transition.Method\r\n{\r\n\t///
|
||
|
<summary>This component allows you to transition the {COMPONENT}'s {PROPERTY}
|
||
|
value.</summary>\r\n\t[UnityEngine.HelpURL(LeanTransition.HelpUrlPrefix + \"Lean{TITLE}\")]\r\n\t[UnityEngine.AddComponentMenu(LeanTransition.MethodsMenuPrefix
|
||
|
+ \"{COMPONENT}/{COMPONENT}.{PROPERTY}\" + LeanTransition.MethodsMenuSuffix +
|
||
|
\"(Lean{TITLE})\")]\r\n\tpublic class Lean{TITLE} : LeanMethodWithStateAndTarget\r\n\t{\r\n\t\tpublic
|
||
|
override System.Type GetTargetType()\r\n\t\t{\r\n\t\t\treturn typeof(TARGET);\r\n\t\t}\r\n\r\n\t\tpublic
|
||
|
override void Register()\r\n\t\t{\r\n\t\t\tPreviousState = Register(GetAliasedTarget(Data.Target),
|
||
|
Data.Value, Data.Duration);\r\n\t\t}\r\n\r\n\t\tpublic static LeanState Register(TARGET
|
||
|
target, bool value, float duration)\r\n\t\t{\r\n\t\t\tvar state = LeanTransition.SpawnWithTarget(State.Pool,
|
||
|
target);\r\n\r\n\t\t\tstate.Value = value;\r\n\r\n\t\t\treturn LeanTransition.Register(state,
|
||
|
duration);\r\n\t\t}\r\n\r\n\t\t[System.Serializable]\r\n\t\tpublic class State
|
||
|
: LeanStateWithTarget<TARGET>\r\n\t\t{\r\n\t\t\t[UnityEngine.Tooltip(\"The {PROPERTY}
|
||
|
value will transition to this.\")]\r\n\t\t\t{FSA}{ATTRIBUTE}public bool Value{DEFAULT};\r\n\r\n\t\t\tpublic
|
||
|
override int CanFill\r\n\t\t\t{\r\n\t\t\t\tget\r\n\t\t\t\t{\r\n\t\t\t\t\treturn
|
||
|
Target != null && Target.{PROPERTY} != Value ? 1 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tpublic
|
||
|
override void FillWithTarget()\r\n\t\t\t{\r\n\t\t\t\tValue = Target.{PROPERTY};\r\n\t\t\t}\r\n\r\n\t\t\tpublic
|
||
|
override void BeginWithTarget()\r\n\t\t\t{\r\n\t\t\t}\r\n\r\n\t\t\tpublic override
|
||
|
void UpdateWithTarget(float progress)\r\n\t\t\t{\r\n\t\t\t\tif (progress == 1.0f)\r\n\t\t\t\t{\r\n\t\t\t\t\tTarget.{PROPERTY}
|
||
|
= Value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tpublic static System.Collections.Generic.Stack<State>
|
||
|
Pool = new System.Collections.Generic.Stack<State>(); public override void Despawn()
|
||
|
{ Pool.Push(this); }\r\n\t\t}\r\n\r\n\t\tpublic State Data;\r\n\t}\r\n}\r\n\r\nnamespace
|
||
|
Lean.Transition\r\n{\r\n\tpublic static partial class LeanExtensions\r\n\t{\r\n\t\tpublic
|
||
|
static TARGET {PROPERTY}Transition(this TARGET target, bool value, float duration)\r\n\t\t{\r\n\t\t\tMethod.Lean{TITLE}.Register(target,
|
||
|
value, duration); return target;\r\n\t\t}\r\n\t}\r\n}"
|