diff --git a/Assets/Fungus/Sprite/Commands/SetAnimBool.cs b/Assets/Fungus/Sprite/Commands/SetAnimBool.cs new file mode 100644 index 00000000..4712eacc --- /dev/null +++ b/Assets/Fungus/Sprite/Commands/SetAnimBool.cs @@ -0,0 +1,42 @@ +using UnityEngine; +using System; +using System.Collections; + +namespace Fungus.Script +{ + [CommandInfo("Animation", + "Set Anim Bool", + "Sets a boolean parameter on an animator to control an animation")] + public class SetAnimBool : FungusCommand + { + public Animator animator; + public string parameterName; + public BooleanData value; + + public override void OnEnter() + { + if (animator != null) + { + animator.SetBool(parameterName, value.Value); + } + + Continue(); + } + + public override string GetSummary() + { + if (animator == null) + { + return "Error: No animator selected"; + } + + return animator.name + " (" + parameterName + ")"; + } + + public override Color GetButtonColor() + { + return new Color32(170, 204, 169, 255); + } + } + +} \ No newline at end of file diff --git a/Assets/Fungus/Sprite/Commands/SetAnimBool.cs.meta b/Assets/Fungus/Sprite/Commands/SetAnimBool.cs.meta new file mode 100644 index 00000000..550898d1 --- /dev/null +++ b/Assets/Fungus/Sprite/Commands/SetAnimBool.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ee63e642958494f1ebed8116ae4b1103 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Assets/Fungus/Sprite/Commands/SetAnimFloat.cs b/Assets/Fungus/Sprite/Commands/SetAnimFloat.cs new file mode 100644 index 00000000..f3638ffb --- /dev/null +++ b/Assets/Fungus/Sprite/Commands/SetAnimFloat.cs @@ -0,0 +1,42 @@ +using UnityEngine; +using System; +using System.Collections; + +namespace Fungus.Script +{ + [CommandInfo("Animation", + "Set Anim Float", + "Sets a float parameter on an animator to control an animation")] + public class SetAnimFloat : FungusCommand + { + public Animator animator; + public string parameterName; + public FloatData value; + + public override void OnEnter() + { + if (animator != null) + { + animator.SetFloat(parameterName, value.Value); + } + + Continue(); + } + + public override string GetSummary() + { + if (animator == null) + { + return "Error: No animator selected"; + } + + return animator.name + " (" + parameterName + ")"; + } + + public override Color GetButtonColor() + { + return new Color32(170, 204, 169, 255); + } + } + +} \ No newline at end of file diff --git a/Assets/Fungus/Sprite/Commands/SetAnimFloat.cs.meta b/Assets/Fungus/Sprite/Commands/SetAnimFloat.cs.meta new file mode 100644 index 00000000..b3105f53 --- /dev/null +++ b/Assets/Fungus/Sprite/Commands/SetAnimFloat.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fb1f6a369ef8c40bda77241018ab6bd6 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Assets/Fungus/Sprite/Commands/SetAnimInteger.cs b/Assets/Fungus/Sprite/Commands/SetAnimInteger.cs new file mode 100644 index 00000000..c34dc992 --- /dev/null +++ b/Assets/Fungus/Sprite/Commands/SetAnimInteger.cs @@ -0,0 +1,42 @@ +using UnityEngine; +using System; +using System.Collections; + +namespace Fungus.Script +{ + [CommandInfo("Animation", + "Set Anim Integer", + "Sets an integer parameter on an animator to control an animation")] + public class SetAnimInteger : FungusCommand + { + public Animator animator; + public string parameterName; + public IntegerData value; + + public override void OnEnter() + { + if (animator != null) + { + animator.SetInteger(parameterName, value.Value); + } + + Continue(); + } + + public override string GetSummary() + { + if (animator == null) + { + return "Error: No animator selected"; + } + + return animator.name + " (" + parameterName + ")"; + } + + public override Color GetButtonColor() + { + return new Color32(170, 204, 169, 255); + } + } + +} \ No newline at end of file diff --git a/Assets/Fungus/Sprite/Commands/SetAnimInteger.cs.meta b/Assets/Fungus/Sprite/Commands/SetAnimInteger.cs.meta new file mode 100644 index 00000000..8da48a92 --- /dev/null +++ b/Assets/Fungus/Sprite/Commands/SetAnimInteger.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 76641c2c16481448eb6c0c1184fcdebe +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Assets/Fungus/Sprite/Commands/SetAnimTrigger.cs b/Assets/Fungus/Sprite/Commands/SetAnimTrigger.cs new file mode 100644 index 00000000..2f3ad400 --- /dev/null +++ b/Assets/Fungus/Sprite/Commands/SetAnimTrigger.cs @@ -0,0 +1,41 @@ +using UnityEngine; +using System; +using System.Collections; + +namespace Fungus.Script +{ + [CommandInfo("Animation", + "Set Anim Trigger", + "Sets a trigger parameter on an animator to control an animation")] + public class SetAnimTrigger : FungusCommand + { + public Animator animator; + public string parameterName; + + public override void OnEnter() + { + if (animator != null) + { + animator.SetTrigger(parameterName); + } + + Continue(); + } + + public override string GetSummary() + { + if (animator == null) + { + return "Error: No animator selected"; + } + + return animator.name + " (" + parameterName + ")"; + } + + public override Color GetButtonColor() + { + return new Color32(170, 204, 169, 255); + } + } + +} \ No newline at end of file diff --git a/Assets/Fungus/Sprite/Commands/SetAnimTrigger.cs.meta b/Assets/Fungus/Sprite/Commands/SetAnimTrigger.cs.meta new file mode 100644 index 00000000..ed91e648 --- /dev/null +++ b/Assets/Fungus/Sprite/Commands/SetAnimTrigger.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0729d4f369e6a4241a6e7e3b8b9c1933 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: