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

Float/IntVariable clamped issue #112

Open
MerlinHintze opened this issue Feb 6, 2020 · 1 comment
Open

Float/IntVariable clamped issue #112

MerlinHintze opened this issue Feb 6, 2020 · 1 comment
Assignees
Labels
bug Something isn't working refactoring Requires extensive refactoring. Might not be implemented
Milestone

Comments

@MerlinHintze
Copy link

MerlinHintze commented Feb 6, 2020

Generate new FloatVariable or IntVariable over
right click -> Create -> Variables -> Float/Int
and then it is not possible to set a other Float/IntVariable as Min/Max Clamped Value, just numbers.
clamped_issue

System:
Windows 10 64 bit, 16 GB RAM, SSD,
Unity 2020.1.0a17, 2D project template

@DanielEverland DanielEverland self-assigned this Feb 8, 2020
@DanielEverland DanielEverland added the bug Something isn't working label Feb 8, 2020
@DanielEverland DanielEverland added this to the Release 1.6.5 milestone Feb 8, 2020
@DanielEverland
Copy link
Owner

I was re-implementing this feature, unfortunately it's not possible with the current codebase.

When the screenshot in the wiki was taken, clamped variables were completely separate classes. When it was merged into the current class structure, the reference type was dropped - at the time probably by accident. The problem is that in order to serialize the clamped values as a reference, they have to be passed as a generic argument. The reference, in turn, needs to know what type of variable it has to serialize. This creates a cyclic serialization, which prevents me from re-implementing the feature.

I'm keeping this open as it would be possible if we were to switch to a custom serialization scheme #100 , that doesn't rely on Unity's restriction. In this particular case, being able to serialize generics should solve it, as we only need to pass the base type (float instead of FloatUnityEvent, FloatReference, etc.) as a generic argument.

@DanielEverland DanielEverland added the refactoring Requires extensive refactoring. Might not be implemented label Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working refactoring Requires extensive refactoring. Might not be implemented
Projects
None yet
Development

No branches or pull requests

2 participants