extract play maker from package

This commit is contained in:
2016-10-22 16:47:21 +07:00
parent 94dc2fa581
commit e6ba2d8eb2
78 changed files with 2908 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
fileFormatVersion: 2
guid: 9c24548749fca4d25824bd0130cf681f
timeCreated: 1450630504
guid: 8a23c47afc2e94d18abf9f1cb58fb612
folderAsset: yes
timeCreated: 1449997824
licenseType: Free
DefaultImporter:
userData:

View File

@@ -0,0 +1,80 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools.Physics")]
[HutongGames.PlayMaker.Tooltip(
"Applies a force to a IsoRigidbody that simulates explosion effects. " +
"The explosion force will fall off linearly with distance.")]
public class IsoAddExplosionForce : IsoComponentAction<IsoRigidbody> {
[RequiredField]
[CheckForComponent(typeof(IsoRigidbody))]
[HutongGames.PlayMaker.Tooltip(
"The IsoRigidbody to add the explosion force to.")]
public FsmOwnerDefault gameObject;
[RequiredField]
[HutongGames.PlayMaker.Tooltip(
"The center of the explosion.")]
public FsmVector3 center;
[RequiredField]
[HutongGames.PlayMaker.Tooltip(
"The strength of the explosion.")]
public FsmFloat force;
[RequiredField]
[HutongGames.PlayMaker.Tooltip(
"The radius of the explosion.")]
public FsmFloat radius;
[HutongGames.PlayMaker.Tooltip(
"Applies the force as if it was applied from beneath the object.")]
public FsmFloat upwardsModifier;
[HutongGames.PlayMaker.Tooltip(
"The type of force to apply.")]
public ForceMode forceMode;
[HutongGames.PlayMaker.Tooltip(
"Repeat every frame.")]
public bool everyFrame;
public override void Reset() {
gameObject = null;
center = null;
force = null;
radius = null;
upwardsModifier = 0.0f;
forceMode = ForceMode.Force;
everyFrame = false;
}
public override void OnPreprocess() {
Fsm.HandleFixedUpdate = true;
}
public override void OnEnter() {
DoAction();
if ( !everyFrame ) {
Finish();
}
}
public override void OnFixedUpdate() {
DoAction();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
isoRigidbody.AddExplosionForce(
force.Value, center.Value, radius.Value,
upwardsModifier.Value, forceMode);
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 8925808e9509b47b187c8890c644ba0c
timeCreated: 1450615607
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,101 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools.Physics")]
[HutongGames.PlayMaker.Tooltip(
"Adds a force to a IsoRigidbody. " +
"Use Vector3 variable and/or Float variables for each axis.")]
public class IsoAddForce : IsoComponentAction<IsoRigidbody> {
[RequiredField]
[CheckForComponent(typeof(IsoRigidbody))]
[HutongGames.PlayMaker.Tooltip(
"The IsoRigidbody to apply the force to.")]
public FsmOwnerDefault gameObject;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Tooltip(
"Optionally apply the force at a position on the object.")]
public FsmVector3 atPosition;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Tooltip(
"A Vector3 force to add. " +
"Optionally override any axis with the X, Y, Z parameters.")]
public FsmVector3 vector;
[HutongGames.PlayMaker.Tooltip(
"Force along the X axis. To leave unchanged, set to 'None'.")]
public FsmFloat x;
[HutongGames.PlayMaker.Tooltip(
"Force along the Y axis. To leave unchanged, set to 'None'.")]
public FsmFloat y;
[HutongGames.PlayMaker.Tooltip(
"Force along the Z axis. To leave unchanged, set to 'None'.")]
public FsmFloat z;
[HutongGames.PlayMaker.Tooltip(
"Apply the force in world or local space.")]
public Space space;
[HutongGames.PlayMaker.Tooltip(
"The type of force to apply.")]
public ForceMode forceMode;
[HutongGames.PlayMaker.Tooltip(
"Repeat every frame.")]
public bool everyFrame;
public override void Reset() {
gameObject = null;
atPosition = new FsmVector3{UseVariable = true};
vector = null;
x = new FsmFloat{UseVariable = true};
y = new FsmFloat{UseVariable = true};
z = new FsmFloat{UseVariable = true};
space = Space.World;
forceMode = ForceMode.Force;
everyFrame = false;
}
public override void OnPreprocess() {
Fsm.HandleFixedUpdate = true;
}
public override void OnEnter() {
DoAction();
if ( !everyFrame ) {
Finish();
}
}
public override void OnFixedUpdate() {
DoAction();
}
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; }
if ( space == Space.World ) {
if ( atPosition.IsNone ) {
isoRigidbody.AddForce(value, forceMode);
} else {
isoRigidbody.AddForceAtPosition(
value, atPosition.Value, forceMode);
}
} else {
isoRigidbody.AddRelativeForce(value, forceMode);
}
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: f982e9e34e40d48b4a0645425b0d6c3a
timeCreated: 1450614193
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,68 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools")]
[HutongGames.PlayMaker.Tooltip(
"Convert Isometric Vector3 Variable to ScreenSpace Vector2 Variable")]
public class IsoConvertIsometricToScreen : IsoComponentAction<IsoWorld> {
[RequiredField]
[CheckForComponent(typeof(IsoWorld))]
[HutongGames.PlayMaker.Title("IsoWorld (In)")]
[HutongGames.PlayMaker.Tooltip("The IsoWorld for convertation.")]
public FsmOwnerDefault gameObject;
[RequiredField]
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Isometric Vector (In)")]
public FsmVector3 isometricVector;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Screen Vector (Out)")]
public FsmVector2 storeScreenVector;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Screen X (Out)")]
public FsmFloat storeScreenX;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Screen Y (Out)")]
public FsmFloat storeScreenY;
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
public bool everyFrame;
public override void Reset() {
gameObject = null;
isometricVector = null;
storeScreenVector = null;
storeScreenX = null;
storeScreenY = null;
everyFrame = false;
}
public override void OnEnter() {
DoAction();
if ( !everyFrame ) {
Finish();
}
}
public override void OnUpdate() {
DoAction();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
var value = isoWorld.IsoToScreen(isometricVector.Value);
storeScreenVector.Value = value;
storeScreenX.Value = value.x;
storeScreenY.Value = value.y;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 2b59e8593133b453bb434f86de86993a
timeCreated: 1450193215
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,81 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools")]
[HutongGames.PlayMaker.Tooltip(
"Convert ScreenSpace Vector2 Variable to Isometric Vector3 Variable")]
public class IsoConvertScreenToIsometric : IsoComponentAction<IsoWorld> {
[RequiredField]
[CheckForComponent(typeof(IsoWorld))]
[HutongGames.PlayMaker.Title("IsoWorld (In)")]
[HutongGames.PlayMaker.Tooltip("The IsoWorld for convertation.")]
public FsmOwnerDefault gameObject;
[RequiredField]
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Screen Vector (In)")]
public FsmVector2 screenVector;
[HutongGames.PlayMaker.Title("Specific Isometric Z (In)")]
[HutongGames.PlayMaker.Tooltip("Specific Isometric Z or 0.0f for 'None'")]
public FsmFloat specificIsometricZ;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Isometric Vector (Out)")]
public FsmVector3 storeIsometricVector;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Isometric X (Out)")]
public FsmFloat storeIsometricX;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Isometric Y (Out)")]
public FsmFloat storeIsometricY;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Isometric Z (Out)")]
public FsmFloat storeIsometricZ;
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
public bool everyFrame;
public override void Reset() {
gameObject = null;
screenVector = null;
specificIsometricZ = 0.0f;
storeIsometricVector = null;
storeIsometricX = null;
storeIsometricY = null;
storeIsometricZ = null;
everyFrame = false;
}
public override void OnEnter() {
DoAction();
if ( !everyFrame ) {
Finish();
}
}
public override void OnUpdate() {
DoAction();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
var value = specificIsometricZ.IsNone
? isoWorld.ScreenToIso(screenVector.Value)
: isoWorld.ScreenToIso(screenVector.Value, specificIsometricZ.Value);
storeIsometricVector.Value = value;
storeIsometricX.Value = value.x;
storeIsometricY.Value = value.y;
storeIsometricZ.Value = value.z;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 693a3d4871bd64c19a94cce4a562f96a
timeCreated: 1450193231
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,46 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools.Physics")]
[HutongGames.PlayMaker.Tooltip(
"Gets the Drag of a IsoRigidbody and stores it in a Float Variable.")]
public class IsoGetDrag : IsoComponentAction<IsoRigidbody> {
[RequiredField]
[CheckForComponent(typeof(IsoRigidbody))]
public FsmOwnerDefault gameObject;
[RequiredField]
[UIHint(UIHint.Variable)]
public FsmFloat storeResult;
public bool everyFrame;
public override void Reset() {
gameObject = null;
storeResult = null;
everyFrame = false;
}
public override void OnEnter() {
DoAction();
if ( !everyFrame ) {
Finish();
}
}
public override void OnUpdate() {
DoAction();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
storeResult.Value = isoRigidbody.drag;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: b325fb1bc25fa4247b1102fe5ca8aa13
timeCreated: 1450621080
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,46 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools.Physics")]
[HutongGames.PlayMaker.Tooltip(
"Gets the Mass of a IsoRigidbody and stores it in a Float Variable.")]
public class IsoGetMass : IsoComponentAction<IsoRigidbody> {
[RequiredField]
[CheckForComponent(typeof(IsoRigidbody))]
public FsmOwnerDefault gameObject;
[RequiredField]
[UIHint(UIHint.Variable)]
public FsmFloat storeResult;
public bool everyFrame;
public override void Reset() {
gameObject = null;
storeResult = null;
everyFrame = false;
}
public override void OnEnter() {
DoAction();
if ( !everyFrame ) {
Finish();
}
}
public override void OnUpdate() {
DoAction();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
storeResult.Value = isoRigidbody.mass;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: daefced600ce84c6a955e1697b458114
timeCreated: 1450621053
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,40 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools")]
[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))]
[HutongGames.PlayMaker.Title("IsoObject (In)")]
public FsmOwnerDefault gameObject;
[RequiredField]
[ObjectType(typeof(IsoObject.Mode))]
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Mode (Out)")]
public FsmEnum storeMode;
public override void Reset() {
gameObject = null;
storeMode = null;
}
public override void OnEnter() {
DoAction();
Finish();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
storeMode.Value = isoObject.mode;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: ee5d31a178d81452ea41e5945bdec367
timeCreated: 1450021857
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,80 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools")]
[HutongGames.PlayMaker.Tooltip(
"Gets a mouse isometric position.")]
public class IsoGetMouseIsoPosition : IsoComponentAction<IsoWorld> {
[RequiredField]
[CheckForComponent(typeof(IsoWorld))]
[HutongGames.PlayMaker.Title("IsoWorld (In)")]
public FsmOwnerDefault gameObject;
[CheckForComponent(typeof(Camera))]
[HutongGames.PlayMaker.Title("Camera (In)")]
[HutongGames.PlayMaker.Tooltip("Specific camera or main camera for 'None'.")]
public FsmGameObject camera;
[HutongGames.PlayMaker.Title("Specific Isometric Z (In)")]
[HutongGames.PlayMaker.Tooltip("Specific Isometric Z or 0.0f for 'None'")]
public FsmFloat specificIsometricZ;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Position (Out)")]
public FsmVector3 storeVector;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Position X (Out)")]
public FsmFloat storeX;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Position Y (Out)")]
public FsmFloat storeY;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Position Z (Out)")]
public FsmFloat storeZ;
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
public bool everyFrame;
public override void Reset() {
gameObject = null;
camera = null;
specificIsometricZ = null;
storeVector = null;
storeX = null;
storeY = null;
storeZ = null;
everyFrame = false;
}
public override void OnEnter() {
DoAction();
if ( !everyFrame ) {
Finish();
}
}
public override void OnUpdate() {
DoAction();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
var value = isoWorld.MouseIsoPosition(
camera.IsNone ? Camera.main : camera.Value.GetComponent<Camera>(),
specificIsometricZ.IsNone ? 0.0f : specificIsometricZ.Value);
storeVector.Value = value;
storeX.Value = value.x;
storeY.Value = value.y;
storeZ.Value = value.z;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 2dffeb7d382404baa9daf01f1da629a1
timeCreated: 1450288005
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,80 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools")]
[HutongGames.PlayMaker.Tooltip(
"Gets a mouse isometric tile position.")]
public class IsoGetMouseIsoTilePosition : IsoComponentAction<IsoWorld> {
[RequiredField]
[CheckForComponent(typeof(IsoWorld))]
[HutongGames.PlayMaker.Title("IsoWorld (In)")]
public FsmOwnerDefault gameObject;
[CheckForComponent(typeof(Camera))]
[HutongGames.PlayMaker.Title("Camera (In)")]
[HutongGames.PlayMaker.Tooltip("Specific camera or main camera for 'None'.")]
public FsmGameObject camera;
[HutongGames.PlayMaker.Title("Specific Isometric Z (In)")]
[HutongGames.PlayMaker.Tooltip("Specific Isometric Z or 0.0f for 'None'")]
public FsmFloat specificIsometricZ;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Tile Position (Out)")]
public FsmVector3 storeVector;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Tile Position X (Out)")]
public FsmFloat storeX;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Tile Position Y (Out)")]
public FsmFloat storeY;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Tile Position Z (Out)")]
public FsmFloat storeZ;
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
public bool everyFrame;
public override void Reset() {
gameObject = null;
camera = null;
specificIsometricZ = null;
storeVector = null;
storeX = null;
storeY = null;
storeZ = null;
everyFrame = false;
}
public override void OnEnter() {
DoAction();
if ( !everyFrame ) {
Finish();
}
}
public override void OnUpdate() {
DoAction();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
var value = isoWorld.MouseIsoTilePosition(
camera.IsNone ? Camera.main : camera.Value.GetComponent<Camera>(),
specificIsometricZ.IsNone ? 0.0f : specificIsometricZ.Value);
storeVector.Value = value;
storeX.Value = value.x;
storeY.Value = value.y;
storeZ.Value = value.z;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 52e132a4a0d844bbd84f8b1fbd61aa12
timeCreated: 1450288016
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,68 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
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")]
public class IsoGetPosition : IsoComponentAction<IsoObject> {
[RequiredField]
[CheckForComponent(typeof(IsoObject))]
[HutongGames.PlayMaker.Title("IsoObject (In)")]
public FsmOwnerDefault gameObject;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Position Vector (Out)")]
public FsmVector3 storeVector;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Position X (Out)")]
public FsmFloat storeX;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Position Y (Out)")]
public FsmFloat storeY;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Position Z (Out)")]
public FsmFloat storeZ;
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
public bool everyFrame;
public override void Reset() {
gameObject = null;
storeVector = null;
storeX = null;
storeY = null;
storeZ = null;
everyFrame = false;
}
public override void OnEnter() {
DoAction();
if ( !everyFrame ) {
Finish();
}
}
public override void OnUpdate() {
DoAction();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
var value = isoObject.position;
storeVector.Value = value;
storeX.Value = value.x;
storeY.Value = value.y;
storeZ.Value = value.z;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: c611ab0e954f04d81bb71728da293513
timeCreated: 1450001517
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,68 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
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")]
public class IsoGetSize : IsoComponentAction<IsoObject> {
[RequiredField]
[CheckForComponent(typeof(IsoObject))]
[HutongGames.PlayMaker.Title("IsoObject (In)")]
public FsmOwnerDefault gameObject;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Size Vector (Out)")]
public FsmVector3 storeVector;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Size X (Out)")]
public FsmFloat storeX;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Size Y (Out)")]
public FsmFloat storeY;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Size Z (Out)")]
public FsmFloat storeZ;
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
public bool everyFrame;
public override void Reset() {
gameObject = null;
storeVector = null;
storeX = null;
storeY = null;
storeZ = null;
everyFrame = false;
}
public override void OnEnter() {
DoAction();
if ( !everyFrame ) {
Finish();
}
}
public override void OnUpdate() {
DoAction();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
var value = isoObject.size;
storeVector.Value = value;
storeX.Value = value.x;
storeY.Value = value.y;
storeZ.Value = value.z;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 786db15115e7f4363b18ae4aadcf2e3b
timeCreated: 1450014652
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,46 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools.Physics")]
[HutongGames.PlayMaker.Tooltip(
"Gets the Speed of a IsoRigidbody and stores it in a Float Variable.")]
public class IsoGetSpeed : IsoComponentAction<IsoRigidbody> {
[RequiredField]
[CheckForComponent(typeof(IsoRigidbody))]
public FsmOwnerDefault gameObject;
[RequiredField]
[UIHint(UIHint.Variable)]
public FsmFloat storeResult;
public bool everyFrame;
public override void Reset() {
gameObject = null;
storeResult = null;
everyFrame = false;
}
public override void OnEnter() {
DoAction();
if ( !everyFrame ) {
Finish();
}
}
public override void OnUpdate() {
DoAction();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
storeResult.Value = isoRigidbody.velocity.magnitude;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 47bdbba00b58348cd9376287604f29ce
timeCreated: 1450620446
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,68 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools")]
[HutongGames.PlayMaker.Tooltip(
"Gets the TilePosition of a IsoObject and stores it " +
"in a Vector3 Variable or each Axis in a Float Variable")]
public class IsoGetTilePosition : IsoComponentAction<IsoObject> {
[RequiredField]
[CheckForComponent(typeof(IsoObject))]
[HutongGames.PlayMaker.Title("IsoObject (In)")]
public FsmOwnerDefault gameObject;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Tile Position Vector (Out)")]
public FsmVector3 storeVector;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Tile Position X (Out)")]
public FsmFloat storeX;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Tile Position Y (Out)")]
public FsmFloat storeY;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Tile Position Z (Out)")]
public FsmFloat storeZ;
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
public bool everyFrame;
public override void Reset() {
gameObject = null;
storeVector = null;
storeX = null;
storeY = null;
storeZ = null;
everyFrame = false;
}
public override void OnEnter() {
DoAction();
if ( !everyFrame ) {
Finish();
}
}
public override void OnUpdate() {
DoAction();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
var value = isoObject.tilePosition;
storeVector.Value = value;
storeX.Value = value.x;
storeY.Value = value.y;
storeZ.Value = value.z;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: a4c5cff4e06894f2aae07daa307c76d9
timeCreated: 1450207773
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,86 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools")]
[HutongGames.PlayMaker.Tooltip(
"Gets a touch isometric position.")]
public class IsoGetTouchIsoPosition : IsoComponentAction<IsoWorld> {
[RequiredField]
[CheckForComponent(typeof(IsoWorld))]
[HutongGames.PlayMaker.Title("IsoWorld (In)")]
public FsmOwnerDefault gameObject;
[RequiredField]
[HutongGames.PlayMaker.Title("Finger Id (In)")]
public FsmInt fingerId;
[CheckForComponent(typeof(Camera))]
[HutongGames.PlayMaker.Title("Camera (In)")]
[HutongGames.PlayMaker.Tooltip("Specific camera or main camera for 'None'.")]
public FsmGameObject camera;
[HutongGames.PlayMaker.Title("Specific Isometric Z (In)")]
[HutongGames.PlayMaker.Tooltip("Specific Isometric Z or 0.0f for 'None'")]
public FsmFloat specificIsometricZ;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Position (Out)")]
public FsmVector3 storeVector;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Position X (Out)")]
public FsmFloat storeX;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Position Y (Out)")]
public FsmFloat storeY;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Position Z (Out)")]
public FsmFloat storeZ;
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
public bool everyFrame;
public override void Reset() {
gameObject = null;
fingerId = null;
camera = null;
specificIsometricZ = null;
storeVector = null;
storeX = null;
storeY = null;
storeZ = null;
everyFrame = false;
}
public override void OnEnter() {
DoAction();
if ( !everyFrame ) {
Finish();
}
}
public override void OnUpdate() {
DoAction();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
var value = isoWorld.TouchIsoPosition(
fingerId.Value,
camera.IsNone ? Camera.main : camera.Value.GetComponent<Camera>(),
specificIsometricZ.IsNone ? 0.0f : specificIsometricZ.Value);
storeVector.Value = value;
storeX.Value = value.x;
storeY.Value = value.y;
storeZ.Value = value.z;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 88c45e14a4cd040f992be5868786242f
timeCreated: 1450196704
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,86 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools")]
[HutongGames.PlayMaker.Tooltip(
"Gets a touch isometric tile position.")]
public class IsoGetTouchIsoTilePosition : IsoComponentAction<IsoWorld> {
[RequiredField]
[CheckForComponent(typeof(IsoWorld))]
[HutongGames.PlayMaker.Title("IsoWorld (In)")]
public FsmOwnerDefault gameObject;
[RequiredField]
[HutongGames.PlayMaker.Title("Finger Id (In)")]
public FsmInt fingerId;
[CheckForComponent(typeof(Camera))]
[HutongGames.PlayMaker.Title("Camera (In)")]
[HutongGames.PlayMaker.Tooltip("Specific camera or main camera for 'None'.")]
public FsmGameObject camera;
[HutongGames.PlayMaker.Title("Specific Isometric Z (In)")]
[HutongGames.PlayMaker.Tooltip("Specific Isometric Z or 0.0f for 'None'")]
public FsmFloat specificIsometricZ;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Tile Position (Out)")]
public FsmVector3 storeVector;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Tile Position X (Out)")]
public FsmFloat storeX;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Tile Position Y (Out)")]
public FsmFloat storeY;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Tile Position Z (Out)")]
public FsmFloat storeZ;
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
public bool everyFrame;
public override void Reset() {
gameObject = null;
fingerId = null;
camera = null;
specificIsometricZ = null;
storeVector = null;
storeX = null;
storeY = null;
storeZ = null;
everyFrame = false;
}
public override void OnEnter() {
DoAction();
if ( !everyFrame ) {
Finish();
}
}
public override void OnUpdate() {
DoAction();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
var value = isoWorld.TouchIsoTilePosition(
fingerId.Value,
camera.IsNone ? Camera.main : camera.Value.GetComponent<Camera>(),
specificIsometricZ.IsNone ? 0.0f : specificIsometricZ.Value);
storeVector.Value = value;
storeX.Value = value.x;
storeY.Value = value.y;
storeZ.Value = value.z;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 91eb63755433a4241b6cdf806e27a493
timeCreated: 1450196722
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,62 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools.Physics")]
[HutongGames.PlayMaker.Tooltip(
"Gets the Velocity of a IsoRigidbody and stores it " +
"in a Vector3 Variable or each Axis in a Float Variable")]
public class IsoGetVelocity : IsoComponentAction<IsoRigidbody> {
[RequiredField]
[CheckForComponent(typeof(IsoRigidbody))]
public FsmOwnerDefault gameObject;
[UIHint(UIHint.Variable)]
public FsmVector3 storeVector;
[UIHint(UIHint.Variable)]
public FsmFloat storeX;
[UIHint(UIHint.Variable)]
public FsmFloat storeY;
[UIHint(UIHint.Variable)]
public FsmFloat storeZ;
public bool everyFrame;
public override void Reset() {
gameObject = null;
storeVector = null;
storeX = null;
storeY = null;
storeZ = null;
everyFrame = false;
}
public override void OnEnter() {
DoAction();
if ( !everyFrame ) {
Finish();
}
}
public override void OnUpdate() {
DoAction();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
var value = isoRigidbody.velocity;
storeVector.Value = value;
storeX.Value = value.x;
storeY.Value = value.y;
storeZ.Value = value.z;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: ea8962e92212e431ba4e354fbb0ff3e3
timeCreated: 1450619756
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,78 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools")]
[HutongGames.PlayMaker.Tooltip(
"Gets an options of a IsoWorld.")]
public class IsoGetWorldProps : IsoComponentAction<IsoWorld> {
[RequiredField]
[CheckForComponent(typeof(IsoWorld))]
[HutongGames.PlayMaker.Title("IsoWorld (In)")]
public FsmOwnerDefault gameObject;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Tile Size (Out)")]
public FsmFloat tileSize;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Tile Ratio (Out)")]
public FsmFloat tileRatio;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Tile Angle (Out)")]
public FsmFloat tileAngle;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Tile Height (Out)")]
public FsmFloat tileHeight;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Step Depth (Out)")]
public FsmFloat stepDepth;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Start Depth (Out)")]
public FsmFloat startDepth;
[HutongGames.PlayMaker.Tooltip("Repeat every frame.")]
public bool everyFrame;
public override void Reset() {
gameObject = null;
tileSize = null;
tileRatio = null;
tileAngle = null;
tileHeight = null;
stepDepth = null;
startDepth = null;
everyFrame = false;
}
public override void OnEnter() {
DoAction();
if ( !everyFrame ) {
Finish();
}
}
public override void OnUpdate() {
DoAction();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
tileSize.Value = isoWorld.tileSize;
tileRatio.Value = isoWorld.tileRatio;
tileAngle.Value = isoWorld.tileAngle;
tileHeight.Value = isoWorld.tileHeight;
stepDepth.Value = isoWorld.stepDepth;
startDepth.Value = isoWorld.startDepth;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 571909e63f3954244b08fd7338e68605
timeCreated: 1450110259
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,52 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools.Physics")]
[HutongGames.PlayMaker.Tooltip(
"Tests if a IsoRigidbody is kinematic.")]
public class IsoIsKinematic : IsoComponentAction<IsoRigidbody> {
[RequiredField]
[CheckForComponent(typeof(IsoRigidbody))]
public FsmOwnerDefault gameObject;
public FsmEvent trueEvent;
public FsmEvent falseEvent;
[UIHint(UIHint.Variable)]
public FsmBool storeResult;
public bool everyFrame;
public override void Reset() {
gameObject = null;
trueEvent = null;
falseEvent = null;
storeResult = null;
everyFrame = false;
}
public override void OnEnter() {
DoAction();
if ( !everyFrame ) {
Finish();
}
}
public override void OnUpdate() {
DoAction();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
var value = isoRigidbody.isKinematic;
storeResult.Value = value;
Fsm.Event(value ? trueEvent : falseEvent);
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 98f632c63797046b1a8f1898d00bc756
timeCreated: 1450621255
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,52 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools.Physics")]
[HutongGames.PlayMaker.Tooltip(
"Tests if a IsoRigidbody is sleeping.")]
public class IsoIsSleeping : IsoComponentAction<IsoRigidbody> {
[RequiredField]
[CheckForComponent(typeof(IsoRigidbody))]
public FsmOwnerDefault gameObject;
public FsmEvent trueEvent;
public FsmEvent falseEvent;
[UIHint(UIHint.Variable)]
public FsmBool storeResult;
public bool everyFrame;
public override void Reset() {
gameObject = null;
trueEvent = null;
falseEvent = null;
storeResult = null;
everyFrame = false;
}
public override void OnEnter() {
DoAction();
if ( !everyFrame ) {
Finish();
}
}
public override void OnUpdate() {
DoAction();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
var value = isoRigidbody.IsSleeping();
storeResult.Value = value;
Fsm.Event(value ? trueEvent : falseEvent);
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 57163cba226bd4f199a950f56d1f2a5c
timeCreated: 1450621269
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,52 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools.Physics")]
[HutongGames.PlayMaker.Tooltip(
"Tests if a IsoRigidbody use gravity.")]
public class IsoIsUseGravity : IsoComponentAction<IsoRigidbody> {
[RequiredField]
[CheckForComponent(typeof(IsoRigidbody))]
public FsmOwnerDefault gameObject;
public FsmEvent trueEvent;
public FsmEvent falseEvent;
[UIHint(UIHint.Variable)]
public FsmBool storeResult;
public bool everyFrame;
public override void Reset() {
gameObject = null;
trueEvent = null;
falseEvent = null;
storeResult = null;
everyFrame = false;
}
public override void OnEnter() {
DoAction();
if ( !everyFrame ) {
Finish();
}
}
public override void OnUpdate() {
DoAction();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
var value = isoRigidbody.useGravity;
storeResult.Value = value;
Fsm.Event(value ? trueEvent : falseEvent);
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: bc13998ebfe99487a9e042a27adb3d18
timeCreated: 1450621205
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,107 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
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'.")]
public class IsoResize : IsoComponentAction<IsoObject> {
[RequiredField]
[CheckForComponent(typeof(IsoObject))]
[HutongGames.PlayMaker.Title("IsoObject (In)")]
[HutongGames.PlayMaker.Tooltip("The IsoObject to resize.")]
public FsmOwnerDefault gameObject;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Vector (In)")]
[HutongGames.PlayMaker.Tooltip(
"Use a stored resize Vector3, " +
"and/or set individual axis below.")]
public FsmVector3 vector;
[HutongGames.PlayMaker.Title("X (In)")]
public FsmFloat x;
[HutongGames.PlayMaker.Title("Y (In)")]
public FsmFloat y;
[HutongGames.PlayMaker.Title("Z (In)")]
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() {
gameObject = null;
vector = null;
x = new FsmFloat{UseVariable = true};
y = new FsmFloat{UseVariable = true};
z = new FsmFloat{UseVariable = true};
perSecond = true;
everyFrame = true;
lateUpdate = false;
fixedUpdate = false;
}
public override void OnPreprocess() {
Fsm.HandleFixedUpdate = true;
}
public override void OnEnter() {
if ( !everyFrame && !lateUpdate && !fixedUpdate ) {
DoAction();
Finish();
}
}
public override void OnUpdate() {
if ( !lateUpdate && !fixedUpdate ) {
DoAction();
}
}
public override void OnLateUpdate() {
if ( lateUpdate ) {
DoAction();
}
if ( !everyFrame ) {
Finish();
}
}
public override void OnFixedUpdate() {
if ( fixedUpdate ) {
DoAction();
}
if ( !everyFrame ) {
Finish();
}
}
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; }
isoObject.size +=
perSecond ? value * Time.deltaTime : value;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 0cc9c814428694df6a2a04949e881f7b
timeCreated: 1450019890
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,45 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools.Physics")]
[HutongGames.PlayMaker.Tooltip(
"Sets the Drag of a IsoRigidbody.")]
public class IsoSetDrag : IsoComponentAction<IsoRigidbody> {
[RequiredField]
[CheckForComponent(typeof(IsoRigidbody))]
public FsmOwnerDefault gameObject;
[RequiredField]
public FsmFloat drag;
public bool everyFrame;
public override void Reset() {
gameObject = null;
drag = 1.0f;
everyFrame = false;
}
public override void OnEnter() {
DoAction();
if ( !everyFrame ) {
Finish();
}
}
public override void OnUpdate() {
DoAction();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
isoRigidbody.drag = drag.Value;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 7f83d153bf736469ca580e60ea2ca79c
timeCreated: 1450621092
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,36 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools.Physics")]
[HutongGames.PlayMaker.Tooltip(
"Sets the IsKinematic of a IsoRigidbody.")]
public class IsoSetIsKinematic : IsoComponentAction<IsoRigidbody> {
[RequiredField]
[CheckForComponent(typeof(IsoRigidbody))]
public FsmOwnerDefault gameObject;
[RequiredField]
public FsmBool isKinematic;
public override void Reset() {
gameObject = null;
isKinematic = true;
}
public override void OnEnter() {
DoAction();
Finish();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
isoRigidbody.isKinematic = isKinematic.Value;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: fd8b09a582b9846e79c50485090f3fe3
timeCreated: 1450622310
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,45 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools.Physics")]
[HutongGames.PlayMaker.Tooltip(
"Sets the Mass of a IsoRigidbody.")]
public class IsoSetMass : IsoComponentAction<IsoRigidbody> {
[RequiredField]
[CheckForComponent(typeof(IsoRigidbody))]
public FsmOwnerDefault gameObject;
[RequiredField]
public FsmFloat mass;
public bool everyFrame;
public override void Reset() {
gameObject = null;
mass = 1.0f;
everyFrame = false;
}
public override void OnEnter() {
DoAction();
if ( !everyFrame ) {
Finish();
}
}
public override void OnUpdate() {
DoAction();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
isoRigidbody.mass = mass.Value;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: cabad94a5a31c4d3ba9c52a4929937a4
timeCreated: 1450621064
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,39 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools")]
[HutongGames.PlayMaker.Tooltip(
"Sets the Mode of a IsoObject.")]
public class IsoSetMode : IsoComponentAction<IsoObject> {
[RequiredField]
[CheckForComponent(typeof(IsoObject))]
[HutongGames.PlayMaker.Title("IsoObject (In)")]
public FsmOwnerDefault gameObject;
[RequiredField]
[ObjectType(typeof(IsoObject.Mode))]
[HutongGames.PlayMaker.Title("Mode (In)")]
public FsmEnum mode;
public override void Reset() {
gameObject = null;
mode = IsoObject.Mode.Mode2d;
}
public override void OnEnter() {
DoAction();
Finish();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
isoObject.mode = (IsoObject.Mode)mode.Value;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 600989817e43d430a96dfdbbba8dde76
timeCreated: 1450019570
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,94 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools")]
[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() {
gameObject = null;
vector = null;
x = new FsmFloat{UseVariable = true};
y = new FsmFloat{UseVariable = true};
z = new FsmFloat{UseVariable = true};
everyFrame = false;
lateUpdate = false;
fixedUpdate = false;
}
public override void OnPreprocess() {
Fsm.HandleFixedUpdate = true;
}
public override void OnEnter() {
if ( !everyFrame && !lateUpdate && !fixedUpdate ) {
DoAction();
Finish();
}
}
public override void OnUpdate() {
if ( !lateUpdate && !fixedUpdate ) {
DoAction();
}
}
public override void OnLateUpdate() {
if ( lateUpdate ) {
DoAction();
}
if ( !everyFrame ) {
Finish();
}
}
public override void OnFixedUpdate() {
if ( fixedUpdate ) {
DoAction();
}
if ( !everyFrame ) {
Finish();
}
}
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; }
isoObject.position = value;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: f97bd76983db64be3adc438575153e6e
timeCreated: 1450001531
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,94 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools")]
[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() {
gameObject = null;
vector = null;
x = new FsmFloat{UseVariable = true};
y = new FsmFloat{UseVariable = true};
z = new FsmFloat{UseVariable = true};
everyFrame = false;
lateUpdate = false;
fixedUpdate = false;
}
public override void OnPreprocess() {
Fsm.HandleFixedUpdate = true;
}
public override void OnEnter() {
if ( !everyFrame && !lateUpdate && !fixedUpdate ) {
DoAction();
Finish();
}
}
public override void OnUpdate() {
if ( !lateUpdate && !fixedUpdate ) {
DoAction();
}
}
public override void OnLateUpdate() {
if ( lateUpdate ) {
DoAction();
}
if ( !everyFrame ) {
Finish();
}
}
public override void OnFixedUpdate() {
if ( fixedUpdate ) {
DoAction();
}
if ( !everyFrame ) {
Finish();
}
}
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; }
isoObject.size = value;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 9692e258041de4188a3b9b796750b7a0
timeCreated: 1450014664
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,36 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools.Physics")]
[HutongGames.PlayMaker.Tooltip(
"Sets the UseGravity of a IsoRigidbody.")]
public class IsoSetUseGravity : IsoComponentAction<IsoRigidbody> {
[RequiredField]
[CheckForComponent(typeof(IsoRigidbody))]
public FsmOwnerDefault gameObject;
[RequiredField]
public FsmBool useGravity;
public override void Reset() {
gameObject = null;
useGravity = true;
}
public override void OnEnter() {
DoAction();
Finish();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
isoRigidbody.useGravity = useGravity.Value;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: ad8fb89aabd864275b73abb7a6b47165
timeCreated: 1450623490
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,61 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools.Physics")]
[HutongGames.PlayMaker.Tooltip(
"Sets the Velocity of a IsoRigidbody. " +
"To leave any axis unchanged, set variable to 'None'.")]
public class IsoSetVelocity : IsoComponentAction<IsoRigidbody> {
[RequiredField]
[CheckForComponent(typeof(IsoRigidbody))]
public FsmOwnerDefault gameObject;
[UIHint(UIHint.Variable)]
public FsmVector3 vector;
public FsmFloat x;
public FsmFloat y;
public FsmFloat z;
public bool everyFrame;
public override void Reset() {
gameObject = null;
vector = null;
x = new FsmFloat{UseVariable = true};
y = new FsmFloat{UseVariable = true};
z = new FsmFloat{UseVariable = true};
everyFrame = false;
}
public override void OnPreprocess() {
Fsm.HandleFixedUpdate = true;
}
public override void OnEnter() {
DoAction();
if ( !everyFrame ) {
Finish();
}
}
public override void OnFixedUpdate() {
DoAction();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
var value = vector.IsNone ? isoRigidbody.velocity : vector.Value;
if ( !x.IsNone ) { value.x = x.Value; }
if ( !y.IsNone ) { value.y = y.Value; }
if ( !z.IsNone ) { value.z = z.Value; }
isoRigidbody.velocity = value;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: f5bf16fe3bbaa46a3a57303544d7f670
timeCreated: 1450619746
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,84 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools")]
[HutongGames.PlayMaker.Tooltip(
"Sets an options of a IsoWorld.")]
public class IsoSetWorldProps : IsoComponentAction<IsoWorld> {
[RequiredField]
[CheckForComponent(typeof(IsoWorld))]
[HutongGames.PlayMaker.Title("IsoWorld (In)")]
public FsmOwnerDefault gameObject;
[HutongGames.PlayMaker.Title("Tile Size (In)")]
public FsmFloat tileSize;
[HutongGames.PlayMaker.Title("Tile Ratio (In)")]
public FsmFloat tileRatio;
[HutongGames.PlayMaker.Title("Tile Angle (In)")]
public FsmFloat tileAngle;
[HutongGames.PlayMaker.Title("Tile Height (In)")]
public FsmFloat tileHeight;
[HutongGames.PlayMaker.Title("Step Depth (In)")]
public FsmFloat stepDepth;
[HutongGames.PlayMaker.Title("Start Depth (In)")]
public FsmFloat startDepth;
public override void Reset() {
gameObject = null;
tileSize = new FsmFloat{UseVariable = true};
tileRatio = new FsmFloat{UseVariable = true};
tileAngle = new FsmFloat{UseVariable = true};
tileHeight = new FsmFloat{UseVariable = true};
stepDepth = new FsmFloat{UseVariable = true};
startDepth = new FsmFloat{UseVariable = true};
}
public override string ErrorCheck() {
if ( !tileSize.IsNone && IsErrorVarClamp(tileSize.Value, IsoWorld.MinTileSize, IsoWorld.MaxTileSize) ) {
return ErrorVarClampMsg("TileSize", IsoWorld.MinTileSize, IsoWorld.MaxTileSize);
}
if ( !tileRatio.IsNone && IsErrorVarClamp(tileRatio.Value, IsoWorld.MinTileRatio, IsoWorld.MaxTileRatio) ) {
return ErrorVarClampMsg("TileRatio", IsoWorld.MinTileRatio, IsoWorld.MaxTileRatio);
}
if ( !tileAngle.IsNone && IsErrorVarClamp(tileAngle.Value, IsoWorld.MinTileAngle, IsoWorld.MaxTileAngle)) {
return ErrorVarClampMsg("TileAngle", IsoWorld.MinTileAngle, IsoWorld.MaxTileAngle);
}
if ( !tileHeight.IsNone && IsErrorVarClamp(tileHeight.Value, IsoWorld.MinTileHeight, IsoWorld.MaxTileHeight) ) {
return ErrorVarClampMsg("TileHeight", IsoWorld.MinTileHeight, IsoWorld.MaxTileHeight);
}
if ( !stepDepth.IsNone && IsErrorVarClamp(stepDepth.Value, IsoWorld.MinStepDepth, IsoWorld.MaxStepDepth) ) {
return ErrorVarClampMsg("StepDepth", IsoWorld.MinStepDepth, IsoWorld.MaxStepDepth);
}
if ( !startDepth.IsNone && IsErrorVarClamp(startDepth.Value, IsoWorld.MinStartDepth, IsoWorld.MaxStartDepth) ) {
return ErrorVarClampMsg("StartDepth", IsoWorld.MinStartDepth, IsoWorld.MaxStartDepth);
}
return "";
}
public override void OnEnter() {
DoAction();
Finish();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
if ( !tileSize .IsNone ) { isoWorld.tileSize = tileSize .Value; }
if ( !tileRatio .IsNone ) { isoWorld.tileRatio = tileRatio .Value; }
if ( !tileAngle .IsNone ) { isoWorld.tileAngle = tileAngle .Value; }
if ( !tileHeight.IsNone ) { isoWorld.tileHeight = tileHeight.Value; }
if ( !stepDepth .IsNone ) { isoWorld.stepDepth = stepDepth .Value; }
if ( !startDepth.IsNone ) { isoWorld.startDepth = startDepth.Value; }
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 989d7fb6aa6b440f185314c637d25bd5
timeCreated: 1450036398
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,32 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools.Physics")]
[HutongGames.PlayMaker.Tooltip(
"Force a IsoRigidbody to Sleep.")]
public class IsoSleep : IsoComponentAction<IsoRigidbody> {
[RequiredField]
[CheckForComponent(typeof(IsoRigidbody))]
public FsmOwnerDefault gameObject;
public override void Reset() {
gameObject = null;
}
public override void OnEnter() {
DoAction();
Finish();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
isoRigidbody.Sleep();
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 42caab2ac33764ad3ade186dfccd29f1
timeCreated: 1450621114
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,107 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
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'.")]
public class IsoTranslate : IsoComponentAction<IsoObject> {
[RequiredField]
[CheckForComponent(typeof(IsoObject))]
[HutongGames.PlayMaker.Title("IsoObject (In)")]
[HutongGames.PlayMaker.Tooltip("The IsoObject to translate.")]
public FsmOwnerDefault gameObject;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Vector (In)")]
[HutongGames.PlayMaker.Tooltip(
"Use a stored translation Vector3, " +
"and/or set individual axis below.")]
public FsmVector3 vector;
[HutongGames.PlayMaker.Title("X (In)")]
public FsmFloat x;
[HutongGames.PlayMaker.Title("Y (In)")]
public FsmFloat y;
[HutongGames.PlayMaker.Title("Z (In)")]
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() {
gameObject = null;
vector = null;
x = new FsmFloat{UseVariable = true};
y = new FsmFloat{UseVariable = true};
z = new FsmFloat{UseVariable = true};
perSecond = true;
everyFrame = true;
lateUpdate = false;
fixedUpdate = false;
}
public override void OnPreprocess() {
Fsm.HandleFixedUpdate = true;
}
public override void OnEnter() {
if ( !everyFrame && !lateUpdate && !fixedUpdate ) {
DoAction();
Finish();
}
}
public override void OnUpdate() {
if ( !lateUpdate && !fixedUpdate ) {
DoAction();
}
}
public override void OnLateUpdate() {
if ( lateUpdate ) {
DoAction();
}
if ( !everyFrame ) {
Finish();
}
}
public override void OnFixedUpdate() {
if ( fixedUpdate ) {
DoAction();
}
if ( !everyFrame ) {
Finish();
}
}
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; }
isoObject.position +=
perSecond ? value * Time.deltaTime : value;
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 8c3a921d0e1aa47508856f6a97dc99f8
timeCreated: 1449997832
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,32 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Actions {
[ActionCategory("IsoTools.Physics")]
[HutongGames.PlayMaker.Tooltip(
"Force a IsoRigidbody to WakeUp.")]
public class IsoWakeUp : IsoComponentAction<IsoRigidbody> {
[RequiredField]
[CheckForComponent(typeof(IsoRigidbody))]
public FsmOwnerDefault gameObject;
public override void Reset() {
gameObject = null;
}
public override void OnEnter() {
DoAction();
Finish();
}
void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
isoRigidbody.WakeUp();
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: b4872fa9b5ff346f88f45459d0c257e0
timeCreated: 1450621127
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: a4729de6bf87e4d60a76f269eb903bc6
folderAsset: yes
timeCreated: 1450606069
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,93 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Events {
public enum IsoCollisionType {
IsoCollisionEnter,
IsoCollisionExit
}
[ActionCategory("IsoTools.Physics")]
[HutongGames.PlayMaker.Tooltip(
"Detect physics collision events.")]
public class IsoCollisionEvent : IsoComponentAction<IsoObject> {
[RequiredField]
[CheckForComponent(typeof(IsoObject))]
[HutongGames.PlayMaker.Title("IsoObject (In)")]
public FsmOwnerDefault gameObject;
[RequiredField]
[HutongGames.PlayMaker.Title("Collision Type (In)")]
public IsoCollisionType collisionType;
[RequiredField]
[UIHint(UIHint.Tag)]
[HutongGames.PlayMaker.Title("Collide Tag (In)")]
public FsmString collideTag;
[HutongGames.PlayMaker.Title("Send Event (In)")]
public FsmEvent sendEvent;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Iso Collider (Out)")]
public FsmGameObject storeIsoCollider;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Force (Out)")]
public FsmFloat storeForce;
IsoFSMEvents isoFSMEvents = null;
public override void Reset() {
gameObject = null;
collisionType = IsoCollisionType.IsoCollisionEnter;
collideTag = "Untagged";
sendEvent = null;
storeIsoCollider = null;
storeForce = null;
}
public override void OnEnter() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( go ) {
isoFSMEvents = go.AddComponent<IsoFSMEvents>();
isoFSMEvents.Init(this);
}
}
public override void OnExit() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( go ) {
if ( isoFSMEvents ) {
GameObject.Destroy(isoFSMEvents);
isoFSMEvents = null;
}
}
}
public override void DoIsoCollisionEnter(IsoCollision collision) {
if ( collisionType == IsoCollisionType.IsoCollisionEnter ) {
DoAction(collision);
}
}
public override void DoIsoCollisionExit(IsoCollision collision) {
if ( collisionType == IsoCollisionType.IsoCollisionExit ) {
DoAction(collision);
}
}
void DoAction(IsoCollision collision) {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
if ( collision.collider.gameObject.tag == collideTag.Value ) {
storeIsoCollider.Value = collision.collider.gameObject;
storeForce.Value = collision.relativeVelocity.magnitude;
Fsm.Event(sendEvent);
}
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 7174ef4b510b84720b2155b405a8bd7d
timeCreated: 1450293230
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,87 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
using IsoTools.PlayMaker.Internal;
namespace IsoTools.PlayMaker.Events {
public enum IsoTriggerType {
IsoTriggerEnter,
IsoTriggerExit
}
[ActionCategory("IsoTools.Physics")]
[HutongGames.PlayMaker.Tooltip(
"Detect physics trigger events.")]
public class IsoTriggerEvent : IsoComponentAction<IsoObject> {
[RequiredField]
[CheckForComponent(typeof(IsoObject))]
[HutongGames.PlayMaker.Title("IsoObject (In)")]
public FsmOwnerDefault gameObject;
[RequiredField]
[HutongGames.PlayMaker.Title("Trigger Type (In)")]
public IsoTriggerType triggerType;
[RequiredField]
[UIHint(UIHint.Tag)]
[HutongGames.PlayMaker.Title("Collide Tag (In)")]
public FsmString collideTag;
[HutongGames.PlayMaker.Title("Send Event (In)")]
public FsmEvent sendEvent;
[UIHint(UIHint.Variable)]
[HutongGames.PlayMaker.Title("Store Iso Collider (Out)")]
public FsmGameObject storeIsoCollider;
IsoFSMEvents isoFSMEvents = null;
public override void Reset() {
gameObject = null;
triggerType = IsoTriggerType.IsoTriggerEnter;
collideTag = "Untagged";
sendEvent = null;
storeIsoCollider = null;
}
public override void OnEnter() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( go ) {
isoFSMEvents = go.AddComponent<IsoFSMEvents>();
isoFSMEvents.Init(this);
}
}
public override void OnExit() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( go ) {
if ( isoFSMEvents ) {
GameObject.Destroy(isoFSMEvents);
isoFSMEvents = null;
}
}
}
public override void DoIsoTriggerEnter(IsoCollider collider) {
if ( triggerType == IsoTriggerType.IsoTriggerEnter ) {
DoAction(collider);
}
}
public override void DoIsoTriggerExit(IsoCollider collider) {
if ( triggerType == IsoTriggerType.IsoTriggerExit ) {
DoAction(collider);
}
}
void DoAction(IsoCollider collider) {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
if ( collider.gameObject.tag == collideTag.Value ) {
storeIsoCollider.Value = collider.gameObject;
Fsm.Event(sendEvent);
}
}
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 626aa5f53a36f4d7c8c392e4cb7e0beb
timeCreated: 1450293242
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 97ae31775318b4db8ae3e82a85135302
folderAsset: yes
timeCreated: 1450605779
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,67 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
namespace IsoTools.PlayMaker.Internal {
public abstract class IsoComponentAction<T> : FsmStateAction where T : Component {
T _cachedComponent;
GameObject _cachedGameObject;
public virtual void DoIsoTriggerEnter(IsoCollider collider) {}
public virtual void DoIsoTriggerExit (IsoCollider collider) {}
public virtual void DoIsoCollisionEnter(IsoCollision collision) {}
public virtual void DoIsoCollisionExit (IsoCollision collision) {}
protected IsoWorld isoWorld {
get { return _cachedComponent as IsoWorld; }
}
protected IsoObject isoObject {
get { return _cachedComponent as IsoObject; }
}
protected IsoRigidbody isoRigidbody {
get { return _cachedComponent as IsoRigidbody; }
}
protected IsoCollider isoCollider {
get { return _cachedComponent as IsoCollider; }
}
protected IsoBoxCollider isoBoxCollider {
get { return _cachedComponent as IsoBoxCollider; }
}
protected IsoSphereCollider isoSphereCollider {
get { return _cachedComponent as IsoSphereCollider; }
}
protected bool UpdateCache(GameObject go) {
if ( go ) {
if ( _cachedComponent == null || _cachedGameObject != go ) {
_cachedComponent = go.GetComponent<T>();
_cachedGameObject = go;
if ( !_cachedComponent ) {
LogWarning("Missing component: " + typeof(T).FullName + " on: " + go.name);
}
}
} else {
_cachedComponent = null;
_cachedGameObject = null;
}
return _cachedComponent != null;
}
protected bool IsErrorVarClamp(float v, float min, float max) {
return v < min || v > max;
}
protected string ErrorVarClampMsg(string name, float min, float max) {
return string.Format(
"{0} must be greater than {1} and less than {2}",
name, min, max);
}
}
} // IsoTools.PlayMaker.Actions
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 063a1435f504a41b691d2cecde558bc9
timeCreated: 1450018514
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,44 @@
#if PLAYMAKER
using UnityEngine;
using HutongGames.PlayMaker;
namespace IsoTools.PlayMaker.Internal {
public class IsoFSMEvents : MonoBehaviour {
IsoComponentAction<IsoObject> _action = null;
bool _started = false;
public void Init(IsoComponentAction<IsoObject> action) {
_action = action;
}
void Start() {
Debug.Assert(_action != null, "logic error", this);
_started = true;
}
void OnIsoTriggerEnter(IsoCollider collider) {
if ( _action != null && _started ) {
_action.DoIsoTriggerEnter(collider);
}
}
void OnIsoTriggerExit(IsoCollider collider) {
if ( _action != null && _started ) {
_action.DoIsoTriggerExit(collider);
}
}
void OnIsoCollisionEnter(IsoCollision collision) {
if ( _action != null && _started ) {
_action.DoIsoCollisionEnter(collision);
}
}
void OnIsoCollisionExit(IsoCollision collision) {
if ( _action != null && _started ) {
_action.DoIsoCollisionExit(collision);
}
}
}
}
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 31abbce806315444e9a6cf895d9f625e
timeCreated: 1450292724
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: