Open laurentopia opened 3 months ago
but changing neutralrange gets stores in the SO, perhaps it's failing within a list
and i'm thinking, maybe it's conflicting with the drag and drop reordering of the list... yeah when dragging the progressbar the list element gets dragged, this is the wrong behavior as it contrasts with dragging the reference field which doesn't drag the element.
confirmation that it also happens at runtime: that's the SO asset before event after event that's the thing referencing the SO after event the color changed but not the value I had to select the SO then back the user to get value change. and these are the values all changing at the same time. and that is also happening on the SO so my guess is we're seeing 2 bugs:
oops attached the wrong thing, this is all the sliders changing at the same time (list of class with progressbar in it) https://github.com/user-attachments/assets/9996d277-7461-4099-a2c1-15701fc31a2e
There is some weird issue with struct + progressbar. Im looking into it
Hi, please try this script if it's a bit better. (not actually solves everything but should make it more aligned with serialized data)
#if UNITY_EDITOR
using UnityEditor;
#endif
#if UNITY_EDITOR
void OnValidate()
{
for (var i = aliances.Count - 1; i >= 0; i--)
{
var a = aliances[i];
a.neutralRange = neutralRange;
if (a.team == this)
{
Undo.RecordObject(this, name); // add this
aliances.RemoveAt(i);
}
if (aliances.FindAll(tt => tt.team == a.team).Count > 1)
{
Undo.RecordObject(this, name); // add this
a.team = null;
}
}
}
#endif
Thanks, still doesn't work. I even boxed the onvalidate code in Application.isPlayer==false and removed it altogether. Could it be a 2020 special?
Can you give Unity's full version (2020.x.f1 etc) so I can try re-produce it?
OK I managed to re-produce it in 2020.1.0f1. It's a IMGUI issue. I'm looking into it
https://github.com/user-attachments/assets/886c36ee-42ff-465b-8d7f-ad3db9cc35c9
Fixed. The fix will be released soon
even with the onvalidate removed. edit and play time
Hi, to be clear, does the issue now is:
ScriptableObject
itselfExpandable
, the ProgressBar
does not change color correctly, and the value is lost after editing in Expandable
3.2.4 now will apply the changed value by Expandable
in IMGUI, please have a try
Almost there: it works fine from the [Expandable] scriptableobject reference but now it doesn't work from the SO to the reference. Also the reference's inspector doesn't update when the SO is changed at runtime. That said, damn it's nice already!
Almost there: it works fine from the [Expandable] scriptableobject reference but now it doesn't work from the SO to the reference. Also the reference's inspector doesn't update when the SO is changed at runtime. That said, damn it's nice already!
Hi, I'm a bit confused here.
it doesn't work from the SO to the reference what's the operation here? For what I think, I did:
alliaces[0].affinity
using inspector to some other valueaffinity
is correct.So, what's your operation here so I can re-produce it?
the reference's inspector doesn't update when the SO is changed at runtime.
Do you mean the script changed the So's value like this
[Expandable, Required]
public MCTeam team;
private void Start()
{
team.alliances[0].affinity = 0;
}
For what I'm testing under IMGUI, it will update the display in the inspector during runtime.
So, any information that helps re-producing it is welcome :)
If you reference the SO in a scene gameobject and change the SO, the GO's expanded inspector doesn't update.
with this setup changing expanded team within the editor doesn't update the SO and colored progressbars don't follow color coding set by FillColor():
and that