title: Unity - Custom drawing of a struct in the inspector
body: <p>I have a custom struct, with the following code :</p>
  <pre><code>[Serializable]
  public struct HexPoint : IEquatable&lt;HexPoint&gt;
  {
      public readonly int x;
      public readonly int y;
      public readonly int z;
      
      // Some custom methods for initializations and operators
  }
  </code></pre>
  <p>If I make the x, y, and z variables non-readonly, they are displayed in the unity inspector just fine. However, I have some rules that they need to satisfy (actually x+y+z=0), so I added readonly to prevent people to mess with it.</p>
  <p>But as readonly variables, they are not displayed (as they can't be modified)! :(</p>
  <p>I was wondering if they are a way for me to display them in the unity inspector, with something similar to a PropertyDrawer. I know that I could switch my struct to a class, as PropertyDrawer is reserved for classes, but I'd like to keep it as a struct.</p>
  <p>So, is there a way to display the values? And eventually to modify them using the custom initializers?</p>
  <p>Thanks a lot!</p>