public void SaveMaterial(PbrMaterial vpxMaterial, Material material)
        {
            _materials[vpxMaterial.Id] = material;
            var path = vpxMaterial.GetUnityFilename(_assetsMaterials);

            if (_options.SkipExistingMaterials && File.Exists(path))
            {
                return;
            }
            AssetDatabase.CreateAsset(material, path);
        }
        public Material GetMaterial(PbrMaterial material)
        {
            if (_materials.ContainsKey(material.Id))
            {
                return(_materials[material.Id]);
            }
            var path = material.GetUnityFilename(_assetsMaterials);

            if (File.Exists(path))
            {
                _materials[material.Id] = AssetDatabase.LoadAssetAtPath <Material>(path);
                return(_materials[material.Id]);
            }
            return(null);
        }
Exemplo n.º 3
0
        public void SaveMaterial(PbrMaterial material, Material unityMaterial)
        {
            var path = material.GetUnityFilename(_materialFolder);

            AssetDatabase.CreateAsset(unityMaterial, path);
        }
Exemplo n.º 4
0
 public Material LoadMaterial(PbrMaterial material)
 {
     return(AssetDatabase.LoadAssetAtPath <Material>(material.GetUnityFilename(_materialFolder)));
 }