<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Chris</title>
    <description>The latest articles on DEV Community by Chris (@nightsmore).</description>
    <link>https://dev.to/nightsmore</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F488852%2F2d35e765-e81c-446b-88e3-25d474e64e8d.png</url>
      <title>DEV Community: Chris</title>
      <link>https://dev.to/nightsmore</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nightsmore"/>
    <language>en</language>
    <item>
      <title>UdonSharp - Easy Script for Time Based Operations</title>
      <dc:creator>Chris</dc:creator>
      <pubDate>Fri, 23 Jun 2023 07:05:39 +0000</pubDate>
      <link>https://dev.to/nightsmore/udonsharp-easy-script-for-time-based-operations-3f14</link>
      <guid>https://dev.to/nightsmore/udonsharp-easy-script-for-time-based-operations-3f14</guid>
      <description>&lt;ul&gt;
&lt;li&gt;script&lt;/li&gt;
&lt;li&gt;example&lt;/li&gt;
&lt;li&gt;description&lt;/li&gt;
&lt;/ul&gt;




&lt;h3 id="script"&gt;script&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

using UdonSharp;
using UnityEngine;

public class TestTimer : UdonSharpBehaviour
{
    // In this example I just have this hooked up to a light source to make it a slow blinking light
    [SerializeField] private GameObject _lightBulb;

    // A float to enter the desired time
    [SerializeField] private float _delayInSeconds = 10.0f; 

    // I serialized this one just so I can watch it in the editor
    [SerializeField] private float _elapsedTime = 0.0f; 


