Standalone build warning
lemoissonneur opened this issue · 3 comments
lemoissonneur commented
Hello !
This var is only used in editor code and generate a warning when building. Shouldn't it be declared inside a #if UNITY_EDITOR ... #endif
as well ?
public sealed class Taggable : MonoBehaviour
{
...
private static Tag[] _all = null;
...
}
public sealed class Taggable : MonoBehaviour
{
...
#if UNITY_EDITOR
private static Tag[] _all = null;
#endif
...
}
Thank you for this package !
IntoTheDev commented
Hello! If you declare this variable inside #UNITY_EDITOR
directive then you will get serialization error/warning in build. Currently it works just fine except warning in editor, no need to put this inside directive.
lemoissonneur commented
As far as i know, unity doesn't serialize static properties, and it didn't trigger any serialization error for me (2019.4.8f1).
IntoTheDev commented
Ah, yes. You're totally right, thanks! :) I added this field to UNITY_EDITOR directive in last commit.