Suppose I have a class Foo and some member data that I wish to encapsulate in a struct Bar, like so:

Code (csharp):
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class Foo : MonoBehaviour
  5. {  
  6.     public struct Bar { public int a; public float b; }
  7.     public Bar m_bar;
  8. }

Is there a way for me to make the members of m_bar editable through the Inspector of Foo?



---------------------------------------------------------



Want to re-resurrect, I have also gotten this to work, I got allot of errors, but I copy and pasted your code, swapped some stuff, deleted your code and put in my own and it works,





EDIT: I would also like to note that structs in structs work also, very good for organization!








ref : https://forum.unity.com/threads/how-do-i-make-member-structs-accessible-in-the-editor.36395/

+ Recent posts