private static void PostProcess(ModComponent modComponent) { modComponent.gameObject.layer = vp_Layer.Gear; GearItem gearItem = modComponent.GetComponent <GearItem>(); gearItem.m_SkinnedMeshRenderers = ModUtils.NotNull(gearItem.m_SkinnedMeshRenderers); GameObject template = Resources.Load <GameObject>("GEAR_CoffeeCup"); MeshRenderer meshRenderer = template.GetComponentInChildren <MeshRenderer>(); foreach (var eachMeshRenderer in gearItem.m_MeshRenderers) { foreach (var eachMaterial in eachMeshRenderer.materials) { if (eachMaterial.shader.name == "Standard") { Debug.Log("Updating shader of " + modComponent.name); eachMaterial.shader = meshRenderer.material.shader; eachMaterial.shaderKeywords = meshRenderer.material.shaderKeywords; } } } ModUtils.RegisterConsoleGearName(modComponent.GetEffectiveConsoleName(), modComponent.name); if (modComponent.Radial != Radial.None) { RadialConfigurator.RegisterGear(modComponent.Radial, modComponent.name); } UnityEngine.Object.DontDestroyOnLoad(modComponent.gameObject); }
public static void Postfix(Panel_ActionsRadial __instance) { RadialConfigurator.InsertAllGears(); }