Esempio n. 1
0
        public static void TogglePausePhysics()
        {
            if (currentPhysicsCommand != null)
            {
                currentPhysicsCommand.Stop();
                currentPhysicsCommand = null;
                return;
            }

            currentPhysicsCommand = new PhysicsPauseCommand(0);
            MonkeyEditorUtils.AddSceneCommand(currentPhysicsCommand);
        }
Esempio n. 2
0
        public static void PausePhysicsDuration(
            [CommandParameter(Help = "The duration for which the physics will be paused")]
            float duration = 5)
        {
            if (currentPhysicsCommand != null)
            {
                if (Mathf.Approximately(duration, 0))
                {
                    currentPhysicsCommand.Stop();
                }
                else
                {
                    currentPhysicsCommand.Duration    = duration;
                    currentPhysicsCommand.CurrentTime = 0;
                }
                return;
            }

            currentPhysicsCommand = new PhysicsPauseCommand(duration);
            MonkeyEditorUtils.AddSceneCommand(currentPhysicsCommand);
        }