PostProcessShaderIncludePath.cs(10,10): error CS0619: 'ShaderIncludePathAttribute' is obsolete: '[ShaderIncludePath] attribute is no longer supported. Your shader library must be under the Assets folder or in a package. To include shader headers directly from a package, use #include "Packages/<package name>/<path to your header file>"'

PostProcessShaderIncludePath.cs(10,10): error CS0619: 'ShaderIncludePathAttribute' is obsolete: '[ShaderIncludePath] attribute is no longer supported. Your shader library must be under the Assets folder or in a package. To include shader headers directly from a package, use #include "Packages//"'


 Solusi error pada assets unity "NatureManufacture Assets".

Debug :
 
PostProcessShaderIncludePath.cs(10,10): error CS0619: 'ShaderIncludePathAttribute' is obsolete: '[ShaderIncludePath] attribute is no longer supported. Your shader library must be under the Assets folder or in a package. To include shader headers directly from a package, use #include "Packages/<package name>/<path to your header file>"

Nah dalam scriptnya seperti di bawah :

PostProcessShaderIncludePath.cs
using System.Linq;
using UnityEngine;
using System.IO;

namespace UnityEditor.Experimental.Rendering
{
    static class PostProcessShaderIncludePath
    {
#if UNITY_2018_1_OR_NEWER
        [ShaderIncludePath]
#endif
        public static string[] GetPaths()
        {
            var srpMarker = Directory.GetFiles(Application.dataPath, "POSTFXMARKER", SearchOption.AllDirectories).FirstOrDefault();
            var paths = new string[srpMarker == null ? 1 : 2];
            var index = 0;
            if (srpMarker != null)
            {
                paths[index] = Directory.GetParent(srpMarker).ToString();
                index++;
            }
            paths[index] = Path.GetFullPath("Packages/com.unity.postprocessing");
            return paths;
        }
    }
}


Solusi
 
Jika kalian mengalami error pada script ini dan tidak bisa play maka cukup ikuti seperti pada gambar di bawah ini :


Tidak ada komentar:

Posting Komentar