Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

212
Views
Renaming Serialized Auto-Properties in Unity

I have a auto-property that is serialized on the Inspector and i need to rename it without loosing the serialized value, normally i would use the [FormerlySerializedAs(previousName)] attribute for this, the problem is that it's not working with auto-properties, does anybody have any insight on this?

My code:

public class Test : MonoBehaviour
{
    [field: SerializeField]
    [field: FormerlySerializedAs("previousName")]
    public Transform FieldIWantToRemainSerialized { get; private set; }
}
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Little late, but maybe someone will find that usefull, you need to use this:

[field: FormerlySerializedAs("<previousName>k__BackingField")]
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!