[Add] All in one shader

This commit is contained in:
2026-02-23 22:01:07 +07:00
parent ec0aa86ac2
commit 4f942cd7c0
806 changed files with 401510 additions and 33 deletions
@@ -0,0 +1,45 @@
using System.IO;
using UnityEditor;
using UnityEngine;
namespace AllIn13DShader
{
public static class URPSettingsController
{
public static void DisableFeature(string featureToDisable)
{
// Find the shader features file
string[] guids = AssetDatabase.FindAssets("AllIn13DShader_FeaturesURP_Defines");
if (guids.Length == 0)
{
Debug.LogWarning("AllIn13DShader_FeaturesURP file not found");
return;
}
string shaderFeaturesFilePath = AssetDatabase.GUIDToAssetPath(guids[0]);
if (string.IsNullOrEmpty(shaderFeaturesFilePath))
{
Debug.LogWarning("Could not get path for AllIn13DShader_FeaturesURP file");
return;
}
// Read the file content
string fileContent = File.ReadAllText(shaderFeaturesFilePath);
string[] lines = fileContent.Split("\n");
string correctedFile = string.Empty;
for (int i = 0; i < lines.Length; i++)
{
string line = lines[i];
if (line.StartsWith($"#define {featureToDisable}"))
{
line = "//" + line;
}
correctedFile += line;
}
File.WriteAllText(shaderFeaturesFilePath, correctedFile);
}
}
}