mirror of
https://github.com/drewcassidy/KSP-Conformal-Decals.git
synced 2024-09-01 18:23:54 +00:00
drewcassidy
da1fbf0f2a
• KSP rescales the model object back to 1,1,1 on start, so don't use that for the model that gets scaled • Some refactoring to consolidate property IDs • rename some classes because I am indecisive • Add and Get methods for MaterialPropertyCollection • Make an attempt at a scale culling fix
37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace ConformalDecals {
|
|
public static class DecalConfig {
|
|
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);
|
|
}
|
|
|
|
private static void ParseConfig(ConfigNode node) {
|
|
foreach (var blacklist in node.GetNodes("SHADERBLACKLIST")) {
|
|
foreach (var shaderName in blacklist.GetValuesList("shader")) {
|
|
_shaderBlacklist.Add(shaderName);
|
|
}
|
|
}
|
|
}
|
|
|
|
public static void ModuleManagerPostLoad() {
|
|
_shaderBlacklist = new List<string>();
|
|
|
|
var configs = GameDatabase.Instance.GetConfigs("CONFORMALDECALS");
|
|
|
|
if (configs.Length > 0) {
|
|
Debug.Log("ConformalDecals: loading config");
|
|
foreach (var config in configs) {
|
|
ParseConfig(config.config);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |