New PlayMaker actions: IsoSetDrag, IsoGetDrag, IsoSetMass, IsoGetMass, IsoIsKinematic, IsoIsSleeping, IsoSleep

This commit is contained in:
2015-12-20 20:38:14 +06:00
parent c16c0d7c28
commit 7c867f36ff
16 changed files with 402 additions and 5 deletions

View File

@@ -55,6 +55,8 @@
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoAddForce.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoConvertIsometricToScreen.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoConvertScreenToIsometric.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoGetDrag.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoGetMass.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoGetMode.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoGetMouseIsoPosition.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoGetMouseIsoTilePosition.cs" />
@@ -66,13 +68,20 @@
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoGetTouchIsoTilePosition.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoGetVelocity.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoGetWorldProps.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoIsKinematic.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoIsSleeping.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoResize.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoSetDrag.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoSetMass.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoSetMode.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoSetPosition.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoSetSize.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoSetVelocity.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoSetWorldProps.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoSleep.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoTranslate.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoUseGravity.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoWakeUp.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Events\IsoCollisionEvent.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Events\IsoTriggerEvent.cs" />
<Compile Include="Assets\IsoTools\PlayMaker\Internal\IsoComponentAction.cs" />

View File

@@ -135,7 +135,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
propertyPath: m_LocalPosition.z
value: 1.5000001
value: 1.3000001
objectReference: {fileID: 0}
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
propertyPath: m_LocalRotation.x
@@ -1504,7 +1504,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
propertyPath: m_LocalPosition.z
value: 1.4000001
value: 1.2
objectReference: {fileID: 0}
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
propertyPath: m_LocalRotation.x
@@ -1566,7 +1566,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
propertyPath: m_LocalPosition.z
value: 1.2
value: 1.5000001
objectReference: {fileID: 0}
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
propertyPath: m_LocalRotation.x
@@ -1697,7 +1697,7 @@ Transform:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1708422616}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.0000076293945, y: 63.999996, z: 1.3000001}
m_LocalPosition: {x: -0.0000076293945, y: 63.999996, z: 1.1}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
@@ -2144,7 +2144,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
propertyPath: m_LocalPosition.z
value: 1.1
value: 1.4000001
objectReference: {fileID: 0}
- target: {fileID: 453404, guid: d10e5320df9f84d4186bda0ba98db9ff, type: 2}
propertyPath: m_LocalRotation.x

View File

@@ -0,0 +1,44 @@
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

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,44 @@
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

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,50 @@
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

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,50 @@
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

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,43 @@
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

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,43 @@
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

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,30 @@
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

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: