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. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    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:
    527
    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:
    527
    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,021
    Could you please submit a bug report for this issue?
     
unityunity