Exemplo n.º 1
0
        private uint GetKey(OptimizableObject opt)
        {
            uint textureKey;

            if (opt.MainTexture == null)
            {
                textureKey = Utils.CalculateMD5Hash(opt.GetColor().ToString());
            }
            else
            {
                textureKey = Utils.CalculateMD5Hash(AssetDatabase.GetAssetPath(opt.MainTexture));    //TODO ADD OFFSET + SCALE, but thinkg same texture, diff tiles on any of the materials, what would happen...
            }
            return(textureKey);
        }
Exemplo n.º 2
0
        //gets a concatenated string of paths of the different textures the object has.
        //TODO ADD OFFSET + SCALE, but thinkg same texture, diff tiles on any of the materials, what would happen...
        private string GetUniqueIdentifier(OptimizableObject opt)
        {
            string           uniqueStringID = "";
            List <Texture2D> objTextures    = ShaderManager.Instance.GetTexturesForObject(opt.ObjectMaterial, opt.ShaderName);

            for (int i = 0; i < objTextures.Count; i++)
            {
                if (objTextures[i] != null)
                {
                    uniqueStringID += AssetDatabase.GetAssetPath(objTextures[i]);
                }
            }
            if (uniqueStringID == "")
            {
                uniqueStringID = opt.GetColor().ToString();
            }
            return(uniqueStringID);
        }