Skip to content

Conversation

@c3-hoge-fuga-piyo
Copy link

@c3-hoge-fuga-piyo c3-hoge-fuga-piyo commented Nov 26, 2025

Proposed changes

Currently, ClassesOnlyAttribute resides in an editor-only assembly, which requires using #if UNITY_EDITOR guards when referenced from runtime code:

#if UNITY_EDITOR
[ClassesOnly]
#endif
[SerializeField] SerializableInterface<X> x;

This change moves ClassesOnlyAttribute into a runtime assembly, eliminating the dependency on editor assemblies and removing the need for conditional compilation in runtime code.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes, no api changes)
  • Code style update (formatting, renaming)
  • Build related changes (workflow changes)
  • Documentation Update (readme, changelog)
  • Other, please describe:

What is the current behavior?

Using ClassesOnlyAttribute requires referencing TNRD.SerializableInterface.Editor.asmdef, and for runtime code this necessitates an #if UNITY_EDITOR guard.

What is the new behavior?

Using ClassesOnlyAttribute will only require referencing TNRD.SerializableInterface.asmdef.

Checklist

  • The code compiles
  • I have tested that this doesn't break existing code (unless it is an explicit breaking change)
  • I have tested that the (new) functionality/fix works as intended

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant