Beispiel #1
0
    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);
        }
    }
Beispiel #2
0
    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);
        }
    }
Beispiel #3
0
    void RecurseTransform(Transform t)
    {
        if (!t.gameObject.active)
        {
            return;
        }

        tex.Add(new TransformExportData(t));

        if (t.renderer != null)
        {
            MeshExportData me = new MeshExportData(t);
            if (!mex.ContainsKey(me.Name))
            {
                mex.Add(me.Name, me);
            }

            MaterialExportData mt = new MaterialExportData(t);
            if (!mtx.ContainsKey(mt.Name))
            {
                mtx.Add(mt.Name, mt);
            }
        }

        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));
        }
    }
Beispiel #4
0
	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);
		}
	}
Beispiel #5
0
    void RecurseTransform(Transform t)
    {
        if (!t.gameObject.active)
            return;

        tex.Add (new TransformExportData (t));

        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))
                    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));
        }
    }
Beispiel #6
0
    void RecurseTransform(Transform t)
    {
        if (!t.gameObject.active)
            return;

        tex.Add (new TransformExportData (t));

        if (t.renderer != null) {
            MeshExportData me = new MeshExportData (t);
            if (!mex.ContainsKey (me.Name))
                mex.Add (me.Name, me);

            MaterialExportData mt = new MaterialExportData (t);
            if (!mtx.ContainsKey (mt.Name))
                mtx.Add (mt.Name, mt);
        }

        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));
        }
    }
Beispiel #7
0
    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);
        }
    }
Beispiel #8
0
    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);
        }
    }