コード例 #1
0
        public TimedKeyframeList ToTimedKeyframeList(List <InstructionSet> instructionSetList)
        {
            InstructionSet targetInstructionSet = null;

            foreach (InstructionSet instructionSet in instructionSetList)
            {
                if (instructionSet.Name == this.Target)
                {
                    targetInstructionSet = instructionSet;
                    break;
                }
            }

            // Now that we know which InstructionSet we're working with, find the keyframe with the
            // matching name
            KeyframeList targetKeyframeList = null;

            foreach (KeyframeList keyframeList in targetInstructionSet)
            {
                if (keyframeList.Name == this.NameOfReferencedKeyframeList)
                {
                    targetKeyframeList = keyframeList;
                    break;
                }
            }

            TimedKeyframeList timedKeyframeList = new TimedKeyframeList(targetKeyframeList, Target);

            timedKeyframeList.TimeToExecute = Time;

            return(timedKeyframeList);
        }
コード例 #2
0
        private void DoubleClickAnimationSequenceListBox(Window callingWindow)
        {
            object highlightedObject = mAnimationSequenceListBox.GetFirstHighlightedObject();

            if (highlightedObject != null)
            {
                if (highlightedObject is AnimationSequence)
                {
                    // Any logic here?
                }
                else if (highlightedObject is TimedKeyframeList)
                {
                    // Find the object that this references and select it.
                    TimedKeyframeList asTimedKeyframeList = highlightedObject as TimedKeyframeList;

                    INameable target = EditorData.BlockingScene.FindByName(asTimedKeyframeList.TargetName);

                    if (target is Sprite)
                    {
                        EditorData.EditorLogic.SelectObject <Sprite>(target as Sprite, EditorData.EditorLogic.CurrentSprites);
                    }
                    // else other types

                    GuiData.TimeLineWindow.InstructionMode = InstructionMode.Current;

                    EditorData.EditorLogic.CurrentKeyframeList = asTimedKeyframeList.KeyframeList;
                }
            }
        }
コード例 #3
0
        public static TimedKeyframeListSave FromTimedKeyframeList(TimedKeyframeList timedKeyframeList)
        {
            TimedKeyframeListSave tkls = new TimedKeyframeListSave();

            tkls.Name   = timedKeyframeList.Name;
            tkls.Target = timedKeyframeList.TargetName;
            tkls.NameOfReferencedKeyframeList = timedKeyframeList.NameOfReferencedKeyframeList;
            tkls.Time = timedKeyframeList.TimeToExecute;

            return(tkls);
        }
コード例 #4
0
        public static void AddKeyframeToGlobalInstrutionSet(Window callingWindow)
        {
            KeyframeList keyframeList = ((KeyframeListSelectionWindow)callingWindow).SelectedKeyframeList;

            INameable targetNameable = ((KeyframeListSelectionWindow)callingWindow).SelectedNameable;

            TimedKeyframeList timedKeyframeList = new TimedKeyframeList(keyframeList, targetNameable.Name);

            timedKeyframeList.TimeToExecute = GuiData.TimeLineWindow.CurrentValue;

            // Add the selected KeyframeList to the Global InstructionSet
            EditorData.EditorLogic.CurrentAnimationSequence.Add(timedKeyframeList);
        }
コード例 #5
0
        private string GetTimedKeyframeListStringRepresentation(object timedKeyframeList)
        {
            TimedKeyframeList asTimedKeyframeList = timedKeyframeList as TimedKeyframeList;

            return(asTimedKeyframeList.TargetName + " : " + asTimedKeyframeList.Name);
        }