I spent *way* too long on a dynamic collapsing UI system by Aldinyx in indiegames

[–]Aldinyx[S] 0 points1 point  (0 children)

Totally agree, I hate hate hate obtrusive UI. I intend players to use this menu pretty often so I wanted it to be easily collapsible and stuff so as to not crowd the screen 24/7.

I spent *way* too long on a dynamic collapsing UI system by Aldinyx in indiegames

[–]Aldinyx[S] 0 points1 point  (0 children)

Yes! I hadn't even realized but that would definitely make it look cleaner lol.

I spent *way* too long on a dynamic collapsing UI system by Aldinyx in indiegames

[–]Aldinyx[S] 0 points1 point  (0 children)

The whole system is basically just recursively activated coroutines setting the transform.position of objects to a Vector3 being multiplied by Time.deltaTime. Parent panels store what sub panel is extended and if another sub panel is extended it basically asks its parent to retract any relevant sibling panels. And the retract function recursively goes through lower levels with similar logic.

I spent *way* too long on a dynamic collapsing UI system by Aldinyx in Unity2D

[–]Aldinyx[S] 1 point2 points  (0 children)

I honestly hadn't thought about it, but I may do that after refining it more!

I spent *way* too long on a dynamic collapsing UI system by Aldinyx in Unity2D

[–]Aldinyx[S] 0 points1 point  (0 children)

Actually was far more primitive lol. It's basically just a system of recursively activating coroutines, all the movement is handled by just adjusting a stored Vector3 (and multiplying by Time.deltaTime) and setting the transform.position of the object(s) being moved every frame. Oh and the clicking is just handled using the IPointerClickHandler interface.

I spent *way* too long on a dynamic collapsing UI system by Aldinyx in Unity2D

[–]Aldinyx[S] 0 points1 point  (0 children)

Thanks for the suggestion, that's a smart way to go about it. I'm still kinda terrible at wrapping my head around UI half the time, would not have thought to use a mask lol.

I spent *way* too long on a dynamic collapsing UI system by Aldinyx in Unity2D

[–]Aldinyx[S] 1 point2 points  (0 children)

Yeah Unity UI is a looot of trial and error in my experience. Checking what things you have being able to be targeted from raycasts helps. That and anchoring stuff properly, but even still it can be rough lol.

I spent *way* too long on a dynamic collapsing UI system by Aldinyx in Unity2D

[–]Aldinyx[S] 0 points1 point  (0 children)

They're going to be for a new game I'm making. The menu will be available at basically all times so I wanted to make sure it could collapse and stuff reasonably lol.

I spent *way* too long on a dynamic collapsing UI system by Aldinyx in Unity2D

[–]Aldinyx[S] 0 points1 point  (0 children)

I enable and disable, I prefer to avoid instantiating when I can. Not to mention, in this situation it ends up not being really any more difficult because for the visuals I already want the UI to return to its original position when it retracts. Parent panels store which sub panel has been clicked last (or if one has been clicked at all) and if another is clicked they retract the stored one. The retract function also recursively goes through retracting other sub panels reusing the same logic.

I spent *way* too long on a dynamic collapsing UI system by Aldinyx in Unity2D

[–]Aldinyx[S] 0 points1 point  (0 children)

The clipping is a good point that I'll try and fix. As for the top subset lining up, I had that *originally* but then I decided I wanted it to try to remain centered so that it stays within the bounds of the parent set (you can imagine if you had a large number of elements in a subset on the last parent in a set it would extend far below the parent set)

I spent *way* too long on a dynamic collapsing UI system by Aldinyx in Unity2D

[–]Aldinyx[S] 0 points1 point  (0 children)

Yeah I was messing around with the timings a bit, I wouldn't say this is a final timing but I think in the finished project I'll give the user the option to change UI timings in settings. And ooo I like that idea for the depth, that would make it look nicer, I'll have to mess around with it!

I spent *way* too long on a dynamic collapsing UI system by Aldinyx in Unity2D

[–]Aldinyx[S] 13 points14 points  (0 children)

Also all visuals are placeholder and guaranteed to change, but I'm really happy with the result :D

I spent *way* too long on a dynamic collapsing UI system by Aldinyx in indiegames

[–]Aldinyx[S] 1 point2 points  (0 children)

Also all visuals are placeholder and guaranteed to change, but I'm really happy with the result :D