title: How do I organize nested classes to be references in Unity?
body: <p>So I'm working on a game and I'd like some recommendations for how to sort items for easy, legible, coding reference in Unity. I know my current method is flawed, and really I'd just like some guidance.</p>
  
  <p>So what I'm doing is using classes to separate item categories and their items.
  For example, here's an idea of a setup for a script :</p>
  
  <pre><code>public class Items {
      public class Equipment {
          public class Weapons {
              public Item Sword = new Item();
              Sword.name = "Sword";
              Sword.cost = 1;
          }
      }
  }
  </code></pre>
  
  <p>then a basic Item class for example</p>
  
  <pre><code>public class Item {
      public string name;
      public int cost;
  }
  </code></pre>
  
  <p>I can tell this is terrible practice, especially based on the problems I've been having, but I like the idea of using a reference like Items.Equipment.Weapons.Sword and I've grown accustomed to using that from an API I previously used.</p>
  
  <p>I'm open to completely changing everything, I just want some tips. Thanks.</p>
  
  <p>I guess my main question is (was), what's the best way to organize nested classes so they can be references from other scripts easily?</p>
  
  <p>The answer I found was that instead of nesting classes, in my case, it's better to use namespaces to separate items into categories. Thanks a million.</p>