private GLexTexture(Texture2D texture) : base()
    {
        mTexture  = texture;
        mImporter = (TextureImporter)AssetImporter.GetAtPath(OriginalURL);

        // texture need to be readable for export
        if (!mImporter.isReadable)
        {
            Debug.LogWarning("GLexTexture.Construct: Setting texture " + Name + " as Readable, or export will fail!");

            mImporter.isReadable = true;
            AssetDatabase.ImportAsset(OriginalURL);
            mImporter = (TextureImporter)AssetImporter.GetAtPath(OriginalURL);
        }

        if (IsARGB32orRGB24)
        {
            _dataBytes = mTexture.EncodeToPNG();
        }
        else
        {
            _dataBytes = new JPGEncoder(mTexture, GLexConfig.JPEGQuality).GetBytes();
        }
        _dataBinaryKeystring = NamesUtil.GenerateBinaryId(_dataBytes, GLex.Instance.UserName);

        mTextures.Add(this);
    }
    public GooAnimationClipChannel(GLexAnimationClip pClip, GLexBone pBone)
    {
        _clip = pClip;
        _bone = pBone;
        _id   = NamesUtil.GenerateUniqueId();

        ResetCurveData();
    }
Exemple #3
0
    public GLexGameObject(GameObject gameObject, GLexData data) : base()
    {
        mGameObject = gameObject;
        mComponents = new List <GLexComponent>();
        _glexData   = data;
        _keystring  = NamesUtil.GenerateUniqueId();

//		if (Settings == null) {
//			AddSettings();
//		}
    }
Exemple #4
0
 public static bool Exists(string name, Component meshRenderer)
 {
     foreach (GLexMaterial material in mMaterials)
     {
         if (NamesUtil.CleanMaterial(material.mMaterial.name) == name && HasSameMaterialSettings(material.mMaterialSettings, meshRenderer.GetComponent <GLexMaterialSettings>()))
         {
             return(true);
         }
     }
     return(false);
 }
Exemple #5
0
    public GLexBone(int index, Transform transform, SkinnedMeshRenderer renderer)
    {
        _id = NamesUtil.GenerateUniqueId();

        mIndex     = index;
        mTransform = transform;
        mRenderer  = renderer;
        mBindPose  = renderer.sharedMesh.bindposes[mIndex];

        mBones.Add(this);
    }
Exemple #6
0
    public GLexMesh(Mesh mesh) : base()
    {
        mMesh = mesh;
        mMeshes.Add(this);

        _submeshIds = new string[mMesh.subMeshCount];
        for (int i = 0; i < _submeshIds.Length; ++i)
        {
            _submeshIds[i] = NamesUtil.GenerateUniqueId() + IdExtension;
        }
    }
    public GLexSound(AudioClip pClip, float pVolume, bool pLooping) : base()
    {
        mComponent = pClip;
        mImporter  = (AudioImporter)AssetImporter.GetAtPath(OriginalURL);

        _volume = pVolume;
        _loops  = pLooping;

        _dataBytes    = File.ReadAllBytes(AssetDatabase.GetAssetPath(mComponent));
        _dataBinaryId = NamesUtil.GenerateBinaryId(_dataBytes, GLex.Instance.UserName);
    }
Exemple #8
0
    public static GLexMaterial Get(string name, Component meshRenderer)
    {
        foreach (GLexMaterial material in mMaterials)
        {
            if (NamesUtil.CleanMaterial(material.mMaterial.name) == name && HasSameMaterialSettings(material.mMaterialSettings, meshRenderer.GetComponent <GLexMaterialSettings>()))
            {
                return(material);
            }
        }

        Debug.LogError("GLexMaterial.Get: Trying to get " + name + " but it doesn't exists!");
        return(null);
    }
Exemple #9
0
    public static GLexMaterial Get(Material material, Component meshRenderer)
    {
        string name = NamesUtil.CleanMaterial(material.name);

        if (Exists(name, meshRenderer))
        {
            return(Get(name, meshRenderer));
        }
        else
        {
            return(new GLexMaterial(material, meshRenderer));
        }
    }
Exemple #10
0
    public static string GetJ3DRenderer(Material m, Transform t)
    {
        int i = t.gameObject.GetComponent <Renderer>().lightmapIndex;

        if (t.gameObject.isStatic && i < 255 && i > -1)
        {
            return("Lightmapped");
        }

        /*
         * if(m.shader.name.IndexOf("Self-Illumin") > -1 || m.shader.name.IndexOf("Unlit") > -1) return "diffuse";
         * if(m.shader.name == "VertexLit") return "diffuse";
         */

        return(NamesUtil.CleanLc(m.shader.name));
    }
    public GLexAnimation() : base()
    {
        mAnimations.Add(this);

        _layerId = NamesUtil.GenerateUniqueId();
    }
Exemple #12
0
 public void ResetSettingsExportName()
 {
     Settings.UniqueName = NamesUtil.GenerateUniqueId();
 }
Exemple #13
0
 public GLexComponent()
 {
     mKeystring = NamesUtil.GenerateUniqueId();
 }
Exemple #14
0
 public AnimationObject(string n)
 {
     Name       = NamesUtil.CleanLc(n);
     Properties = new List <AnimationProperty>();
 }