#if CHRONOS_PLAYMAKER using HutongGames.PlayMaker; namespace Chronos.PlayMaker { [ActionCategory("Physics 2d (Chronos)")] [Tooltip("Gets the Mass of a Game Object's Rigid Body 2D.")] public class GetMass2d : ChronosComponentAction { [RequiredField] [CheckForComponent(typeof(Timeline))] public FsmOwnerDefault gameObject; [RequiredField] [UIHint(UIHint.Variable)] public FsmFloat storeResult; public override void Reset() { gameObject = null; storeResult = null; } public override void OnEnter() { DoGetMass(); Finish(); } private void DoGetMass() { if (!UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject))) return; storeResult.Value = timeline.rigidbody2D.mass; } } } #endif