mirror of
https://github.com/BlackMATov/unity-iso-tools.git
synced 2025-12-13 15:52:03 +07:00
33 lines
716 B
C#
33 lines
716 B
C#
#if PLAYMAKER
|
|
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<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.WakeUp();
|
|
}
|
|
}
|
|
}
|
|
} // IsoTools.PlayMaker.Actions
|
|
#endif
|