mirror of
https://github.com/BlackMATov/unity-iso-tools.git
synced 2025-12-15 01:12:05 +07:00
New PlayMaker action: IsoAddExplosionForce
This commit is contained in:
@@ -51,6 +51,7 @@
|
||||
<Compile Include="Assets\IsoTools\Examples\Scripts\CubeAutoMovement.cs" />
|
||||
<Compile Include="Assets\IsoTools\Examples\Scripts\IsoEchoListener.cs" />
|
||||
<Compile Include="Assets\IsoTools\Examples\Scripts\PlayerController.cs" />
|
||||
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoAddExplosionForce.cs" />
|
||||
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoAddForce.cs" />
|
||||
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoConvertIsometricToScreen.cs" />
|
||||
<Compile Include="Assets\IsoTools\PlayMaker\Actions\IsoConvertScreenToIsometric.cs" />
|
||||
|
||||
@@ -1857,13 +1857,13 @@ MonoBehaviour:
|
||||
colorIndex: 0
|
||||
actionData:
|
||||
actionNames:
|
||||
- IsoTools.PlayMaker.Actions.IsoAddForce
|
||||
- IsoTools.PlayMaker.Actions.IsoAddExplosionForce
|
||||
customNames:
|
||||
-
|
||||
actionEnabled: 01
|
||||
actionIsOpen: 01
|
||||
actionStartIndex: 00000000
|
||||
actionHashCodes: febdb401
|
||||
actionHashCodes: ed711102
|
||||
unityObjectParams: []
|
||||
fsmGameObjectParams: []
|
||||
fsmOwnerDefaultParams:
|
||||
@@ -1887,35 +1887,29 @@ MonoBehaviour:
|
||||
fsmArrayParams: []
|
||||
fsmEnumParams: []
|
||||
fsmFloatParams:
|
||||
- useVariable: 1
|
||||
name:
|
||||
tooltip:
|
||||
showInInspector: 0
|
||||
networkSync: 0
|
||||
value: 0
|
||||
- useVariable: 1
|
||||
name:
|
||||
tooltip:
|
||||
showInInspector: 0
|
||||
networkSync: 0
|
||||
value: 0
|
||||
- useVariable: 0
|
||||
name:
|
||||
tooltip:
|
||||
showInInspector: 0
|
||||
networkSync: 0
|
||||
value: 13
|
||||
fsmIntParams: []
|
||||
fsmBoolParams: []
|
||||
fsmVector2Params: []
|
||||
fsmVector3Params:
|
||||
- useVariable: 1
|
||||
value: 15
|
||||
- useVariable: 0
|
||||
name:
|
||||
tooltip:
|
||||
showInInspector: 0
|
||||
networkSync: 0
|
||||
value: {x: 0, y: 0, z: 0}
|
||||
- useVariable: 1
|
||||
value: 10
|
||||
- useVariable: 0
|
||||
name:
|
||||
tooltip:
|
||||
showInInspector: 0
|
||||
networkSync: 0
|
||||
value: 0
|
||||
fsmIntParams: []
|
||||
fsmBoolParams: []
|
||||
fsmVector2Params: []
|
||||
fsmVector3Params:
|
||||
- useVariable: 0
|
||||
name:
|
||||
tooltip:
|
||||
showInInspector: 0
|
||||
@@ -1925,24 +1919,22 @@ MonoBehaviour:
|
||||
fsmRectParams: []
|
||||
fsmQuaternionParams: []
|
||||
stringParams: []
|
||||
byteData: 000000000100000000
|
||||
byteData: 0100000000
|
||||
arrayParamSizes:
|
||||
arrayParamTypes: []
|
||||
customTypeSizes:
|
||||
customTypeNames: []
|
||||
paramDataType: 140000001c0000001c0000000f0000000f0000000f000000070000000700000001000000
|
||||
paramDataType: 140000001c0000000f0000000f0000000f0000000700000001000000
|
||||
paramName:
|
||||
- gameObject
|
||||
- atPosition
|
||||
- vector
|
||||
- x
|
||||
- y
|
||||
- z
|
||||
- space
|
||||
- center
|
||||
- force
|
||||
- radius
|
||||
- upwardsModifier
|
||||
- forceMode
|
||||
- everyFrame
|
||||
paramDataPos: 000000000000000001000000000000000100000002000000000000000400000008000000
|
||||
paramByteDataSize: 000000000000000000000000000000000000000000000000040000000400000001000000
|
||||
paramDataPos: 00000000000000000000000001000000020000000000000004000000
|
||||
paramByteDataSize: 00000000000000000000000000000000000000000400000001000000
|
||||
events:
|
||||
- name: FINISHED
|
||||
isSystemEvent: 1
|
||||
|
||||
78
Assets/IsoTools/PlayMaker/Actions/IsoAddExplosionForce.cs
Normal file
78
Assets/IsoTools/PlayMaker/Actions/IsoAddExplosionForce.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
using UnityEngine;
|
||||
using HutongGames.PlayMaker;
|
||||
using IsoTools.PlayMaker.Internal;
|
||||
|
||||
namespace IsoTools.PlayMaker.Actions {
|
||||
[ActionCategory("IsoTools")]
|
||||
[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
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8925808e9509b47b187c8890c644ba0c
|
||||
timeCreated: 1450615607
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user