IntoTheDev / MultiTag-System-for-Unity

This package allows you to Tag Game Objects with ScriptableObjects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Standalone build warning

lemoissonneur opened this issue · comments

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;
        ...
}

Capture

public sealed class Taggable : MonoBehaviour
{
...
#if UNITY_EDITOR
        private static Tag[] _all = null;
#endif
...
}

Thank you for this package !

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.

As far as i know, unity doesn't serialize static properties, and it didn't trigger any serialization error for me (2019.4.8f1).

Ah, yes. You're totally right, thanks! :) I added this field to UNITY_EDITOR directive in last commit.