resharper-unity icon indicating copy to clipboard operation
resharper-unity copied to clipboard

Classes derived from IStartupLocaleSelector is marked as unused if not serialisable

Open citizenmatt opened this issue 4 years ago • 1 comments

This is used from Unity's new localisation package

citizenmatt avatar May 19 '21 17:05 citizenmatt

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.

citizenmatt avatar Aug 04 '21 13:08 citizenmatt