Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for SerializeReference #1340

Closed
citizenmatt opened this issue Oct 2, 2019 · 3 comments
Closed

Add support for SerializeReference #1340

citizenmatt opened this issue Oct 2, 2019 · 3 comments
Assignees
Milestone

Comments

@citizenmatt
Copy link
Member

New in Unity 2019.3.

  • Applied to a field
  • Applied only to reference types - the field is serialised as a reference, not a value, allowing for e.g. expressing object graphs

Initial thoughts:

  • Means implicit use + assignment (like [SerializeField])
  • Need to treat these fields as serialised fields (naming standards, in use, context actions, code vision)
  • Update "make serialised field" context actions - make serialised field/make serialised references
  • Update sprop and sfield Live Templates? Allow choosing attribute?
  • Only support in Unity 2019.3+

See more details in the Unity forum

@citizenmatt
Copy link
Member Author

If this supports polymorphic serialisation, it might be useful to highlight when a subtype isn't [Serializable]

@citizenmatt
Copy link
Member Author

Other possible issues:

  • Check if things break if the class is renamed - the class name might be part of the serialised data
  • It looks like the serialised object can't derive from UnityEngine.Object. If so, add a warning + "Why is Rider suggesting this?" for this scenario.

@aybe
Copy link

aybe commented Nov 2, 2020

There's a bug in Rider 2020.2.4:

TrackPerk is abstract, it is and all its derived marked as [Serializable].

The bug is as follows,

I wanted to add [HideInInspector] but it's marked as useless, tried to add [SerializeField] but it's also marked as useless.

rider64_2020-11-02_19-51-42

@citizenmatt citizenmatt mentioned this issue Nov 18, 2020
13 tasks
@citizenmatt citizenmatt self-assigned this Nov 20, 2020
@citizenmatt citizenmatt added this to the Rider 2020.3 milestone Nov 20, 2020
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

No branches or pull requests

2 participants