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); }
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); }
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)); } }
public void Animate(Vector3 EndPosition, Vector3 EndRotation, TimeSpan Duration, bool Loop) { animObj = new AnimationObject(this.Position, EndPosition, this.Rotation, EndRotation, Duration, Loop); }