Esempio n. 1
0
        public override HashSet <string> Process(string entryPath, GameObject go, StrategyNode node)
        {
            HashSet <string> result = new HashSet <string>();
            Image            image  = go.GetComponent <Image>();

            if (image != null && image.material != null)
            {
                string materialPath = MaterialAssetProcessor.GetMaterialPath(image.material);
                if (node.pattern.IsMatch(materialPath))
                {
                    result.Add(materialPath);
                    image.materialKey = AssetPathHelper.GetObjectKey(entryPath, materialPath, image.material, node);
                    image.material    = null;
                    image.spriteKey   = AssetPathHelper.GetObjectKey(entryPath, materialPath, image.sprite, node);
                    image.sprite      = null;
                }
            }
            return(result);
        }
Esempio n. 2
0
        public HashSet <string> Process(string entryPath, Material material, StrategyNode node)
        {
            HashSet <string> result = new HashSet <string>();

            if (material == null)
            {
                Debug.LogError("资源打包出错, 缺少Material:" + entryPath);
            }
            string materialPath = MaterialAssetProcessor.GetMaterialPath(material);
            string shaderPath   = MaterialAssetProcessor.GetShaderPath(material.shader);

            if (node.pattern.IsMatch(shaderPath))
            {
                MaterialJsonData jsonData = MaterialJsonData.GetMaterialJsonData(materialPath);
                jsonData.shaderFileName = GetShaderFileName(material.shader);
                jsonData.shaderKey      = AssetPathHelper.GetObjectKey(entryPath, shaderPath, material.shader, node);
                jsonData.FillNoTexturePropertyData(material, node);
                result.Add(shaderPath);
            }
            return(result);
        }