    private void Update()
    {
        // Time.deltaTime is just x seconds from previous frame
        // so we increment the elapsed timer until it's equal to or passed the desired time
        _elapsedTime += Time.deltaTime; 

        if(_elapsedTime &amp;gt;= _delayInSeconds)
        {
            // Perform whatever operation you want here
            _lightBulb.SetActive(!_lightBulb.activeSelf); 

            // Reset timer and start over
            _elapsedTime = 0.0f; 
        }
    }
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;h3 id="example"&gt;here it is in action&lt;/h3&gt; 

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7npg0a2yip9wr6g39stm.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7npg0a2yip9wr6g39stm.gif" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3 id="description"&gt; description &lt;/h3&gt;

&lt;p&gt;As you may know, &lt;a href="https://github.com/vrchat-community/UdonSharp/tree/master" rel="noopener noreferrer"&gt;UdonSharp&lt;/a&gt; is a programming language built for VRChat that has basic C#/Unity library support, unfortunately there's a lot more of those libraries that &lt;em&gt;aren't&lt;/em&gt; available.&lt;/p&gt;

&lt;p&gt;When I did a quick search, all the suggested methods for doing timer based events appeared a little more complex to follow then seemed necessary, which is why I wanted to post this simple script in case anyone is just looking for something easy. &lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>udonsharp</category>
      <category>tutorial</category>
      <category>gamedev</category>
      <category>unity3d</category>
    </item>
    <item>
      <title>Procedural Structures in Unity</title>
      <dc:creator>Chris</dc:creator>
      <pubDate>Wed, 21 Jun 2023 00:21:09 +0000</pubDate>
      <link>https://dev.to/nightsmore/procedural-structures-in-unity-3be4</link>
      <guid>https://dev.to/nightsmore/procedural-structures-in-unity-3be4</guid>
      <description>&lt;ul&gt;
&lt;li&gt;1. Reinvent the wheel, I created some basic 2D grids&lt;/li&gt;
&lt;li&gt;2. What are walls? ...and floors... and corners&lt;/li&gt;
&lt;/ul&gt;



&lt;h2&gt;
  
  
  Description
&lt;/h2&gt;

&lt;p&gt;This article is mostly for my future reference and to keep track of my progress. &lt;em&gt;While&lt;/em&gt; it is mainly meant as a type of code-journey post, I did my best to also make it usable as a tutorial. Hope you enjoy and squeeze some useful information from here!&lt;/p&gt;

&lt;p&gt;-&lt;/p&gt;

&lt;p&gt;I've been working on a multiplayer project using Unity's new networking system, &lt;a href="https://docs-multiplayer.unity3d.com/netcode/current/about/" rel="noopener noreferrer"&gt;Netcode&lt;/a&gt;.  I've gotten to the point I to start working on the levels and objectives. :(&lt;/p&gt;

&lt;p&gt;My initial thought was, I want to generate some basic rooms because I suck at level design, and apparently doing about 500x the work making the computer create something for me, is somehow easier then just taking the time to build my own level.  &lt;/p&gt;




&lt;h2 id="section_one"&gt; 1. Creating a 2D Grid &lt;/h2&gt;

&lt;p&gt;First, I create an empty MonoBehaviour Script and name it "MapGenerator":&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MapGenerator : MonoBehaviour
{
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I then give it a few private variables, and give them the "SerializeField" header to customize the grid in the inspector:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    [SerializeField] private int _width = 7;
    [SerializeField] private int _height = 7;
    [SerializeField] private int _depth = 7;
    [SerializeField] private float _gridSpacing = 2.5f;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;_width&lt;/strong&gt; &amp;amp; &lt;strong&gt;_height&lt;/strong&gt; (and later &lt;strong&gt;_depth&lt;/strong&gt;) just give us the number of "chunks" in the grid, the _grideSpacing (as redundant as it might be to mention) is the distance between each chunk. &lt;/p&gt;

&lt;p&gt;I wanted to start with just using "OnDrawGizmosSelected" to make it easy to debug, so I also made a totally necessary function to turn these two lines into one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
private void DrawSphereAt(Vector3 position, Color sphereColor, float size = 1f)
{
     Gizmos.color = sphereColor;
     Gizmos.DrawSphere(position, size);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Completely from my own problem solving skills- and not the many hours of procedural generation video tutorials and articles I've watched or read in the past-&lt;br&gt;
I whip up this Generate2DGridGizmos function (ignore the variable name mixup):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
private void Generate2DGridGizmos(Vector3 start)
    {
        var tempPos = start;
        var gizmoColor = Color.yellow; 

        for (int i = 0; i &amp;lt; _width; i++)
        {
            // Draw row
            DrawSphereAt(tempPos, gizmoColor);

            // Draw col
            var rowPos = tempPos;
            for (int z = 0; z &amp;lt; _height; z++)
            {
                if (!(z == 0)) { DrawSphereAt(rowPos,gizmoColor); }
                var nZ = rowPos.z += _gridSpacing;
                rowPos = new Vector3(tempPos.x, tempPos.y, nZ);
            }

            // Continue iter
            var nX = tempPos.x += _gridSpacing;
            tempPos = new Vector3(nX, tempPos.y, tempPos.z);
        }

    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, just tossing a method call inside &lt;strong&gt;OnCallGizmosSelected()&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;void OnDrawGizmosSelected()
{        
    Generate2DGridGizmos(_startPos);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I can then attach the script in a scene object to get the results: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fenkzgt61yae1rbuwszf4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fenkzgt61yae1rbuwszf4.png" alt="Image description" width="800" height="355"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As fun as the gizmos are, I figured it's not very useful as is.&lt;br&gt;
So I go ahead and duplicate the &lt;strong&gt;Generate2DGridGizmos()&lt;/strong&gt; method and modify it so that it returns a Vector3 List of our grid.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    private List&amp;lt;Vector3&amp;gt; Generate2DGrid(Vector3 start, float spacing = 2.5f, int width = 10, int height = 10)
    {
        Vector3 tempPos = start;
        List&amp;lt;Vector3&amp;gt; coordList = new List&amp;lt;Vector3&amp;gt;();

        for (int i = 0; i &amp;lt; width; i++)
        {
            // Column
            coordList.Add(new Vector3(tempPos.x, tempPos.y, tempPos.z));

            // Row
            var rowPos = tempPos;
            for (int z = 0; z &amp;lt; height; z++)
            {
                if (!(z == 0))
                {
                    coordList.Add(new Vector3(rowPos.x, rowPos.y, rowPos.z));
                }
                var nZ = rowPos.z += spacing;
                rowPos = new Vector3(tempPos.x, tempPos.y, nZ);
            }

            // Continue it 
            var nX = tempPos.x += spacing;
            tempPos = new Vector3(nX, tempPos.y, tempPos.z);

        }

        return coordList;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I also create a new private variable to store these for the whole class: &lt;br&gt;
&lt;code&gt;[SerializeField] private List&amp;lt;Vector3&amp;gt; _coordinates;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This is then assigned in &lt;strong&gt;Start()&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
 private void Start()
    {
        _startPos = transform.position; // Set the starting position to the location of the gameobject
        if (!_parent) _parent = gameObject.transform; // Keep the scene tidy 
        _coordinates = Generate2DGrid(_start, 2.5f, _width,_height);
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This way, instead of the gizmos being the grid that's generated each call, I can just generate the grid ahead of time and then draw it in &lt;strong&gt;OnDrawGizmosSelected()&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
void OnDrawGizmosSelected()
    {
        Color col = Color.yellow;
        foreach (Vector3 _it in _coordinates)
        {
            DrawSphereAt(_it, col);
        }
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2 id="determine_structures"&gt;2. What are walls? &lt;/h2&gt;

&lt;p&gt;My first thought was that, having something more abstract for determining corners+walls would be cool. With what I came up with, I need to always provide absolute sizes for the grid to do anything.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;walls = {&lt;br&gt;
            NORTH = V3(xL,x,x)&lt;br&gt;
            EAST = V3(x,x,xM)&lt;br&gt;
            SOUTH = V3(xM,x,x)&lt;br&gt;
            WEST = V3(x,x,xL)&lt;br&gt;
            NW_CORNER = (xL,x,xL)&lt;br&gt;
            NE_CORNER = V3(xL,x,xM)&lt;br&gt;
            SE_CORNER = V3(xM,x,xM)&lt;br&gt;
            SW_CORNER = V3(xM,x,xL)&lt;br&gt;
        }&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This was the rough version, where "&lt;strong&gt;xL&lt;/strong&gt;" is the lowest value and "&lt;strong&gt;xM&lt;/strong&gt;" is the max.&lt;br&gt;
The idea being, I set up a method to check if the coordinate matches a wall or corner description, then the method returns the associated type. &lt;/p&gt;

&lt;p&gt;So first I turned the above into an actual enum type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private enum StructureType
    {
        INNER,
        NORTH_WALL,
        EAST_WALL,
        SOUTH_WALL,
        WEST_WALL,
        NW_CORNER,
        NE_CORNER,
        SE_CORNER,
        SW_CORNER
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Trying to visualize the world through Cartesian Coordinates hurts my brain so it took a few more hours to actually map out the descriptions...correctly...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;reference : 
            NORTH = V3(xL,x,x)
                (X == Lowest)
                (Z != Lowest) (Not North West)
                (Z != Max) (Not North East)
            EAST = V3(x,x,xM)
                (Z == Max)
                (X != Lowest) (Not North East)
                (X != Max) (Not South East)
            SOUTH = V3(xM,x,x)
                (X == Max)
                (Z != Lowest) (Not South West)
                (Z != Max) (Not South East)
            WEST = V3(x,x,xL)
                (Z == Lowest) 
                (X != Max) (Not South West)
                (X != Lowest) (Not North West)
            NW_CORNER = (xL,x,xL)
                (X == Lowest)
                (Z == Lowest)
            NE_CORNER = V3(xL,x,xM)
                (X == Lowest)
                (Z == Max)
            SE_CORNER = V3(xM,x,xM)
                (X == Max)
                (Z == Max)
            SW_CORNER = V3(xM,x,xL)
                (X == Max)
                (Z == Lowest)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From here, I create a method for returning the correct type based on the above criteria: &lt;br&gt;
&lt;code&gt;private StructureType GetStructureType(Vector3 component)&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;Before I show the full method, I want to again mention, that the full dimensions of the grid are needed ahead of time to make this work. &lt;/p&gt;

&lt;p&gt;So first, I have to create two more variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    [SerializeField] private float _maxWidthValue;
    [SerializeField] private float _maxHeightValue;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And back inside the &lt;strong&gt;Generate2DGrid()&lt;/strong&gt; method; I add variables to track the highest x and z value of the grid (&lt;strong&gt;lastZ&lt;/strong&gt; &amp;amp; &lt;strong&gt;lastX&lt;/strong&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    private List&amp;lt;Vector3&amp;gt; Generate2DGrid(Vector3 start, float spacing = 2.5f, int width = 10, int height = 10)
    {
        Vector3 tempPos = start;
        List&amp;lt;Vector3&amp;gt; coordList = new List&amp;lt;Vector3&amp;gt;();
        float lastZ = 0.0f;
        float lastX = 0.0f;

        for (int i = 0; i &amp;lt; width; i++)
        {
            // Column
            lastX = tempPos.x;
            coordList.Add(new Vector3(tempPos.x, tempPos.y, tempPos.z));

            // Row
            var rowPos = tempPos;
            for (int z = 0; z &amp;lt; height; z++)
            {
                if (!(z == 0))
                {
                    lastZ = rowPos.z;
                    coordList.Add(new Vector3(rowPos.x, rowPos.y, rowPos.z));
                }
                var nZ = rowPos.z += spacing;
                rowPos = new Vector3(tempPos.x, tempPos.y, nZ);
            }

            // Continue it 
            var nX = tempPos.x += spacing;
            tempPos = new Vector3(nX, tempPos.y, tempPos.z);

        }

        _maxWidthValue = lastZ;
        _maxHeightValue = lastX;

        return coordList;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the iterations are finished, the method sets the private class variables &lt;strong&gt;_maxWidthValue&lt;/strong&gt; &amp;amp; &lt;strong&gt;_maxHeightValue&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(Note: I could modify the method so this isn't a problem, but as it is, the variables need to be set just before the new Vector is created and added to the list. Otherwise, the max value will exceed the actual coordinates because the loop will increment the x and z values once more &lt;strong&gt;after&lt;/strong&gt; the final vector addition).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here's the full method that does our StructureType checks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private StructureType GetStructureType(Vector3 component)
    {

        /* reference : 
            NORTH = V3(xL,x,x)
                (X == Lowest)
                (Z != Lowest) (Not North West)
                (Z != Max) (Not North East)
            EAST = V3(x,x,xM)
                (Z == Max)
                (X != Lowest) (Not North East)
                (X != Max) (Not South East)
            SOUTH = V3(xM,x,x)
                (X == Max)
                (Z != Lowest) (Not South West)
                (Z != Max) (Not South East)
            WEST = V3(x,x,xL)
                (Z == Lowest) 
                (X != Max) (Not South West)
                (X != Lowest) (Not North West)

            NW_CORNER = (xL,x,xL)
                (X == Lowest)
                (Z == Lowest)
            NE_CORNER = V3(xL,x,xM)
                (X == Lowest)
                (Z == Max)
            SE_CORNER = V3(xM,x,xM)
                (X == Max)
                (Z == Max)
            SW_CORNER = V3(xM,x,xL)
                (X == Max)
                (Z == Lowest)
        */

        // Width == Max Row (Z) value
        // Height == Max Col (X) value

        float wdt = _maxWidthValue;
        float hgt = _maxHeightValue;
        var structT = StructureType.INNER; // if none of the criteria are met, it's an inner component
        var c = component; // trying to make the below code a little cleaner

        // if x value is lowest (north) if z value is NOT max (not northeast) if z value is NOT lowest (not northwest)
        if (c.x == 0 &amp;amp;&amp;amp;
            c.z != wdt &amp;amp;&amp;amp;
            c.z != 0
        ) { structT = StructureType.NORTH_WALL; }

        // if z value is MAX (east) if x value is NOT max (not southeast) if x value is NOT lowest (not northeast)
        if (c.z == wdt &amp;amp;&amp;amp;
            c.x != hgt &amp;amp;&amp;amp;
            c.x != 0) { structT = StructureType.EAST_WALL; }

        // if x value is MAX (south) if z value is NOT max (not southeast) if z value is NOT lowest (not southwest) 
        if (c.x == hgt &amp;amp;&amp;amp;
            c.z != wdt &amp;amp;&amp;amp;
            c.x != 0) { structT = StructureType.SOUTH_WALL; }

        // if z value is LOWEST (west) if x value is NOT lowest (not northwest) if x value is NOT MAX (southwest)
        if (c.z == 0 &amp;amp;&amp;amp;
            c.x &amp;gt; 0 &amp;amp;&amp;amp;
            c.x &amp;lt; hgt) { structT = StructureType.WEST_WALL; }


        // -- CORNERS --

        // if x value is LOWEST (north) if z value is lowest (northwest)
        if (c.x == 0 &amp;amp;&amp;amp; c.z == 0) { structT = StructureType.NW_CORNER; }

        // if x value is LOWEST (north) if z value is MAX (northeast)
        if (c.x == 0 &amp;amp;&amp;amp; c.z == wdt) { structT = StructureType.NE_CORNER; }

        // if x value is MAX (south) if z value is lowest (southwest)
        if (c.x == hgt &amp;amp;&amp;amp; c.z == 0) { structT = StructureType.SW_CORNER; }

        // if x value is MAX (south) if z value is MAX (southeast)
        if (c.x == hgt &amp;amp;&amp;amp; c.z == wdt) { structT = StructureType.SE_CORNER; }

        //Debug.Log("Returning :" + structT + "FOR : " + c);
        return structT;
    } 

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The easiest way for me to check that this was working correctly... was with gizmos. &lt;br&gt;
So I created a new helper method that returns one of 3 colors depending on a vectors structure type.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    private Color GetStructureColor(Vector3 position)
    {
        Color aColor = Color.gray;
        StructureType structType = GetStructureType(position);

        if (structType == StructureType.NORTH_WALL ||
            structType == StructureType.SOUTH_WALL ||
            structType == StructureType.EAST_WALL ||
            structType == StructureType.WEST_WALL) { aColor = Color.red; }

        if (structType == StructureType.NE_CORNER ||
            structType == StructureType.NW_CORNER ||
            structType == StructureType.SE_CORNER ||
            structType == StructureType.SW_CORNER) { aColor = Color.green; }

        return aColor;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Red = Wall&lt;/li&gt;
&lt;li&gt;Green = Corner&lt;/li&gt;
&lt;li&gt;Gray = Inner&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I then modified the &lt;strong&gt;Generate2DGridGizmos()&lt;/strong&gt; to use this helper method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    private void Generate2DGridGizmos(Vector3 start)
    {
        var tempPos = start;

        for (int i = 0; i &amp;lt; _width; i++)
        {
            // Draw col
            DrawSphereAt(tempPos, GetStructureColor(tempPos));

            // Draw row
            var rowPos = tempPos;
            for (int z = 0; z &amp;lt; _height; z++)
            {
                if (!(z == 0)) { DrawSphereAt(rowPos, GetStructureColor(rowPos)); }
                var nZ = rowPos.z += _gridSpacing;
                rowPos = new Vector3(tempPos.x, tempPos.y, nZ);
            }

            // Continue iter
            var nX = tempPos.x += _gridSpacing;
            tempPos = new Vector3(nX, tempPos.y, tempPos.z);
        }

    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here's the results: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3eu29g5hntnrizfg7sde.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3eu29g5hntnrizfg7sde.png" alt="Image description" width="800" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The StructureCheck assumes the lowest position value is 0, so that needs fixing, otherwise this was far more succesful then I initially thought it would be. &lt;/p&gt;

&lt;p&gt;Here's a test where it generates actual walls: &lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo2kpotolarpvbymoeqk7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo2kpotolarpvbymoeqk7.png" alt="Image description" width="800" height="359"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>unity3d</category>
      <category>gamedev</category>
      <category>learning</category>
    </item>
    <item>
      <title>Programatically Starting a Chromium page in Full Screen - .NET</title>
      <dc:creator>Chris</dc:creator>
      <pubDate>Mon, 14 Feb 2022 16:01:34 +0000</pubDate>
      <link>https://dev.to/nightsmore/programatically-starting-a-chromium-page-in-full-screen-net-2f2a</link>
      <guid>https://dev.to/nightsmore/programatically-starting-a-chromium-page-in-full-screen-net-2f2a</guid>
      <description>&lt;p&gt;Using the "System.Diagnostics" namespace in .NET, you can Automate launching a page in full-screen using a Chromium browser. &lt;/p&gt;

&lt;p&gt;Here's an example written in PowerShell.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$_processInfo = New-Object System.Diagnostics.ProcessStartInfo 

# use this if you want maximized instead of full-screen for any application. 
$_processInfo.WindowStyle = [System.Diagnostics.ProcessWindowStyle]::Maximized 

# Provide the path to the browsers executable
$_processInfo.FileName = "C:\Program Files\Google\Chrome\Application\chrome.exe"

# Launch in full screen using the flag '--start-fullscreen'
$_processInfo.Arguments = "--start-fulscreen", "-app $($URL)"

# add the process info and start
$_process = New-Object System.Diagnostics.Process
$_process.StartInfo = $_processInfo 
$_process.Start()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>programming</category>
      <category>powershell</category>
      <category>automation</category>
      <category>net</category>
    </item>
  </channel>
</rss>
