InstructionEditor.Gui.TimeControlWindow.PlayPushed C# (CSharp) Méthode

PlayPushed() static private méthode

static private PlayPushed ( Window callingWindow ) : void
callingWindow FlatRedBall.Gui.Window
Résultat void
        void PlayPushed(Window callingWindow)
        {
            #region If current keyframe list

            if (EditorData.EditorLogic.CurrentKeyframeList != null)
            {
                if (Cycling)
                {
                    EditorData.EditorLogic.CurrentKeyframeList.InstructionToExecuteAtEnd =
                        new MethodInstruction<TimeControlWindow>(
                        this, "ToStartPushed", new object[] { null }, 0);
                }
                else
                {
                    EditorData.EditorLogic.CurrentKeyframeList.InstructionToExecuteAtEnd = null;
                }

                InstructionList velocityList =
                    EditorData.EditorLogic.CurrentKeyframeList.CreateVelocityListAtTime(
                        GuiData.TimeLineWindow.CurrentValue);

                foreach (Instruction instruction in velocityList)
                {
                    // add the current time but subtract the time in the velocity list
                    instruction.TimeToExecute += TimeManager.CurrentTime - GuiData.TimeLineWindow.CurrentValue;

                }

                velocityList.ExecuteAndRemoveOrCyclePassedInstructions();

                InstructionManager.Instructions.AddRange(velocityList);

            }
            #endregion

            #region else, if there is an AnimationSequence

            else if (EditorData.EditorLogic.CurrentAnimationSequence != null)
            {
                EditorData.EditorLogic.CurrentAnimationSequence.Play( 
                    GuiData.TimeLineWindow.CurrentValue,
                    this.Cycling
                    );
            }

            #endregion

            GuiData.TimeLineWindow.IsPlaying = true;

        }