Example #1
0
 private void HandleRegisryURP(UnityEditor.PackageManager.PackageInfo package)
 {
     if (GUILayout.Button("Apply Grass Shaders to URP"))
     {
         string targetPath = "Packages/" + Path.GetFileName(package.resolvedPath);
         AssetsManager.CopyDirectory(package.resolvedPath, targetPath);
         string destFilePath = targetPath + "/Shaders/Terrain/WavingGrassPasses.hlsl";
         CopyUrpTemplatFile(destFilePath);
         AssetDatabase.Refresh();
     }
 }
Example #2
0
 private void HandleEmbeddedURP(UnityEditor.PackageManager.PackageInfo package)
 {
     EditorGUILayout.LabelField("URP Grass is applied.");
     if (GUILayout.Button("Reapply Grass Shaders to URP"))
     {
         string destFilePath = package.resolvedPath + "/Shaders/Terrain/WavingGrassPasses.hlsl";
         CopyUrpTemplatFile(destFilePath);
         AssetDatabase.Refresh();
     }
     if (GUILayout.Button("Reset URP"))
     {
         string targetPath = "Library/PackageCache/" + Path.GetFileName(package.resolvedPath);
         AssetsManager.CopyDirectory(package.resolvedPath, targetPath);
         Directory.Delete(package.resolvedPath, true);
         AssetDatabase.Refresh();
     }
 }