public LoziMeshCollection(GameObject obj) { meshObjects = new List <LoziMesh>(); foreach (Transform transform in obj.GetComponentsInChildren <Transform>()) { Mesh mesh = LoziMesh.getMesh(transform.gameObject); if (mesh != null && canAddInArray(mesh)) { meshObjects.Add(new LoziMesh(transform.gameObject)); } } }
public Texture getLightMap(GameObject target) { Renderer renderer = LoziMesh.getRenderer(target); if (renderer != null && renderer.lightmapIndex > -1) { if (LightmapSettings.lightmaps[renderer.lightmapIndex].lightmapFar != null) { return(LightmapSettings.lightmaps[renderer.lightmapIndex].lightmapFar); } } return(null); }
//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); } }
public LoziMesh getMeshByGameObject(GameObject obj) { return(getMeshByMesh(LoziMesh.getMesh(obj))); }