コード例 #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;
        }
コード例 #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();
        }
コード例 #3
0
ファイル: MeshAttribute.cs プロジェクト: lwx1010/2D_XProject
 public MeshAttribute(ResoucresBean res) : base(res)
 {
 }
コード例 #4
0
 public ShaderAttribute(ResoucresBean res) : base(res)
 {
 }
コード例 #5
0
ファイル: ABaseResource.cs プロジェクト: lwx1010/2D_XProject
 public ABaseResource(ResoucresBean res)
 {
     this.mainAsset = res;
 }