예제 #1
0
        public static AnimationElementObject CreateFrom(GameObject o, AnimationElement ae, GameObject root)
        {
            AnimationElementObject aeo = new GameObject().AddComponent <AnimationElementObject>();

            aeo.transform.parent        = ae.transform;
            aeo.name                    = o.name + ".aeo";
            aeo.transform.localPosition = Vector3.zero;
            aeo.transform.localScale    = Vector3.one;
            aeo.obj = AnimationObject.CreateFromLocal(o, root);
            return(aeo);
        }
예제 #2
0
        public static AnimationObject CreateFromLocal(GameObject target, GameObject rootParent)
        {
            AnimationObject ao = new AnimationObject();

            ao.position    = target.transform.position;
            ao._instance   = target;
            ao.rootParent  = rootParent;
            ao.eulerAngles = target.transform.localEulerAngles;
            ao.scale       = target.transform.localScale;
            return(ao);
        }
예제 #3
0
 public void SetupStaticObjects()
 {
     staticAnimationObjectsAR = new List <AnimationObject>();
     foreach (Transform t in holder.animationObjectsParentAR.transform)
     {
         staticAnimationObjectsAR.Add(AnimationObject.CreateFromLocal(t.gameObject, holder.animationObjectsParentAR));
     }
     staticAnimationObjectsNonAR = new List <AnimationObject>();
     foreach (Transform t in holder.animationObjectsParentNonAR.transform)
     {
         staticAnimationObjectsNonAR.Add(AnimationObject.CreateFromLocal(t.gameObject, holder.animationObjectsParentNonAR));
     }
 }
예제 #4
0
 public void Animate(Vector3 EndPosition, Vector3 EndRotation, TimeSpan Duration, bool Loop)
 {
     animObj = new AnimationObject(this.Position, EndPosition, this.Rotation, EndRotation, Duration, Loop);
 }