Example #1
0
        public List <Material> MatsBodyBaseAt(Rot4 facing, RotDrawMode bodyCondition = RotDrawMode.Fresh)
        {
            int num = facing.AsInt + 1000 * (int)bodyCondition;

            if (num != cachedMatsBodyBaseHash)
            {
                cachedMatsBodyBase.Clear();
                cachedMatsBodyBaseHash = num;
                if (bodyCondition == RotDrawMode.Fresh)
                {
                    cachedMatsBodyBase.Add(nakedGraphic.MatAt(facing));
                }
                else if (bodyCondition == RotDrawMode.Rotting || dessicatedGraphic == null)
                {
                    cachedMatsBodyBase.Add(rottingGraphic.MatAt(facing));
                }
                else if (bodyCondition == RotDrawMode.Dessicated)
                {
                    cachedMatsBodyBase.Add(dessicatedGraphic.MatAt(facing));
                }
                for (int i = 0; i < apparelGraphics.Count; i++)
                {
                    if ((apparelGraphics[i].sourceApparel.def.apparel.shellRenderedBehindHead || apparelGraphics[i].sourceApparel.def.apparel.LastLayer != ApparelLayerDefOf.Shell) && !PawnRenderer.RenderAsPack(apparelGraphics[i].sourceApparel) && apparelGraphics[i].sourceApparel.def.apparel.LastLayer != ApparelLayerDefOf.Overhead)
                    {
                        cachedMatsBodyBase.Add(apparelGraphics[i].graphic.MatAt(facing));
                    }
                }
            }
            return(cachedMatsBodyBase);
        }