mirror of
https://github.com/BlackMATov/unity-iso-tools.git
synced 2025-12-16 22:16:55 +07:00
New PlayMaker actions: IsoIsUseGravity, IsoSetIsKinematic, IsoSetUseGravity, IsoWakeUp
This commit is contained in:
34
Assets/IsoTools/PlayMaker/Actions/IsoSetIsKinematic.cs
Normal file
34
Assets/IsoTools/PlayMaker/Actions/IsoSetIsKinematic.cs
Normal file
@@ -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<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
|
||||
Reference in New Issue
Block a user