mirror of
https://github.com/BlackMATov/unity-iso-tools.git
synced 2025-12-15 01:12:05 +07:00
PlayMaker action tooltips
This commit is contained in:
@@ -3,7 +3,8 @@ using HutongGames.PlayMaker;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools")]
|
||||
[HutongGames.PlayMaker.Tooltip("Gets the Mode of a IsoObject and stores it in a Enum Variable")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Gets the Mode of a IsoObject and stores it in a Enum Variable")]
|
||||
public class IsoGetMode : IsoComponentAction<IsoObject> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoObject))]
|
||||
|
||||
@@ -3,7 +3,9 @@ using HutongGames.PlayMaker;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools")]
|
||||
[HutongGames.PlayMaker.Tooltip("Gets the Position of a IsoObject and stores it in a Vector3 Variable or each Axis in a Float Variable")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Gets the Position of a IsoObject and stores it " +
|
||||
"in a Vector3 Variable or each Axis in a Float Variable")]
|
||||
public class IsoGetPosition : IsoComponentAction<IsoObject> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoObject))]
|
||||
|
||||
@@ -3,7 +3,9 @@ using HutongGames.PlayMaker;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools")]
|
||||
[HutongGames.PlayMaker.Tooltip("Gets the Size of a IsoObject and stores it in a Vector3 Variable or each Axis in a Float Variable")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Gets the Size of a IsoObject and stores it " +
|
||||
"in a Vector3 Variable or each Axis in a Float Variable")]
|
||||
public class IsoGetSize : IsoComponentAction<IsoObject> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoObject))]
|
||||
|
||||
@@ -3,22 +3,36 @@ using HutongGames.PlayMaker;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools")]
|
||||
[HutongGames.PlayMaker.Tooltip("Resizes a IsoObject. Use a Vector3 variable and/or XYZ components. To leave any axis unchanged, set variable to 'None'.")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Resizes a IsoObject. " +
|
||||
"Use a Vector3 variable and/or XYZ components. " +
|
||||
"To leave any axis unchanged, set variable to 'None'.")]
|
||||
public class IsoResize : IsoComponentAction<IsoObject> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoObject))]
|
||||
[HutongGames.PlayMaker.Tooltip("The IsoObject to resize.")]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Use a stored resize Vector3, " +
|
||||
"and/or set individual axis below.")]
|
||||
public FsmVector3 vector;
|
||||
|
||||
public FsmFloat x;
|
||||
public FsmFloat y;
|
||||
public FsmFloat z;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Resize over one second")]
|
||||
public bool perSecond;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
||||
public bool everyFrame;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Perform the resize in LateUpdate.")]
|
||||
public bool lateUpdate;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Perform the resize in FixedUpdate.")]
|
||||
public bool fixedUpdate;
|
||||
|
||||
public override void Reset() {
|
||||
@@ -71,22 +85,12 @@ namespace IsoTools.PlayMaker.Actions {
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
var value = vector.IsNone
|
||||
? Vector3.zero
|
||||
: vector.Value;
|
||||
|
||||
if ( !x.IsNone ) {
|
||||
value.x = x.Value;
|
||||
}
|
||||
if ( !y.IsNone ) {
|
||||
value.y = y.Value;
|
||||
}
|
||||
if ( !z.IsNone ) {
|
||||
value.z = z.Value;
|
||||
}
|
||||
|
||||
var value = vector.IsNone ? Vector3.zero : vector.Value;
|
||||
if ( !x.IsNone ) { value.x = x.Value; }
|
||||
if ( !y.IsNone ) { value.y = y.Value; }
|
||||
if ( !z.IsNone ) { value.z = z.Value; }
|
||||
isoObject.size +=
|
||||
value * (perSecond ? Time.deltaTime : 1.0f);
|
||||
perSecond ? value * Time.deltaTime : value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,10 +3,12 @@ using HutongGames.PlayMaker;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools")]
|
||||
[HutongGames.PlayMaker.Tooltip("Sets the Mode of a IsoObject.")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Sets the Mode of a IsoObject.")]
|
||||
public class IsoSetMode : IsoComponentAction<IsoObject> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoObject))]
|
||||
[HutongGames.PlayMaker.Tooltip("The IsoObject to mode.")]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[RequiredField]
|
||||
|
||||
@@ -3,21 +3,32 @@ using HutongGames.PlayMaker;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools")]
|
||||
[HutongGames.PlayMaker.Tooltip("Sets the Position of a IsoObject. To leave any axis unchanged, set variable to 'None'.")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Sets the Position of a IsoObject. " +
|
||||
"To leave any axis unchanged, set variable to 'None'.")]
|
||||
public class IsoSetPosition : IsoComponentAction<IsoObject> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoObject))]
|
||||
[HutongGames.PlayMaker.Tooltip("The IsoObject to position.")]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Use a stored Vector3 position, " +
|
||||
"and/or set individual axis below.")]
|
||||
public FsmVector3 vector;
|
||||
|
||||
public FsmFloat x;
|
||||
public FsmFloat y;
|
||||
public FsmFloat z;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
||||
public bool everyFrame;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Perform in LateUpdate.")]
|
||||
public bool lateUpdate;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Perform in FixedUpdate.")]
|
||||
public bool fixedUpdate;
|
||||
|
||||
public override void Reset() {
|
||||
@@ -69,20 +80,10 @@ namespace IsoTools.PlayMaker.Actions {
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
var value = vector.IsNone
|
||||
? isoObject.position
|
||||
: vector.Value;
|
||||
|
||||
if ( !x.IsNone ) {
|
||||
value.x = x.Value;
|
||||
}
|
||||
if ( !y.IsNone ) {
|
||||
value.y = y.Value;
|
||||
}
|
||||
if ( !z.IsNone ) {
|
||||
value.z = z.Value;
|
||||
}
|
||||
|
||||
var value = vector.IsNone ? isoObject.position : vector.Value;
|
||||
if ( !x.IsNone ) { value.x = x.Value; }
|
||||
if ( !y.IsNone ) { value.y = y.Value; }
|
||||
if ( !z.IsNone ) { value.z = z.Value; }
|
||||
isoObject.position = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,21 +3,32 @@ using HutongGames.PlayMaker;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools")]
|
||||
[HutongGames.PlayMaker.Tooltip("Sets the Size of a IsoObject. To leave any axis unchanged, set variable to 'None'.")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Sets the Size of a IsoObject. " +
|
||||
"To leave any axis unchanged, set variable to 'None'.")]
|
||||
public class IsoSetSize : IsoComponentAction<IsoObject> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoObject))]
|
||||
[HutongGames.PlayMaker.Tooltip("The IsoObject to size.")]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Use a stored Vector3 size, " +
|
||||
"and/or set individual axis below.")]
|
||||
public FsmVector3 vector;
|
||||
|
||||
public FsmFloat x;
|
||||
public FsmFloat y;
|
||||
public FsmFloat z;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
||||
public bool everyFrame;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Perform in LateUpdate.")]
|
||||
public bool lateUpdate;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Perform in FixedUpdate.")]
|
||||
public bool fixedUpdate;
|
||||
|
||||
public override void Reset() {
|
||||
@@ -69,20 +80,10 @@ namespace IsoTools.PlayMaker.Actions {
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
var value = vector.IsNone
|
||||
? isoObject.size
|
||||
: vector.Value;
|
||||
|
||||
if ( !x.IsNone ) {
|
||||
value.x = x.Value;
|
||||
}
|
||||
if ( !y.IsNone ) {
|
||||
value.y = y.Value;
|
||||
}
|
||||
if ( !z.IsNone ) {
|
||||
value.z = z.Value;
|
||||
}
|
||||
|
||||
var value = vector.IsNone ? isoObject.size : vector.Value;
|
||||
if ( !x.IsNone ) { value.x = x.Value; }
|
||||
if ( !y.IsNone ) { value.y = y.Value; }
|
||||
if ( !z.IsNone ) { value.z = z.Value; }
|
||||
isoObject.size = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,22 +3,36 @@ using HutongGames.PlayMaker;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools")]
|
||||
[HutongGames.PlayMaker.Tooltip("Translates a IsoObject. Use a Vector3 variable and/or XYZ components. To leave any axis unchanged, set variable to 'None'.")]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Translates a IsoObject. " +
|
||||
"Use a Vector3 variable and/or XYZ components. " +
|
||||
"To leave any axis unchanged, set variable to 'None'.")]
|
||||
public class IsoTranslate : IsoComponentAction<IsoObject> {
|
||||
[RequiredField]
|
||||
[CheckForComponent(typeof(IsoObject))]
|
||||
[HutongGames.PlayMaker.Tooltip("The IsoObject to translate.")]
|
||||
public FsmOwnerDefault gameObject;
|
||||
|
||||
[UIHint(UIHint.Variable)]
|
||||
[HutongGames.PlayMaker.Tooltip(
|
||||
"Use a stored translation Vector3, " +
|
||||
"and/or set individual axis below.")]
|
||||
public FsmVector3 vector;
|
||||
|
||||
public FsmFloat x;
|
||||
public FsmFloat y;
|
||||
public FsmFloat z;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Translate over one second")]
|
||||
public bool perSecond;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
|
||||
public bool everyFrame;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Perform the translate in LateUpdate.")]
|
||||
public bool lateUpdate;
|
||||
|
||||
[HutongGames.PlayMaker.Tooltip("Perform the translate in FixedUpdate.")]
|
||||
public bool fixedUpdate;
|
||||
|
||||
public override void Reset() {
|
||||
@@ -71,22 +85,12 @@ namespace IsoTools.PlayMaker.Actions {
|
||||
void DoAction() {
|
||||
var go = Fsm.GetOwnerDefaultTarget(gameObject);
|
||||
if ( UpdateCache(go) ) {
|
||||
var value = vector.IsNone
|
||||
? Vector3.zero
|
||||
: vector.Value;
|
||||
|
||||
if ( !x.IsNone ) {
|
||||
value.x = x.Value;
|
||||
}
|
||||
if ( !y.IsNone ) {
|
||||
value.y = y.Value;
|
||||
}
|
||||
if ( !z.IsNone ) {
|
||||
value.z = z.Value;
|
||||
}
|
||||
|
||||
var value = vector.IsNone ? Vector3.zero : vector.Value;
|
||||
if ( !x.IsNone ) { value.x = x.Value; }
|
||||
if ( !y.IsNone ) { value.y = y.Value; }
|
||||
if ( !z.IsNone ) { value.z = z.Value; }
|
||||
isoObject.position +=
|
||||
value * (perSecond ? Time.deltaTime : 1.0f);
|
||||
perSecond ? value * Time.deltaTime : value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user