Exemplo n.º 1
0
 public static void DrawInteractionCell(ThingDef tDef, IntVec3 center, Rot4 placingRot)
 {
     if (tDef.hasInteractionCell)
     {
         IntVec3 c      = ThingUtility.InteractionCellWhenAt(tDef, center, placingRot, Find.CurrentMap);
         Vector3 vector = c.ToVector3ShiftedWithAltitude(AltitudeLayer.MetaOverlays);
         if (c.InBounds(Find.CurrentMap))
         {
             Building edifice = c.GetEdifice(Find.CurrentMap);
             if (edifice != null && edifice.def.building != null && edifice.def.building.isSittable)
             {
                 return;
             }
         }
         if (tDef.interactionCellGraphic == null && tDef.interactionCellIcon != null)
         {
             ThingDef thingDef = tDef.interactionCellIcon;
             if (thingDef.blueprintDef != null)
             {
                 thingDef = thingDef.blueprintDef;
             }
             tDef.interactionCellGraphic = thingDef.graphic.GetColoredVersion(ShaderTypeDefOf.EdgeDetect.Shader, InteractionCellIntensity, Color.white);
         }
         if (tDef.interactionCellGraphic != null)
         {
             Rot4 rot = (!tDef.interactionCellIconReverse) ? placingRot : placingRot.Opposite;
             tDef.interactionCellGraphic.DrawFromDef(vector, rot, tDef.interactionCellIcon);
         }
         else
         {
             Graphics.DrawMesh(MeshPool.plane10, vector, Quaternion.identity, InteractionCellMaterial, 0);
         }
     }
 }
Exemplo n.º 2
0
 public static void DrawInteractionCell(ThingDef tDef, IntVec3 center, Rot4 placingRot)
 {
     if (tDef.hasInteractionCell)
     {
         Vector3 position = ThingUtility.InteractionCellWhenAt(tDef, center, placingRot, Find.VisibleMap).ToVector3ShiftedWithAltitude(AltitudeLayer.MetaOverlays);
         Graphics.DrawMesh(MeshPool.plane10, position, Quaternion.identity, GenDraw.InteractionCellMaterial, 0);
     }
 }