JetBrains / resharper-unity

Unity support for both ReSharper and Rider
Apache License 2.0
1.21k stars 134 forks source link

Classes derived from IStartupLocaleSelector is marked as unused if not serialisable #2092

Open citizenmatt opened 3 years ago

citizenmatt commented 3 years ago

This is used from Unity's new localisation package

citizenmatt commented 3 years ago

IStartupLocaleSelector can be implemented by user code, and used as part of a [SerializeReference] field in LocalizationSettings. This means the class must be serialisable. If it's not, then the class may be marked as unused. The correct fix is to add [Serializable]. Ideally, Rider/ReSharper would warn that the class is not serialisable.