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; }
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(); }
public MeshAttribute(ResoucresBean res) : base(res) { }
public ShaderAttribute(ResoucresBean res) : base(res) { }
public ABaseResource(ResoucresBean res) { this.mainAsset = res; }