diff --git a/Assembly-CSharp.csproj b/Assembly-CSharp.csproj
index 531d857..f8f9203 100644
--- a/Assembly-CSharp.csproj
+++ b/Assembly-CSharp.csproj
@@ -52,6 +52,7 @@
+
diff --git a/Assets/IsoTools/Examples/Scenes/Scene07.unity b/Assets/IsoTools/Examples/Scenes/Scene07.unity
index 17188b3..afe802f 100644
--- a/Assets/IsoTools/Examples/Scenes/Scene07.unity
+++ b/Assets/IsoTools/Examples/Scenes/Scene07.unity
@@ -444,6 +444,7 @@ MonoBehaviour:
- HutongGames.PlayMaker.Actions.Wait
- IsoTools.PlayMaker.Actions.IsoGetPosition
- IsoTools.PlayMaker.Actions.IsoGetSize
+ - IsoTools.PlayMaker.Actions.IsoGetMode
- PlayMaker.ConditionalExpression.ConditionalExpression
customNames:
-
@@ -451,10 +452,11 @@ MonoBehaviour:
-
-
-
- actionEnabled: 0101010101
- actionIsOpen: 0000000000
- actionStartIndex: 00000000090000000c0000001200000018000000
- actionHashCodes: 8ef8760048c011017ebd02027ebd0202490c8701
+ -
+ actionEnabled: 010101010101
+ actionIsOpen: 000000000100
+ actionStartIndex: 00000000090000000c00000012000000180000001b000000
+ actionHashCodes: 8ef8760048c011017ebd02027ebd020236f6fc01490c8701
unityObjectParams: []
fsmGameObjectParams: []
fsmOwnerDefaultParams:
@@ -482,6 +484,14 @@ MonoBehaviour:
showInInspector: 0
networkSync: 0
value: {fileID: 0}
+ - ownerOption: 0
+ gameObject:
+ useVariable: 0
+ name:
+ tooltip:
+ showInInspector: 0
+ networkSync: 0
+ value: {fileID: 0}
animationCurveParams: []
functionCallParams: []
fsmTemplateControlParams: []
@@ -498,7 +508,14 @@ MonoBehaviour:
fsmObjectParams: []
fsmVarParams: []
fsmArrayParams: []
- fsmEnumParams: []
+ fsmEnumParams:
+ - useVariable: 1
+ name: iso_mode
+ tooltip:
+ showInInspector: 1
+ networkSync: 0
+ enumName: IsoTools.IsoObject+Mode
+ intValue: 0
fsmFloatParams:
- useVariable: 1
name:
@@ -595,12 +612,12 @@ MonoBehaviour:
- FINISHED
- TO_RESET_POSITION
-
- byteData: 000000000100000000
+ byteData: 00000000010000000000
arrayParamSizes:
arrayParamTypes: []
customTypeSizes:
customTypeNames: []
- paramDataType: 140000001c0000000f0000000f0000000f000000010000000100000001000000010000000f0000001700000001000000140000001c0000000f0000000f0000000f00000001000000140000001c0000000f0000000f0000000f00000001000000120000001700000017000000010000000100000011000000
+ paramDataType: 140000001c0000000f0000000f0000000f000000010000000100000001000000010000000f0000001700000001000000140000001c0000000f0000000f0000000f00000001000000140000001c0000000f0000000f0000000f00000001000000140000002a00000001000000120000001700000017000000010000000100000011000000
paramName:
- gameObject
- vector
@@ -626,14 +643,17 @@ MonoBehaviour:
- y
- z
- everyFrame
+ - gameObject
+ - mode
+ - everyFrame
- expression
- isTrueEvent
- isFalseEvent
- everyFrame
- rawResult
- storeResult
- paramDataPos: 000000000000000000000000010000000200000000000000010000000200000003000000030000000000000004000000010000000100000004000000050000000600000005000000020000000200000007000000080000000900000006000000000000000100000002000000070000000800000000000000
- paramByteDataSize: 000000000000000000000000000000000000000001000000010000000100000001000000000000000000000001000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000001000000000000000000000000000000010000000100000000000000
+ paramDataPos: 000000000000000000000000010000000200000000000000010000000200000003000000030000000000000004000000010000000100000004000000050000000600000005000000020000000200000007000000080000000900000006000000030000000000000007000000000000000100000002000000080000000900000000000000
+ paramByteDataSize: 000000000000000000000000000000000000000001000000010000000100000001000000000000000000000001000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000001000000000000000000000001000000000000000000000000000000010000000100000000000000
- name: State 3
description:
colorIndex: 0
@@ -659,16 +679,26 @@ MonoBehaviour:
actionNames:
- IsoTools.PlayMaker.Actions.IsoSetPosition
- HutongGames.PlayMaker.Actions.Wait
+ - IsoTools.PlayMaker.Actions.IsoSetMode
customNames:
-
-
- actionEnabled: 0101
- actionIsOpen: 0101
- actionStartIndex: 0000000007000000
- actionHashCodes: afff110548c01101
+ -
+ actionEnabled: 010101
+ actionIsOpen: 010101
+ actionStartIndex: 00000000080000000b000000
+ actionHashCodes: ac9f610448c01101672cde03
unityObjectParams: []
fsmGameObjectParams: []
fsmOwnerDefaultParams:
+ - ownerOption: 0
+ gameObject:
+ useVariable: 0
+ name:
+ tooltip:
+ showInInspector: 0
+ networkSync: 0
+ value: {fileID: 0}
- ownerOption: 0
gameObject:
useVariable: 0
@@ -687,7 +717,14 @@ MonoBehaviour:
fsmObjectParams: []
fsmVarParams: []
fsmArrayParams: []
- fsmEnumParams: []
+ fsmEnumParams:
+ - useVariable: 0
+ name:
+ tooltip:
+ showInInspector: 0
+ networkSync: 0
+ enumName: IsoTools.IsoObject+Mode
+ intValue: 1
fsmFloatParams:
- useVariable: 0
name:
@@ -728,12 +765,12 @@ MonoBehaviour:
fsmQuaternionParams: []
stringParams:
- FINISHED
- byteData: 000001
+ byteData: 00000001
arrayParamSizes:
arrayParamTypes: []
customTypeSizes:
customTypeNames: []
- paramDataType: 140000001c0000000f0000000f0000000f00000001000000010000000f0000001700000001000000
+ paramDataType: 140000001c0000000f0000000f0000000f0000000100000001000000010000000f0000001700000001000000140000002a000000
paramName:
- gameObject
- vector
@@ -742,11 +779,14 @@ MonoBehaviour:
- z
- everyFrame
- lateUpdate
+ - fixedUpdate
- time
- finishEvent
- realTime
- paramDataPos: 00000000000000000000000001000000020000000000000001000000030000000000000002000000
- paramByteDataSize: 00000000000000000000000000000000000000000100000001000000000000000000000001000000
+ - gameObject
+ - mode
+ paramDataPos: 00000000000000000000000001000000020000000000000001000000020000000300000000000000030000000100000000000000
+ paramByteDataSize: 00000000000000000000000000000000000000000100000001000000010000000000000000000000010000000000000000000000
events:
- name: FINISHED
isSystemEvent: 1
@@ -802,10 +842,17 @@ MonoBehaviour:
materialVariables: []
textureVariables: []
arrayVariables: []
- enumVariables: []
+ enumVariables:
+ - useVariable: 1
+ name: iso_mode
+ tooltip:
+ showInInspector: 1
+ networkSync: 0
+ enumName: IsoTools.IsoObject+Mode
+ intValue: 0
categories:
-
- variableCategoryIDs: 00000000000000000000000000000000
+ variableCategoryIDs: 0000000000000000000000000000000000000000
description:
docUrl:
showStateLabel: 1
diff --git a/Assets/IsoTools/PlayMaker/Actions/IsoGetMode.cs b/Assets/IsoTools/PlayMaker/Actions/IsoGetMode.cs
new file mode 100644
index 0000000..f8c3b80
--- /dev/null
+++ b/Assets/IsoTools/PlayMaker/Actions/IsoGetMode.cs
@@ -0,0 +1,43 @@
+using UnityEngine;
+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")]
+ public class IsoGetMode : IsoComponentAction {
+ [RequiredField]
+ [CheckForComponent(typeof(IsoObject))]
+ public FsmOwnerDefault gameObject;
+
+ [ObjectType(typeof(IsoObject.Mode))]
+ [UIHint(UIHint.Variable)]
+ public FsmEnum mode;
+
+ public bool everyFrame;
+
+ public override void Reset() {
+ gameObject = null;
+ mode = 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.mode;
+ mode.Value = value;
+ }
+ }
+ }
+} // IsoTools.PlayMaker.Actions
\ No newline at end of file
diff --git a/Assets/IsoTools/PlayMaker/Actions/IsoGetMode.cs.meta b/Assets/IsoTools/PlayMaker/Actions/IsoGetMode.cs.meta
new file mode 100644
index 0000000..aebabd0
--- /dev/null
+++ b/Assets/IsoTools/PlayMaker/Actions/IsoGetMode.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: ee5d31a178d81452ea41e5945bdec367
+timeCreated: 1450021857
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/IsoTools/PlayMaker/Actions/IsoGetPosition.cs b/Assets/IsoTools/PlayMaker/Actions/IsoGetPosition.cs
index ff19e8f..d2a1b43 100644
--- a/Assets/IsoTools/PlayMaker/Actions/IsoGetPosition.cs
+++ b/Assets/IsoTools/PlayMaker/Actions/IsoGetPosition.cs
@@ -33,17 +33,17 @@ namespace IsoTools.PlayMaker.Actions {
}
public override void OnEnter() {
- DoGetPosition();
+ DoAction();
if ( !everyFrame ) {
Finish();
}
}
public override void OnUpdate() {
- DoGetPosition();
+ DoAction();
}
- void DoGetPosition() {
+ void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
var value = isoObject.position;
diff --git a/Assets/IsoTools/PlayMaker/Actions/IsoGetSize.cs b/Assets/IsoTools/PlayMaker/Actions/IsoGetSize.cs
index 39de20f..995abef 100644
--- a/Assets/IsoTools/PlayMaker/Actions/IsoGetSize.cs
+++ b/Assets/IsoTools/PlayMaker/Actions/IsoGetSize.cs
@@ -33,17 +33,17 @@ namespace IsoTools.PlayMaker.Actions {
}
public override void OnEnter() {
- DoGetSize();
+ DoAction();
if ( !everyFrame ) {
Finish();
}
}
public override void OnUpdate() {
- DoGetSize();
+ DoAction();
}
- void DoGetSize() {
+ void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
var value = isoObject.size;
diff --git a/Assets/IsoTools/PlayMaker/Actions/IsoResize.cs b/Assets/IsoTools/PlayMaker/Actions/IsoResize.cs
index 4ef19c4..352f595 100644
--- a/Assets/IsoTools/PlayMaker/Actions/IsoResize.cs
+++ b/Assets/IsoTools/PlayMaker/Actions/IsoResize.cs
@@ -39,20 +39,20 @@ namespace IsoTools.PlayMaker.Actions {
public override void OnEnter() {
if ( !everyFrame && !lateUpdate && !fixedUpdate ) {
- DoResize();
+ DoAction();
Finish();
}
}
public override void OnUpdate() {
if ( !lateUpdate && !fixedUpdate ) {
- DoResize();
+ DoAction();
}
}
public override void OnLateUpdate() {
if ( lateUpdate ) {
- DoResize();
+ DoAction();
}
if ( !everyFrame ) {
Finish();
@@ -61,18 +61,18 @@ namespace IsoTools.PlayMaker.Actions {
public override void OnFixedUpdate() {
if ( fixedUpdate ) {
- DoResize();
+ DoAction();
}
if ( !everyFrame ) {
Finish();
}
}
- void DoResize() {
+ void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
var value = vector.IsNone
- ? new Vector3(x.Value, y.Value, z.Value)
+ ? Vector3.zero
: vector.Value;
if ( !x.IsNone ) {
diff --git a/Assets/IsoTools/PlayMaker/Actions/IsoSetMode.cs b/Assets/IsoTools/PlayMaker/Actions/IsoSetMode.cs
index 951f10f..aa3b8a8 100644
--- a/Assets/IsoTools/PlayMaker/Actions/IsoSetMode.cs
+++ b/Assets/IsoTools/PlayMaker/Actions/IsoSetMode.cs
@@ -12,17 +12,54 @@ namespace IsoTools.PlayMaker.Actions {
[ObjectType(typeof(IsoObject.Mode))]
public FsmEnum mode;
+ public bool everyFrame;
+ public bool lateUpdate;
+ public bool fixedUpdate;
+
public override void Reset() {
- gameObject = null;
- mode = IsoObject.Mode.Mode2d;
+ gameObject = null;
+ mode = new FsmEnum{UseVariable = true};
+ everyFrame = false;
+ lateUpdate = false;
+ fixedUpdate = false;
+ }
+
+ public override void OnPreprocess() {
+ Fsm.HandleFixedUpdate = true;
}
public override void OnEnter() {
- DoSetMode();
- Finish();
+ if ( !everyFrame && !lateUpdate && !fixedUpdate ) {
+ DoAction();
+ Finish();
+ }
}
- void DoSetMode() {
+ 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) ) {
isoObject.mode = (IsoObject.Mode)mode.Value;
diff --git a/Assets/IsoTools/PlayMaker/Actions/IsoSetPosition.cs b/Assets/IsoTools/PlayMaker/Actions/IsoSetPosition.cs
index 20b4ecf..6635140 100644
--- a/Assets/IsoTools/PlayMaker/Actions/IsoSetPosition.cs
+++ b/Assets/IsoTools/PlayMaker/Actions/IsoSetPosition.cs
@@ -37,20 +37,20 @@ namespace IsoTools.PlayMaker.Actions {
public override void OnEnter() {
if ( !everyFrame && !lateUpdate && !fixedUpdate ) {
- DoSetPosition();
+ DoAction();
Finish();
}
}
public override void OnUpdate() {
if ( !lateUpdate && !fixedUpdate ) {
- DoSetPosition();
+ DoAction();
}
}
public override void OnLateUpdate() {
if ( lateUpdate ) {
- DoSetPosition();
+ DoAction();
}
if ( !everyFrame ) {
Finish();
@@ -59,14 +59,14 @@ namespace IsoTools.PlayMaker.Actions {
public override void OnFixedUpdate() {
if ( fixedUpdate ) {
- DoSetPosition();
+ DoAction();
}
if ( !everyFrame ) {
Finish();
}
}
- void DoSetPosition() {
+ void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
var value = vector.IsNone
diff --git a/Assets/IsoTools/PlayMaker/Actions/IsoSetSize.cs b/Assets/IsoTools/PlayMaker/Actions/IsoSetSize.cs
index cfd30cf..db4f438 100644
--- a/Assets/IsoTools/PlayMaker/Actions/IsoSetSize.cs
+++ b/Assets/IsoTools/PlayMaker/Actions/IsoSetSize.cs
@@ -37,20 +37,20 @@ namespace IsoTools.PlayMaker.Actions {
public override void OnEnter() {
if ( !everyFrame && !lateUpdate && !fixedUpdate ) {
- DoSetSize();
+ DoAction();
Finish();
}
}
public override void OnUpdate() {
if ( !lateUpdate && !fixedUpdate ) {
- DoSetSize();
+ DoAction();
}
}
public override void OnLateUpdate() {
if ( lateUpdate ) {
- DoSetSize();
+ DoAction();
}
if ( !everyFrame ) {
Finish();
@@ -59,14 +59,14 @@ namespace IsoTools.PlayMaker.Actions {
public override void OnFixedUpdate() {
if ( fixedUpdate ) {
- DoSetSize();
+ DoAction();
}
if ( !everyFrame ) {
Finish();
}
}
- void DoSetSize() {
+ void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
var value = vector.IsNone
diff --git a/Assets/IsoTools/PlayMaker/Actions/IsoTranslate.cs b/Assets/IsoTools/PlayMaker/Actions/IsoTranslate.cs
index 9d3ad4b..1ca3bfd 100644
--- a/Assets/IsoTools/PlayMaker/Actions/IsoTranslate.cs
+++ b/Assets/IsoTools/PlayMaker/Actions/IsoTranslate.cs
@@ -39,20 +39,20 @@ namespace IsoTools.PlayMaker.Actions {
public override void OnEnter() {
if ( !everyFrame && !lateUpdate && !fixedUpdate ) {
- DoTranlate();
+ DoAction();
Finish();
}
}
public override void OnUpdate() {
if ( !lateUpdate && !fixedUpdate ) {
- DoTranlate();
+ DoAction();
}
}
public override void OnLateUpdate() {
if ( lateUpdate ) {
- DoTranlate();
+ DoAction();
}
if ( !everyFrame ) {
Finish();
@@ -61,18 +61,18 @@ namespace IsoTools.PlayMaker.Actions {
public override void OnFixedUpdate() {
if ( fixedUpdate ) {
- DoTranlate();
+ DoAction();
}
if ( !everyFrame ) {
Finish();
}
}
- void DoTranlate() {
+ void DoAction() {
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if ( UpdateCache(go) ) {
var value = vector.IsNone
- ? new Vector3(x.Value, y.Value, z.Value)
+ ? Vector3.zero
: vector.Value;
if ( !x.IsNone ) {