mirror of
https://github.com/drewcassidy/KSP-Conformal-Decals.git
synced 2024-09-01 18:23:54 +00:00
Fix scaling issues when part is created
• 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
This commit is contained in:
37
Source/ConformalDecals/DecalConfig.cs
Normal file
37
Source/ConformalDecals/DecalConfig.cs
Normal file
@ -0,0 +1,37 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user