示例#1
0
 public OffsetAnimation()
 {
     Curve.AddKey(0, 0);
     Curve.AddKey(0.25f, 0.1f);
     Curve.AddKey(0.75f, -0.1f);
     Curve.AddKey(1, 0f);
 }
示例#2
0
        public static void CreateAnimationKey(string objectName, string channel, int channelIndex, int frame, float value, int interpolation)
        {
            AnimatableProperty property = BlenderToVRtistAnimationProperty(channel, channelIndex);

            if (property == AnimatableProperty.Unknown)
            {
                Debug.LogError("Unknown Animation Property " + objectName + " " + channel + " " + channelIndex);
                return;
            }

            Node node = SyncData.nodes[objectName];

            // Apply to instances
            foreach (Tuple <GameObject, string> t in node.instances)
            {
                GameObject   gobj         = t.Item1;
                AnimationSet animationSet = GlobalState.Animation.GetOrCreateObjectAnimation(gobj);
                Curve        curve        = animationSet.GetCurve(property);

                if (property == AnimatableProperty.RotationX || property == AnimatableProperty.RotationY || property == AnimatableProperty.RotationZ)
                {
                    value = Mathf.Rad2Deg * value;
                }

                curve.AddKey(new AnimationKey(frame, value, (Interpolation)interpolation));
            }
        }
示例#3
0
        public MoveAnimation(Vector2 from, Vector2 to)
        {
            this.from = from;
            this.to   = to;

            Curve.AddKey(0, 0);
            Curve.AddKey(0.25f, 0.1f);
            Curve.AddKey(0.75f, -0.1f);
            Curve.AddKey(1, 0f);
        }
示例#4
0
        public void AddKey(float time)
        {
            float value    = Curve.Evaluate(time);
            int   keyIndex = Curve.AddKey(time, value);

            Skill.Editor.CurveUtility.SetKeyModeFromContext(Curve, keyIndex);
            Skill.Editor.CurveUtility.UpdateTangentsFromModeSurrounding(Curve, keyIndex);

            RebuildKeys();
            View.Editor.Selection.Select((CurveKey)Controls[keyIndex]);
            _Resample = true;
            OnChanged();
        }
示例#5
0
 public FadeAnimation()
 {
     Curve.AddKey(0, 0);
     Curve.AddKey(1, 1);
 }
示例#6
0
 public RotateAnimation()
 {
     Curve.AddKey(0, 0);
     Curve.AddKey(1, 1);
 }
示例#7
0
 public SlideAnimation()
 {
     Curve.AddKey(new Keyframe(0, 0, 0, 0));
     Curve.AddKey(new Keyframe(1, 1, 0, 0));
 }
示例#8
0
 public ScaleAnimation()
 {
     Curve.AddKey(0, 0);
     Curve.AddKey(1, 1);
 }