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

            if (pawn.IsInvisible() && pawn.RaceProps.Humanlike)
            {
                if (pawn.CarriedBy != null)
                {
                    if (pawn.CarriedBy.isCloaked())
                    {
                        __result.SetTexture(AvPConstants.Invisiblegraphics(pawn).hairGraphic.MatSingle.name, AvPConstants.Invisiblegraphics(pawn).hairGraphic.MatSingle.mainTexture);
                        __result.shader = ShaderDatabase.Cutout;
                        return;
                    }
                }
                else
                {
                    if (pawn.isCloaked())
                    {
                        if (pawn.Faction == Faction.OfPlayer)
                        {
                            __result.SetTexture(AvPConstants.CloakNoiseTex, TexGame.RippleTex);
                            __result.color = AvPConstants.YautjaCloakColor;
                        }
                        else
                        {
                            __result.SetTexture(AvPConstants.Invisiblegraphics(pawn).headGraphic.MatSingle.name, AvPConstants.Invisiblegraphics(pawn).headGraphic.MatSingle.mainTexture);
                            __result.shader = ShaderDatabase.Cutout;
                        }
                        return;
                    }
                }
            }
        }
Esempio n. 2
0
 public static void Postfix(PawnRenderer __instance, Material original, Pawn pawn, ref Material __result)
 {
     if (pawn.IsInvisible())
     {
         if (pawn.CarriedBy != null)
         {
             if (pawn.CarriedBy.isXenomorph())
             {
                 __result.SetTexture(AvPConstants.Invisiblegraphics(pawn).nakedGraphic.MatSingle.name, AvPConstants.Invisiblegraphics(pawn).nakedGraphic.MatSingle.mainTexture);
                 __result.shader = ShaderDatabase.Cutout;
                 return;
             }
             if (pawn.CarriedBy.isCloaked())
             {
                 if (pawn.CarriedBy.Faction == Faction.OfPlayer)
                 {
                     __result.SetTexture(AvPConstants.CloakNoiseTex, TexGame.RippleTex);
                     __result.color = AvPConstants.YautjaCloakColor;
                 }
                 else
                 {
                     __result.SetTexture(AvPConstants.Invisiblegraphics(pawn).headGraphic.MatSingle.name, AvPConstants.Invisiblegraphics(pawn).headGraphic.MatSingle.mainTexture);
                     __result.shader = ShaderDatabase.Cutout;
                 }
                 return;
             }
         }
         else
         {
             if (pawn.isXenomorph())
             {
                 __result.SetTexture(AvPConstants.Invisiblegraphics(pawn).nakedGraphic.MatSingle.name, AvPConstants.Invisiblegraphics(pawn).nakedGraphic.MatSingle.mainTexture);
                 __result.shader = ShaderDatabase.Cutout;
             }
             if (pawn.isCloaked())
             {
                 if (pawn.Faction == Faction.OfPlayer)
                 {
                     __result.SetTexture(AvPConstants.CloakNoiseTex, TexGame.RippleTex);
                     __result.color = AvPConstants.YautjaCloakColor;
                 }
                 else
                 {
                     __result.SetTexture(AvPConstants.Invisiblegraphics(pawn).headGraphic.MatSingle.name, AvPConstants.Invisiblegraphics(pawn).headGraphic.MatSingle.mainTexture);
                     __result.shader = ShaderDatabase.Cutout;
                 }
                 return;
             }
         }
     }
 }