예제 #1
0
 /// <summary>
 /// Called when an channel set has been removed from the sceneView
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="set"></param>
 private void View_AnimationRemoved(object sender, GUIAnimation animation)
 {
     mAnimationsToolStripComboBox.Items.Remove(animation);
     this.Invalidate(true);
 }
예제 #2
0
 /// <summary>
 /// Called when an channel set has been added to the sceneView
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="set"></param>
 private void View_AnimationAdded(object sender, GUIAnimation animation)
 {
     mAnimationsToolStripComboBox.Items.Insert(mAnimationsToolStripComboBox.Items.Count - 1, animation);
     this.Invalidate(true);
 }
예제 #3
0
 public BackgroundScraper(GUIAnimation workingAnimation)
 {
     this.workingAnimation = workingAnimation; //skin animation used to show activity
 }
예제 #4
0
        /// <summary>
        /// Sets the control's new parent.  This function will also fix up any
        /// other animations that references the control.
        /// </summary>
        /// <param name="control"></param>
        /// <param name="newParent"></param>
        private static void SetParent(GUIControl control, GUIControl newParent, int index)
        {
            GUIView view = (newParent is GUIView) ? newParent as GUIView : newParent.ParentView;

            Otter.Interface.Matrix invTransform = newParent.FullTransformInv;

            PointF center   = PointF.Empty;
            float  rotation = 0.0f;
            PointF location = PointF.Empty;

            Matrix oldTransformInv = control.TransformInv;
            Matrix newTransform    = control.FullTransform * invTransform;
            Matrix toLocal         = oldTransformInv * newTransform;

            GetComponents(control, ref newTransform, out center, out rotation, out location);

            if (control.ParentView == view)
            {
                GUIAnimation currentAnim  = view.CurrentAnimation;
                uint         currentFrame = currentAnim.Frame;

                foreach (GUIAnimation animation in view.Animations)
                {
                    uint oldFrame = animation.Frame;
                    GUIAnimationChannel channel = animation.GetAnimationChannel(control);

                    if (channel == null)
                    {
                        continue;
                    }

                    view.CurrentAnimation = animation;

                    foreach (KeyFrame keyFrame in channel.KeyFrames)
                    {
                        // This will update the control
                        view.CurrentAnimation.Frame = keyFrame.Frame;

                        PointF kfCenter   = control.Center;
                        float  kfRotation = control.Rotation;
                        PointF kfLocation = control.Location;

                        Matrix kfTransform = control.Transform * toLocal;

                        GetComponents(control, ref kfTransform, out kfCenter, out kfRotation, out kfLocation);

                        keyFrame.Layout.Center   = kfCenter;
                        keyFrame.Layout.Rotation = kfRotation;
                        keyFrame.Layout.Location = kfLocation;
                    }

                    animation.Frame = oldFrame;
                }

                view.CurrentAnimation       = currentAnim;
                view.CurrentAnimation.Frame = currentFrame;

                view.SetNewParent(control, newParent, index);
            }
            else
            {
                control.ParentView.RemoveControl(control);
                view.AddControl(newParent, control);
            }

            control.Center   = center;
            control.Rotation = rotation;
            control.Location = location;
        }
예제 #5
0
 void Start()
 {
     anim = GetComponent<GUIAnimation>();
 }
예제 #6
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="trimStart"></param>
 /// <param name="trimEnd"></param>
 /// <param name="channel"></param>
 public InsertFramesCommand(int position, int count, GUIAnimation animation)
 {
     mAnimation = animation;
     mPosition  = position;
     mCount     = count;
 }