public Graphic Graphic(Apparel thing)
 {
     if (thing.Wearer == null)
     {
         graphic = null;
     }
     else
     if (graphic == null)
     {
         graphic = graphicData.GraphicColoredFor(thing);
     }
     return(graphic);
 }
        public void ChangeGraphic()
        {
            if (!this.currentColor.texPath.NullOrEmpty())
            {
                var graphicData = new GraphicData();
                graphicData.graphicClass = this.parent.def.graphicData.graphicClass;
                graphicData.texPath      = this.currentColor.texPath;
                graphicData.shaderType   = this.parent.def.graphicData.shaderType;
                graphicData.drawSize     = this.parent.def.graphicData.drawSize;
                graphicData.color        = this.parent.def.graphicData.color;
                graphicData.colorTwo     = this.parent.def.graphicData.colorTwo;

                var newGraphic = graphicData.GraphicColoredFor(this.parent);
                Traverse.Create(this.parent).Field("graphicInt").SetValue(newGraphic);
                base.parent.Map.mapDrawer.MapMeshDirty(this.parent.Position, MapMeshFlag.Things);
            }
        }
        public void Glow(Thing glower, Quaternion ExactRotation)
        {
            if (glowGrahphicData == null)
            {
                Material material = GlowMoteDef.graphic.MatSingle;
                if (useGraphicColor)
                {
                    material.color = glower.DrawColor;
                }
                else
                if (useGraphicColorTwo)
                {
                    material.color = glower.DrawColorTwo;
                }

                Mesh mesh2 = MeshPool.GridPlane(GlowMoteDef.graphicData.drawSize * GlowMoteSize);
                Graphics.DrawMesh(mesh2, glower.DrawPos, ExactRotation, material, 0);
            }
            else
            {
                if (_glowGrahphic == null)
                {
                    _glowGrahphic = glowGrahphicData.GraphicColoredFor(glower);
                }
                if (useGraphicColor)
                {
                    _glowGrahphic.color = glower.DrawColor;
                }
                else
                if (useGraphicColorTwo)
                {
                    _glowGrahphic.color = glower.DrawColorTwo;
                }

                Mesh mesh2 = MeshPool.GridPlane(glower.Graphic.drawSize * glowGrahphicData.drawSize);
                Graphics.DrawMesh(mesh2, glower.DrawPos, ExactRotation, _glowGrahphic.MatSingle, 0);
            }
        }
        // Token: 0x0600000E RID: 14 RVA: 0x000027F8 File Offset: 0x000009F8
        public static void get_Graphic_PostFix(Thing __instance, ref Graphic __result)
        {
            Graphic value = Traverse.Create(__instance).Field("graphicInt").GetValue <Graphic>();
            bool    flag  = value != null;

            if (flag)
            {
                ThingWithComps thingWithComps = __instance as ThingWithComps;
                bool           flag2          = thingWithComps != null;
                if (flag2)
                {
                    bool flag3 = thingWithComps.ParentHolder is Pawn;
                    if (!flag3)
                    {
                        ThingComp thingComp = thingWithComps.AllComps.FirstOrDefault((ThingComp y) => y.GetType().ToString().Contains("ActivatableEffect"));
                        bool      flag4     = thingComp != null;
                        if (flag4)
                        {
                            Pawn value2 = Traverse.Create(thingComp).Property("GetPawn", null).GetValue <Pawn>();
                            bool flag5  = value2 != null;
                            if (flag5)
                            {
                                return;
                            }
                        }
                        CompOversizedWeapon compOversizedWeapon = thingWithComps.TryGetComp <CompOversizedWeapon>();
                        bool flag6 = compOversizedWeapon != null;
                        if (flag6)
                        {
                            CompProperties_OversizedWeapon props = compOversizedWeapon.Props;
                            bool flag7 = ((props != null) ? props.groundGraphic : null) == null;
                            if (flag7)
                            {
                                value.drawSize = __instance.def.graphicData.drawSize;
                                __result       = value;
                            }
                            else
                            {
                                bool isEquipped = compOversizedWeapon.IsEquipped;
                                if (isEquipped)
                                {
                                    value.drawSize = __instance.def.graphicData.drawSize;
                                    __result       = value;
                                }
                                else
                                {
                                    CompProperties_OversizedWeapon props2 = compOversizedWeapon.Props;
                                    Graphic graphic;
                                    if (props2 == null)
                                    {
                                        graphic = null;
                                    }
                                    else
                                    {
                                        GraphicData groundGraphic = props2.groundGraphic;
                                        graphic = ((groundGraphic != null) ? groundGraphic.GraphicColoredFor(__instance) : null);
                                    }
                                    Graphic graphic2 = graphic;
                                    bool    flag8    = graphic2 != null;
                                    if (flag8)
                                    {
                                        graphic2.drawSize = compOversizedWeapon.Props.groundGraphic.drawSize;
                                        __result          = graphic2;
                                    }
                                    else
                                    {
                                        value.drawSize = __instance.def.graphicData.drawSize;
                                        __result       = value;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }