コード例 #1
0
        public void DebugDrawMouseover()
        {
            int num = Mathf.RoundToInt((float)(Time.realtimeSinceStartup * 2.0)) % 2;

            if (DebugViewSettings.drawRegions)
            {
                Color color = this.valid ? ((!this.DebugIsNew) ? Color.green : Color.yellow) : Color.red;
                GenDraw.DrawFieldEdges(this.Cells.ToList(), color);
                foreach (Region neighbor in this.Neighbors)
                {
                    GenDraw.DrawFieldEdges(neighbor.Cells.ToList(), Color.grey);
                }
            }
            if (DebugViewSettings.drawRegionLinks)
            {
                foreach (RegionLink link in this.links)
                {
                    if (num == 1)
                    {
                        foreach (IntVec3 cell in link.span.Cells)
                        {
                            CellRenderer.RenderCell(cell, DebugSolidColorMats.MaterialOf(Color.magenta));
                        }
                    }
                }
            }
            if (DebugViewSettings.drawRegionThings)
            {
                foreach (Thing allThing in this.listerThings.AllThings)
                {
                    CellRenderer.RenderSpot(allThing.TrueCenter(), (float)((float)(allThing.thingIDNumber % 256) / 256.0));
                }
            }
        }
コード例 #2
0
        public void DebugDrawMouseover()
        {
            int num = Mathf.RoundToInt(Time.realtimeSinceStartup * 2f) % 2;

            if (DebugViewSettings.drawRegions)
            {
                GenDraw.DrawFieldEdges(color: (!valid) ? Color.red : ((!DebugIsNew) ? Color.green : Color.yellow), cells: Cells.ToList());
                foreach (Region neighbor in Neighbors)
                {
                    GenDraw.DrawFieldEdges(neighbor.Cells.ToList(), Color.grey);
                }
            }
            if (DebugViewSettings.drawRegionLinks)
            {
                foreach (RegionLink link in links)
                {
                    if (num != 1)
                    {
                        continue;
                    }
                    foreach (IntVec3 cell in link.span.Cells)
                    {
                        CellRenderer.RenderCell(cell, DebugSolidColorMats.MaterialOf(Color.magenta));
                    }
                }
            }
            if (!DebugViewSettings.drawRegionThings)
            {
                return;
            }
            foreach (Thing allThing in listerThings.AllThings)
            {
                CellRenderer.RenderSpot(allThing.TrueCenter(), (float)(allThing.thingIDNumber % 256) / 256f);
            }
        }
コード例 #3
0
 public static void DebugDraw()
 {
     if (Prefs.DevMode && DebugViewSettings.drawDamageRects && Find.CurrentMap != null)
     {
         Building building = Find.Selector.FirstSelectedObject as Building;
         if (building != null)
         {
             Material material   = DebugSolidColorMats.MaterialOf(Color.red);
             Rect     damageRect = GetDamageRect(building);
             float    y          = 14.99f;
             Vector3  pos        = new Vector3(damageRect.x + damageRect.width / 2f, y, damageRect.y + damageRect.height / 2f);
             Vector3  s          = new Vector3(damageRect.width, 1f, damageRect.height);
             Graphics.DrawMesh(MeshPool.plane10, Matrix4x4.TRS(pos, Quaternion.identity, s), material, 0);
         }
     }
 }
コード例 #4
0
        public void DebugDrawMouseover()
        {
            int num = Mathf.RoundToInt(Time.realtimeSinceStartup * 2f) % 2;

            if (DebugViewSettings.drawRegions)
            {
                Color color;
                if (!this.valid)
                {
                    color = Color.red;
                }
                else if (this.DebugIsNew)
                {
                    color = Color.yellow;
                }
                else
                {
                    color = Color.green;
                }
                GenDraw.DrawFieldEdges(this.Cells.ToList <IntVec3>(), color);
                foreach (Region current in this.Neighbors)
                {
                    GenDraw.DrawFieldEdges(current.Cells.ToList <IntVec3>(), Color.grey);
                }
            }
            if (DebugViewSettings.drawRegionLinks)
            {
                foreach (RegionLink current2 in this.links)
                {
                    if (num == 1)
                    {
                        foreach (IntVec3 current3 in current2.span.Cells)
                        {
                            CellRenderer.RenderCell(current3, DebugSolidColorMats.MaterialOf(Color.magenta));
                        }
                    }
                }
            }
            if (DebugViewSettings.drawRegionThings)
            {
                foreach (Thing current4 in this.listerThings.AllThings)
                {
                    CellRenderer.RenderSpot(current4.TrueCenter(), (float)(current4.thingIDNumber % 256) / 256f);
                }
            }
        }