1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #if CHRONOS_PLAYMAKER
- using HutongGames.PlayMaker;
- namespace Chronos.PlayMaker
- {
- [ActionCategory("Physics (Chronos)")]
- [Tooltip("Controls whether physics affects the Game Object.")]
- public class SetIsKinematic : ChronosComponentAction<Timeline>
- {
- [RequiredField]
- [CheckForComponent(typeof(Timeline))]
- public FsmOwnerDefault gameObject;
- [RequiredField]
- public FsmBool isKinematic;
- public override void Reset()
- {
- gameObject = null;
- isKinematic = false;
- }
- public override void OnEnter()
- {
- DoSetIsKinematic();
- Finish();
- }
- private void DoSetIsKinematic()
- {
- var go = Fsm.GetOwnerDefaultTarget(gameObject);
- if (UpdateCache(go))
- {
- timeline.rigidbody.isKinematic = isKinematic.Value;
- }
- }
- }
- }
- #endif
|