2020-06-02 20:46:16 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace ConformalDecals {
|
2020-06-06 04:29:57 +00:00
|
|
|
public static class DecalConfig {
|
2020-06-02 20:46:16 +00:00
|
|
|
private static List<string> _shaderBlacklist;
|
|
|
|
|
|
|
|
public static bool IsBlacklisted(Shader shader) {
|
|
|
|
return IsBlacklisted(shader.name);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static bool IsBlacklisted(string shaderName) {
|
|
|
|
return _shaderBlacklist.Contains(shaderName);
|
|
|
|
}
|
|
|
|
|
2020-06-03 00:14:52 +00:00
|
|
|
private static void ParseConfig(ConfigNode node) {
|
2020-06-02 20:46:16 +00:00
|
|
|
foreach (var blacklist in node.GetNodes("SHADERBLACKLIST")) {
|
|
|
|
foreach (var shaderName in blacklist.GetValuesList("shader")) {
|
|
|
|
_shaderBlacklist.Add(shaderName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-03 00:14:52 +00:00
|
|
|
public static void ModuleManagerPostLoad() {
|
2020-06-02 20:46:16 +00:00
|
|
|
_shaderBlacklist = new List<string>();
|
|
|
|
|
|
|
|
var configs = GameDatabase.Instance.GetConfigs("CONFORMALDECALS");
|
|
|
|
|
|
|
|
if (configs.Length > 0) {
|
2020-06-03 00:14:52 +00:00
|
|
|
Debug.Log("ConformalDecals: loading config");
|
2020-06-02 20:46:16 +00:00
|
|
|
foreach (var config in configs) {
|
|
|
|
ParseConfig(config.config);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|