Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

There is no way to detect whether a field is missing or none.

Discussion in '2018.3 Beta' started by watsonsong, Nov 15, 2018.

  1. watsonsong

    watsonsong

    Joined:
    May 13, 2015
    Posts:
    555
    I am using the SerializedProperty to check whether a field is missing or none, using the following code:
    Code (CSharp):
    1. sp.objectReferenceValue == null && sp.objectReferenceInstanceIDValue != 0
    But in the new version of unity, this check is failed and the missing field the objectReferenceInstanceIDValue is 0 too. I write a tool to detect all missing reference field. How can I check it in the newest unity?

    The original way is really common used, can be found everywhere on github. I hope there is an official way to detect this:
    https://gist.github.com/ProGM/a40acd8ebbb91eb7b2295e65d5eb42c8
     
    Last edited: Nov 15, 2018
    tim12332000 and Peter77 like this.
  2. watsonsong

    watsonsong

    Joined:
    May 13, 2015
    Posts:
    555
    Is there any one know how to detect the missing field in 2018.3?
     
  3. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,132
    Could you please submit a bug report for this issue?