public static void Postfix(Thing parent, ref Material __result)
        {
            CompPower comp = parent.TryGetComp <CompPower>();

            if (comp != null)
            {
                __result = new PowerMaterial(__result, comp);
            }
        }
Example #2
0
 public static void RegenerateColors(Section sect, SectionLayer layer)
 {
     foreach (LayerSubMesh lsm in layer.subMeshes)
     {
         PowerMaterial mat = lsm.material as PowerMaterial;
         if (mat != null && mat.comp.PowerNet != null)
         {
             Color color = GetNetColor(mat.comp);
             mat.color = color;
         }
     }
 }