I’m using unity 2021 LTS.
I understand the following situation is intended.
- Create a Monobehaviour script, TestScript.cs
- Add a SerializeField variable, [SerializeField] private int testValue = 10;
- Attach the script to a prefab, TestPrefab.prefab
- Change the default value of testValue to 20
- testValue of TestPrefab remains at 10 (in TestPrefab.prefab file, there is ‘testValue: 10’)
But I cannot understand the following situation.
- Create a Monobehaviour script, TestScript.cs
- Attach the script to a prefab, TestPrefab.prefab
- Add a SerializeField variable, [SerializeField] private int testValue = 10;
- Change the default value of testValue to 20
- Double-click TestPrefab, testValue of TestPrefab changed to 20
- Add TestPrefab to scene, testValue of TestPrefab remains at 10 (in TestPrefab.prefab file, there is no ‘testValue’)
- Reimport TestPrefab
- Add TestPrefab to scene, testValue of TestPrefab changed to 20
Is this intended behavior?
Is the only way to update all default values to reimport all assets?