public TransformExportData(Transform t, TransformExportData p) { uid = uidc++; this.t = t; this.p = p; this.c = new ColliderExportData(t); }
public TransformExportData (Transform t, TransformExportData p) { uid = uidc++; this.t = t; this.p = p; this.c = new ColliderExportData(t); }
void RecurseTransform(Transform t, TransformExportData p) { if (!t.gameObject.active) { return; } TransformExportData ted = new TransformExportData(t, p, useQuaternions); tex.Add(ted); if (t.renderer != null) { MeshExportData me = new MeshExportData(t); if (!mex.ContainsKey(me.Name)) { mex.Add(me.Id, me); } List <string> textures = TextureUtil.ExtractTexturesNames(t.renderer.sharedMaterial); MaterialExportData mt = new MaterialExportData(t, textures); if (!mtx.ContainsKey(mt.Name)) { mtx.Add(mt.Name, mt); } foreach (string tn in textures) { TextureExportData tx = new TextureExportData(t.renderer.sharedMaterial.GetTexture(tn)); if (!txx.ContainsKey(tx.Name)) { txx.Add(tx.Name, tx); } } } if (t.light != null) { LightExportData ld = new LightExportData(t); lgx.Add(ld); } if (t.camera != null) { CameraExportData cd = new CameraExportData(t); cmx.Add(cd); } if (exportAnimation && t.animation != null && t.animation.clip != null) { AnimationExportData ad = new AnimationExportData(t, useQuaternions, samplesPerSec); anx.Add(ad); } for (var i = 0; i < t.childCount; i++) { RecurseTransform(t.GetChild(i), ted); } }
//public static int uidc; public TransformExportData (Transform t, TransformExportData p, bool useQuaternion) { //uid = uidc++; this.t = t; this.p = p; this.useQuaternion = useQuaternion; this.c = new ColliderExportData(t); }
//public static int uidc; public TransformExportData(Transform t, TransformExportData p, bool useQuaternion) { //uid = uidc++; this.t = t; this.p = p; this.useQuaternion = useQuaternion; this.c = new ColliderExportData(t); }
void RecurseTransform(Transform t, TransformExportData p) { if (!t.gameObject.active) { return; } TransformExportData ted = new TransformExportData(t, p); tex.Add(ted); if (t.renderer != null) { MeshExportData me = new MeshExportData(t); if (!mex.ContainsKey(me.Name)) { mex.Add(me.Name, me); } List <string> textures = TextureUtil.ExtractTexturesNames(t.renderer.sharedMaterial); MaterialExportData mt = new MaterialExportData(t, textures); if (!mtx.ContainsKey(mt.Name)) { mtx.Add(mt.Name, mt); } foreach (string tn in textures) { TextureExportData tx = new TextureExportData(t.renderer.sharedMaterial.GetTexture(tn)); if (!txx.ContainsKey(tx.Name)) { Debug.Log("Adding texture: " + tx.Name); txx.Add(tx.Name, tx); } } } if (t.light != null) { LightExportData ld = new LightExportData(t); lgx.Add(ld); } if (t.camera != null) { CameraExportData cd = new CameraExportData(t); cmx.Add(cd); } for (var i = 0; i < t.childCount; i++) { RecurseTransform(t.GetChild(i), ted); } }
void RecurseTransform (Transform t, TransformExportData p) { if (!t.gameObject.activeInHierarchy) return; TransformExportData ted = new TransformExportData (t, p, useQuaternions); tex.Add (ted); if (t.GetComponent<Renderer>() != null) { MeshExportData me = new MeshExportData (t); if (!mex.ContainsKey (me.Id)) mex.Add (me.Id, me); List<string> textures = TextureUtil.ExtractTexturesNames (t.GetComponent<Renderer>().sharedMaterial); MaterialExportData mt = new MaterialExportData (t, textures); if (!mtx.ContainsKey (mt.Name)) mtx.Add (mt.Name, mt); foreach (string tn in textures) { TextureExportData tx = new TextureExportData (t.GetComponent<Renderer>().sharedMaterial.GetTexture (tn)); if (!txx.ContainsKey (tx.Name)) { txx.Add (tx.Name, tx); } } } if (t.GetComponent<Light>() != null) { LightExportData ld = new LightExportData (t); lgx.Add (ld); } if (t.GetComponent<Camera>() != null) { CameraExportData cd = new CameraExportData (t); cmx.Add (cd); } if (exportAnimation && t.GetComponent<Animator>() != null) { AnimationExportData ad = new AnimationExportData(t, useQuaternions); if (!anx.ContainsKey (ad.UID)) anx.Add (ad.UID, ad); } for (var i = 0; i < t.childCount; i++) { RecurseTransform (t.GetChild (i), ted); } }
public TransformExportData(Transform t, TransformExportData p) { uid = uidc++; this.t = t; this.p = p; }
void RecurseTransform (Transform t, TransformExportData p) { if (!t.gameObject.active) return; TransformExportData ted = new TransformExportData (t, p); tex.Add (ted); if (t.renderer != null) { MeshExportData me = new MeshExportData (t); if (!mex.ContainsKey (me.Name)) mex.Add (me.Name, me); List<string> textures = TextureUtil.ExtractTexturesNames (t.renderer.sharedMaterial); MaterialExportData mt = new MaterialExportData (t, textures); if (!mtx.ContainsKey (mt.Name)) mtx.Add (mt.Name, mt); foreach (string tn in textures) { TextureExportData tx = new TextureExportData (t.renderer.sharedMaterial.GetTexture (tn)); if (!txx.ContainsKey (tx.Name)) { Debug.Log("Adding texture: " + tx.Name); txx.Add (tx.Name, tx); } } } if (t.light != null) { LightExportData ld = new LightExportData (t); lgx.Add (ld); } if (t.camera != null) { CameraExportData cd = new CameraExportData (t); cmx.Add (cd); } for (var i = 0; i < t.childCount; i++) { RecurseTransform (t.GetChild (i), ted); } }
void RecurseTransform(Transform t, TransformExportData p) { if (!t.gameObject.active) return; TransformExportData ted = new TransformExportData (t, p, useQuaternions); tex.Add (ted); if (t.renderer != null) { MeshExportData me = new MeshExportData (t); if (!mex.ContainsKey (me.Name)) mex.Add (me.Id, me); List<string> textures = TextureUtil.ExtractTexturesNames (t.renderer.sharedMaterial); MaterialExportData mt = new MaterialExportData (t, textures); if (!mtx.ContainsKey (mt.Name)) mtx.Add (mt.Name, mt); foreach (string tn in textures) { TextureExportData tx = new TextureExportData (t.renderer.sharedMaterial.GetTexture (tn)); if (!txx.ContainsKey (tx.Name)) { txx.Add (tx.Name, tx); } } } if (t.light != null) { LightExportData ld = new LightExportData (t); lgx.Add (ld); } if (t.camera != null) { CameraExportData cd = new CameraExportData (t); cmx.Add (cd); } if (exportAnimation && t.animation != null && t.animation.clip != null) { AnimationExportData ad = new AnimationExportData(t, useQuaternions, samplesPerSec); anx.Add(ad); } for (var i = 0; i < t.childCount; i++) { RecurseTransform (t.GetChild (i), ted); } }
void RecurseTransform(Transform t, TransformExportData p) { if (!t.gameObject.activeInHierarchy) { return; } TransformExportData ted = new TransformExportData(t, p, useQuaternions); tex.Add(ted); if (t.GetComponent <Renderer>() != null) { MeshExportData me = new MeshExportData(t); if (!mex.ContainsKey(me.Id)) { mex.Add(me.Id, me); } List <string> textures = TextureUtil.ExtractTexturesNames(t.GetComponent <Renderer>().sharedMaterial); MaterialExportData mt = new MaterialExportData(t, textures); if (!mtx.ContainsKey(mt.Name)) { mtx.Add(mt.Name, mt); } foreach (string tn in textures) { TextureExportData tx = new TextureExportData(t.GetComponent <Renderer>().sharedMaterial.GetTexture(tn)); if (!txx.ContainsKey(tx.Name)) { txx.Add(tx.Name, tx); } } } if (t.GetComponent <Light>() != null) { LightExportData ld = new LightExportData(t); lgx.Add(ld); } if (t.GetComponent <Camera>() != null) { CameraExportData cd = new CameraExportData(t); cmx.Add(cd); } if (exportAnimation && t.GetComponent <Animator>() != null) { AnimationExportData ad = new AnimationExportData(t, useQuaternions); if (!anx.ContainsKey(ad.UID)) { anx.Add(ad.UID, ad); } } for (var i = 0; i < t.childCount; i++) { RecurseTransform(t.GetChild(i), ted); } }