public void setParent(LoziObject parent) { this.parent = parent; if (type == ObjectType.SkinnedMesh && this.parent.type == ObjectType.AnimationObject) { if (this.parent.animation != null) { this.animation = this.parent.animation; this.animation.isSkinAnimation = true; this.parent.animation = null; } } }
public LoziAnimationCollection(GameObject obj) { animationObjects = new List <LoziAnimation>(); foreach (Animation animation in obj.GetComponentsInChildren <Animation>()) { if (animation.GetClipCount() > 0) { LoziAnimation anm = hasInArray(animation); if (anm != null) { anm.checkAndAddClips(animation); } else { animationObjects.Add(new LoziAnimation(animation.gameObject)); } } } }
//sets component of type if exists private void setComponents() { if (LoziMesh.hasMesh(obj)) { mesh = LoziExporter.instance.meshCollection.getMeshByGameObject(obj); } if (LoziMaterial.hasMaterial(obj)) { material = LoziExporter.instance.materialCollection.getMaterialByGameObject(obj); } if (LoziCamera.hasCamera(obj)) { camera = new LoziCamera(obj); } if (LoziLight.hasLight(obj)) { light = new LoziLight(obj); } if (LoziAnimation.hasAnimation(obj)) { animation = LoziExporter.instance.animationCollection.getAnimationByGameObject(obj); } }