public static void Postfix(PawnGraphicSet __instance, ref bool stump, ref Material __result)
        {
            Pawn pawn = __instance.pawn;

            if (pawn == null || !pawn.RaceProps.Humanlike)
            {
                return;
            }
            if (pawn.apparel.AnyApparel)
            {
                if (pawn.apparel.WornApparel.Any(x => x.def.HasComp(typeof(CompApparelExtraPartDrawer))))
                {
                    foreach (var item in pawn.apparel.WornApparel)
                    {
                        if (item.def.HasComp(typeof(CompApparelExtraPartDrawer)))
                        {
                            CompApparelExtraPartDrawer extraDrawer = item.TryGetCompFast <CompApparelExtraPartDrawer>();
                            if (extraDrawer != null && extraDrawer.hidesHead)
                            {
                                __result.SetTexture(AMConstants.InvisibleGraphics(pawn).headGraphic.MatSingle.name, AMConstants.InvisibleGraphics(pawn).headGraphic.MatSingle.mainTexture);
                                __result.shader = ShaderDatabase.Cutout;
                                return;
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        public static void Postfix(PawnGraphicSet __instance, ref List <Material> __result)
        {
            Pawn pawn = __instance.pawn;

            if (pawn == null || !pawn.RaceProps.Humanlike)
            {
                return;
            }
            if (pawn.apparel.AnyApparel)
            {
                if (pawn.apparel.WornApparel.Any(x => x.def.HasComp(typeof(CompApparelExtraPartDrawer))))
                {
                    foreach (var item in pawn.apparel.WornApparel)
                    {
                        if (item.def.HasComp(typeof(CompApparelExtraPartDrawer)))
                        {
                            CompApparelExtraPartDrawer extraDrawer = item.TryGetCompFast <CompApparelExtraPartDrawer>();
                            if (extraDrawer != null && extraDrawer.hidesBody)
                            {
                                for (int i = 0; i < __result.Count; i++)
                                {
                                    __result[i] = AMConstants.InvisibleGraphics(pawn).nakedGraphic.MatSingle;
                                }
                                return;
                            }
                        }
                    }
                }
            }
        }