Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

FindRelativeProperty custom class

Discussion in 'Scripting' started by yumupdate, Jul 20, 2013.

  1. yumupdate

    yumupdate

    Joined:
    Nov 20, 2012
    Posts:
    30
    SerializableProperty's FindRelativeProperty is working fine for one property in my script that is a MonoScript but my custom class (which is a public property in the same object) isn't being picked up by it. Is there a requirement for the function to be able to pick up these properties? The custom class is Serializable and if I change it to inherit from anything, none of the properties are available to FindRelativeProperty.

    Thanks!
     
  2. yumupdate

    yumupdate

    Joined:
    Nov 20, 2012
    Posts:
    30
    It seems that if you're trying to find a field of an object that is the same type as that object, it doesn't like that. I separated that piece of functionality out to another custom class and it works now.