diff --git a/Assembly-CSharp.csproj b/Assembly-CSharp.csproj index 2ce97de..fb43044 100644 --- a/Assembly-CSharp.csproj +++ b/Assembly-CSharp.csproj @@ -70,17 +70,19 @@ + + + - diff --git a/Assets/IsoTools/PlayMaker/Actions/IsoIsUseGravity.cs b/Assets/IsoTools/PlayMaker/Actions/IsoIsUseGravity.cs new file mode 100644 index 0000000..8562a2b --- /dev/null +++ b/Assets/IsoTools/PlayMaker/Actions/IsoIsUseGravity.cs @@ -0,0 +1,50 @@ +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 { + [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 \ No newline at end of file diff --git a/Assets/IsoTools/PlayMaker/Actions/IsoIsUseGravity.cs.meta b/Assets/IsoTools/PlayMaker/Actions/IsoIsUseGravity.cs.meta new file mode 100644 index 0000000..67710b9 --- /dev/null +++ b/Assets/IsoTools/PlayMaker/Actions/IsoIsUseGravity.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: bc13998ebfe99487a9e042a27adb3d18 +timeCreated: 1450621205 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/IsoTools/PlayMaker/Actions/IsoSetIsKinematic.cs b/Assets/IsoTools/PlayMaker/Actions/IsoSetIsKinematic.cs new file mode 100644 index 0000000..0108fd5 --- /dev/null +++ b/Assets/IsoTools/PlayMaker/Actions/IsoSetIsKinematic.cs @@ -0,0 +1,34 @@ +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 { + [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 \ No newline at end of file diff --git a/Assets/IsoTools/PlayMaker/Actions/IsoSetIsKinematic.cs.meta b/Assets/IsoTools/PlayMaker/Actions/IsoSetIsKinematic.cs.meta new file mode 100644 index 0000000..718541d --- /dev/null +++ b/Assets/IsoTools/PlayMaker/Actions/IsoSetIsKinematic.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: fd8b09a582b9846e79c50485090f3fe3 +timeCreated: 1450622310 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/IsoTools/PlayMaker/Actions/IsoSetUseGravity.cs b/Assets/IsoTools/PlayMaker/Actions/IsoSetUseGravity.cs new file mode 100644 index 0000000..3b30d7d --- /dev/null +++ b/Assets/IsoTools/PlayMaker/Actions/IsoSetUseGravity.cs @@ -0,0 +1,34 @@ +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 { + [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 \ No newline at end of file diff --git a/Assets/IsoTools/PlayMaker/Actions/IsoSetUseGravity.cs.meta b/Assets/IsoTools/PlayMaker/Actions/IsoSetUseGravity.cs.meta new file mode 100644 index 0000000..34876c0 --- /dev/null +++ b/Assets/IsoTools/PlayMaker/Actions/IsoSetUseGravity.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ad8fb89aabd864275b73abb7a6b47165 +timeCreated: 1450623490 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/IsoTools/PlayMaker/Actions/IsoWakeUp.cs b/Assets/IsoTools/PlayMaker/Actions/IsoWakeUp.cs new file mode 100644 index 0000000..2d308d1 --- /dev/null +++ b/Assets/IsoTools/PlayMaker/Actions/IsoWakeUp.cs @@ -0,0 +1,30 @@ +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 { + [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 \ No newline at end of file diff --git a/Assets/IsoTools/PlayMaker/Actions/IsoWakeUp.cs.meta b/Assets/IsoTools/PlayMaker/Actions/IsoWakeUp.cs.meta new file mode 100644 index 0000000..63a8d6a --- /dev/null +++ b/Assets/IsoTools/PlayMaker/Actions/IsoWakeUp.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b4872fa9b5ff346f88f45459d0c257e0 +timeCreated: 1450621127 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: