Esempio n. 1
0
        public TextureAttribute(ResoucresBean res) : base(res)
        {
            TextureImporter textImporter = AssetImporter.GetAtPath(res.AssetPath) as TextureImporter;

            Texture2D tex = res.mainObjs[0] as Texture2D;

            this.Width      = tex.width;
            this.Height     = tex.height;
            this.MemorySize = getTextureMemorySize(textImporter, tex);
//            GameObject.DestroyImmediate(tex);

            this.Format = textImporter.textureFormat.ToString();
            this.MipMap = textImporter.mipmapEnabled;
            this.RW     = textImporter.isReadable;
        }
Esempio n. 2
0
        public MaterialAttribute(ResoucresBean res) : base(res)
        {
            Object[] depObjArr = EditorUtility.CollectDependencies(res.mainObjs);

            List <string> depTexs = new List <string>();

            foreach (Object obj in depObjArr)
            {
                string assetPath = AssetDatabase.GetAssetPath(obj);

                if (obj is Texture2D)
                {
                    depTexs.Add(Path.GetFileName(assetPath));
                }
                if (assetPath.EndsWith(".shader"))
                {
                    Shader = Path.GetFileName(assetPath);
                }
            }
            TextureNames = depTexs.ToArray();
        }
Esempio n. 3
0
 public MeshAttribute(ResoucresBean res) : base(res)
 {
 }
Esempio n. 4
0
 public ShaderAttribute(ResoucresBean res) : base(res)
 {
 }
Esempio n. 5
0
 public ABaseResource(ResoucresBean res)
 {
     this.mainAsset = res;
 }