public static void HairMatAt(PawnGraphicSet __instance, Rot4 facing, ref Material __result) { Pawn pawn = __instance.pawn; PawnGraphicSet graphics = new PawnGraphicSet_Invisible(pawn) { nakedGraphic = new Graphic_Invisible(), rottingGraphic = null, packGraphic = null, headGraphic = new Graphic_Invisible(), desiccatedHeadGraphic = null, skullGraphic = null, headStumpGraphic = null, desiccatedHeadStumpGraphic = null, hairGraphic = new Graphic_Invisible() }; if (pawn.IsInvisible() && pawn.RaceProps.Humanlike) { if (pawn.CarriedBy != null) { if (pawn.CarriedBy.isXenomorph()) { __result.SetTexture(graphics.hairGraphic.MatSingle.name, graphics.hairGraphic.MatSingle.mainTexture); __result.shader = ShaderDatabase.Cutout; return; } } } }
public static void OverrideMaterialIfNeeded(PawnRenderer __instance, Material original, Pawn pawn, ref Material __result) { PawnGraphicSet graphics = new PawnGraphicSet_Invisible(pawn) { nakedGraphic = new Graphic_Invisible(), rottingGraphic = null, packGraphic = null, headGraphic = null, desiccatedHeadGraphic = null, skullGraphic = null, headStumpGraphic = null, desiccatedHeadStumpGraphic = null, hairGraphic = null }; if (pawn.IsInvisible()) { if (pawn.CarriedBy != null) { if (pawn.CarriedBy.isXenomorph()) { __result.SetTexture(graphics.nakedGraphic.MatSingle.name, graphics.nakedGraphic.MatSingle.mainTexture); __result.shader = ShaderDatabase.Cutout; return; } } else if (pawn.Faction == Faction.OfPlayer) { __result.SetTexture(AvP_PawnRenderer_OverrideMaterialIfNeeded_Xenomorph_Patch.NoiseTex, TexGame.RippleTex); __result.color = AvP_PawnRenderer_OverrideMaterialIfNeeded_Xenomorph_Patch.xenomorphColor; } else { if (pawn.isXenomorph()) { __result.SetTexture(graphics.nakedGraphic.MatSingle.name, graphics.nakedGraphic.MatSingle.mainTexture); __result.shader = ShaderDatabase.Cutout; } /* * if (pawn.isCloaked()) * { * __result.SetTexture(graphics.nakedGraphic.MatSingle.name, graphics.nakedGraphic.MatSingle.mainTexture); * __result.shader = ShaderDatabase.Cutout; * } */ } } }