MinMaxRange property drawer randomly resets the input occasionally
See original GitHub issueEnvironment
- Code source: GitHub
- Code version: 1.19.0
- Platform version: Unity 2014.3.14f1
- 3rd party dependencies:
Steps to reproduce
- Add Empty GameObject to scene
- Create simple script implementing the MinMaxRange property drawer:
using Malimbe.PropertySerializationAttribute;
using UnityEngine;
using Zinnia.Data.Attribute;
using Zinnia.Data.Type;
public class MinMaxRange : MonoBehaviour
{
[Serialized]
[field: MinMaxRange(-1f, 1f)]
public FloatRange Range { get; set; } = new FloatRange(-0.5f, 0.5f);
}
-
Add script to Empty GameObject
-
Make Empty GameObject a prefab
-
Default settings should be:
-0.5
~~0.5
-
Run the scene then stop the scene
-
Change min range to
-0.2
(don’t just change the5
to a2
delete the whole field and type-0.2
- Prefab field should now go bold as this is a value change on the original prefab
-
Run the scene then stop the scene
-
Min range value should still be
-0.2
-
Change min range to
-0.5
(don’t just change the2
to a5
delete the whole field and type-0.5
-
Run the scene then stop the scene
-
Min range has now reverted to
0
Expected behavior
Value to stay at -0.5
Current behavior
Value resets to ‘0’
Issue Analytics
- State:
- Created 3 years ago
- Comments:26 (26 by maintainers)
Top Results From Across the Web
Scripting API: PropertyDrawer
Base class to derive custom property drawers from. Use this to create custom drawers for your own Serializable classes or for script variables...
Read more >Behaviour Tree Editor for Unity built with UIToolkit
The Editor uses PropertyDrawers to render the inspector view for your type. If you've defined a custom property drawer then it will show...
Read more >Property Drawers
Using a custom Property Drawer, every appearance of the Ingredient class in the Inspector can be changed. Compare the look of the Ingredient...
Read more >Untitled
Carl's jr christchurch locations, Kayu sugih guest house, Electric trap rat, ... Elon musk smokeing weed meme, Gmod select random skin, Puma gk...
Read more >CHANGELOG.md
The EmitEvents property can be unchecked to prevent any action events from being emitted when action values are changed.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh also if you just edit the Prefab (not instance) then it just works like the Script Attached To GameObject anyway and still saves fine
Yeah, you can’t set custom datatypes with the SerializedProperty stuff, only what they offer. So that Supyrb SetValue goes through the FieldInfo/PropertyInfo and sets the value.
So something in there is not doing the thing unity expects