Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
Simon (Darkside) Jackson
@SimonDarksideJ
As shown in the last line, I query the reference I have to the specific GameObject with the HorizontalScrollSnap component applied, and query the "CurrentPage"
pdeclercq
@pdeclercq

Thanks for the feedback @pdeclercq , Can you log an issue on the bitbucket with replication steps and of possible a demo scene showing the issue.

I'm not 100 % sure how to replicate it, i can't send a demo because as i said i found a solution (and didn't really think things through), but the main point is, if you move to a index using GoToScreen(index) while the scrolling is decelerating, it can go to the index + 1 or - 1 depending on the velocity (left to right / right to left)

I would love some help on the same scroller tho, im trying to delete or add children dynamically but i don't understand the RemoveChild() parameter "out". I'm using c++ in all my own script so the issue might be there but no real idea
pdeclercq
@pdeclercq
What I really want to do is to be able to hide a specific screen so the scroller ignores it
Simon (Darkside) Jackson
@SimonDarksideJ
I saw you logged an issue on Bitbucket for the same. As your requirements are slightly different here. Could I ask you to update that issue with the requirements for what you are trying to achieve and if possible, yes a sample scene to work with.
papitosan
@papitosan

Simply query the CurrentPage variable of the HorrizontalScrollSnap component, as follows:

    public HorizontalScrollSnap hss;

    // Start is called before the first frame update
    void Start()
    {
        hss = GetComponent<HorizontalScrollSnap>();
    }

    // Update is called once per frame
    void Update()
    {
        //Checking for the Currentpage
        var theSelectedPageIs = hss.CurrentPage; 
    }

oh I understand now, Thanks a lot. I was trying to reference the variable directly in HSS script.

Also I forgot to declare "namespace UnityEngine.UI.Extensions"
papitosan
@papitosan
Excuse me to bother you but I have one last question:
I want to have a menu where each page correspond to a level but at the beginning all level except level 1 would be locked so it would n't be possible to scroll to those page. then after completing level 1, level 2 become available and unlocked so you can now scroll to the page. How would you do that with HSS?
pdeclercq
@pdeclercq
@papitosan you can add a button on each screen and deactivate the interaction for the one locked or just add a new child if you don't want to show the level at all
papitosan
@papitosan
@pdeclercq Ok, got it!
for people who try to do it, it's not possible to make a child of a prefab. You have to put the plans on the scene as gameobject first and then call them by script as child.
JustWastingTime
@JustWastingTime
Hello. Is it possible to make the reorderable list grid scrollrect to scroll while clicking on the content? I disabled the IsDraggable to prevent the content from getting dragged instead. Or is there another UI Extension component that lets me make a grid with autolayouting?
Simon (Darkside) Jackson
@SimonDarksideJ
The Reorderable List, is only intended as a drag and drop interface and is designed that way @JustWastingTime , the component you're looking for is the "UIScrollToSelection" Component. The docs page was missed in the last big update, so I'll get it updated ASAP.
However, it is very easy to add, by simply adding the component to an existing ScrollRect
mahgo
@mahgo
I'm using UILineRendererList to render multiple lines, and am trying to style my lines with a sprite that I want to repeat/tile, but it is only stretching, even if I set Wrap Mode - Repeat on the sprite. What can I do to achieve this?
Artyom
@artyomabgaryan
@SimonDarksideJ is there way to use Scroll Snap & infinite scroll together ?
Simon (Darkside) Jackson
@SimonDarksideJ
You can use the HSS & VSS controls with the Infinite scroll control @artyomabgaryan . they have been updated to work together
Can't speak to the other "ScrollSnap" and ContentScrollSnap controls
Can you log an issue @mahgo with replication instructions and possibly a sample scene demonstrating the issue, the line renderer (especially the texture version) should work with wrap textures
jefftobler
@jefftobler
Hi All, we are finishing up a large adventure game and wanting to use UUE to insert images into a text block. Maybe a stupid question, but I'm trying to load the package in PackageManager and it is greyed out. I've tried 2019.5 and 2019.1. We are developing using 2019.3.13f1.
Simon (Darkside) Jackson
@SimonDarksideJ
Sorry for the delay in response due to the holidays :S
Can you detail the replication instructions @jefftobler , we test the deployment of the project quite vigorously using 2018, 2019 and when called, 2020
Curious about 2019.5 :D advanced copy? I've been testing specifically with:
  • 2018.4.30
  • 2019.1.14
  • 2019.4.16
  • 2020.1...
Jamjardavies
@Jamjardavies

Not sure if this is known, but I've just created an issue regarding the Content Scroll Snap Horizontal. I know I must be a pain finding issues with this one control :P

https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/issues/362/bug-single-child-in

Simon (Darkside) Jackson
@SimonDarksideJ
Spotted the report @Jamjardavies and thanks for logging it. I Will get it looked at asap
2 replies
frozonnorth
@frozonnorth
Hi, just tried out The Reorderable List. Just to suggest to have position of the dragged elements based of the initial click position in OnBeginDrag() by including an offset.
image.png
image.png
Simon (Darkside) Jackson
@SimonDarksideJ
Great suggestion @frozonnorth , could you log that as an issue of type "proposal" to the Bitbucket repo so it can be picked up in the new year.

A very Merry Christmas and a happy new 2021 to all users of the Unity UI Extensions project. We're truly honored you chose to include us in your project and just as happy it helps you be successful faster and quicker!

If there is something else you need in the UI world, let us know on the BitBucket site and we'd be happy to help.

CortiWins
@CortiWins
Hello folks! I will only ask one question this year, i promise ;-) Does this project have scripts that help with using a gamepad/keyboard via event system in menus? I'm doing okay with scrolling panels now, but getting it to work with the EventSystem seems more complicated.
Simon (Darkside) Jackson
@SimonDarksideJ
Check out the menu sample which is an effective menu system using the event system. How that helps @CortiWins
And don't be a stranger, feel free to chat here @CortiWins
CortiWins
@CortiWins
Happy new year everyone.
I got a strange effect with "UIScrollToSelection" where works on a few Buttons, but theres one Button where the whole scroll panel tries to scroll into negative Y and it flickers around because of that, and i'd love to know what i did wrong because that button has the same configuration as the others.
CortiWins
@CortiWins
Okay. It's not a certain button, but rather the buttons distance from the top border of the content panel + the buttons height. It seems to try to scroll 1/2 of the button height. Now lets see why it does that. Pivots don't seem to be an influence.
CortiWins
@CortiWins

Scenario:

  • Button is set to the top-left (0, 0) of the content panel.
  • The content panel is scrolled to the top border, with a Y-offset of 0.
  • On selecting the button, UpdateVerticalScrollPosition is called
  • selectionPosition is calculated as 0, which looks fine, its at the top.

Then GetScrollOffset is called with the following values

UIScrollToSelection.GetScrollOffset(position = 0, listAnchorPosition = 0, targetLength = 100, maskLength= 708)
And returns the value = 808

Which leads to a change in the verticalNormalizedPosition from 1.0
Before: TargetScrollRect.verticalNormalizedPosition 1.00
After: TargetScrollRect.verticalNormalizedPosition 1.06...

Which in ScrollRect.MovementType == Elastic leads to the flickering movement.

CortiWins
@CortiWins

So in GetScrollOffset() for a position that requires 0 scrolling ( as i see it, correct me if i'm wrong ),
this leads to scrolling of 1 heigth of the control, if there's less than 0.5 height of the control distance the the top border.

if (position < listAnchorPosition + (targetLength / 2))
{
// 808 = ( 708 ) - ( -100)
return (listAnchorPosition + maskLength) - (position - targetLength);
}

CortiWins
@CortiWins
And now i found out that it's a known issue and that there is a replacement that seems to work better in the pull requests. Oh well.
Simon (Darkside) Jackson
@SimonDarksideJ
It's a known issue atm due to some changes in unity somewhere. A simple fix is to change the type of scrollrect to clamped (not elastic or unrestricted) which will stop the jitter
The cause is because when the control reaches the end of the list of children it no longer "stops" which causes the control to constantly try to compensate, which causes the jitter. Still looking in to it, details are logged on bitbucket
The updated control improves the situation but does not 100% resolve it. Working with the original author on a fix
GrayMonkey
@GrayMonkey
Hi All - Happy new year and loving the extension... Has saved me a shed ton of time trying to get UIs working and also allowed me to be a little more/over ambitious with what I'm trying to achieve. I have a question about the Horizontal Scroll Snap which I understand generates the content when its initialised. It is possible to change the content dynamically? i.e. I'm using it to purchase shop items and I want it to change content depending on if Shop content is selected or Game content, plus I also have language toggle filters which also changes the content.
CortiWins
@CortiWins
Hey @GrayMonkey . The class has methods for Adding and Removing game objects and batches of gameObjects. The add-Methods set the gameObjects as Children of the scrollrect and call internal updates. The Remove-Methods unset the parent of the removed objects and give them back as an out-parameter, so you can store them in any other object for later use. For the toggle filter, as the Snap panels deactivates items that are not visible, so just deactivating the gameObject as you would in a standard unity scrollRect will probably not work ( correct me if im wrong here, Simon ), instead you can use the Add and Remove-methods s well.
GrayMonkey
@GrayMonkey
@CortiWins , thanks for the info, had found those methods in the source, but your guidance was very useful. Took some mucking around with the code but I think I have now got it working!
CortiWins
@CortiWins
Nice!
CortiWins
@CortiWins
Well, the improved UIScrollToSelection still has its problems when used in TMP_Dropdown. Wonder how i'm going to solve that.
Nevermind, i'm a moron that tricked himself by having two versions of the script.
CortiWins
@CortiWins
Using Update() to watch for changing variables feels so wrong, but since Unitys Controls doesnt have events for a lot of stuff, i dont see a better way.
Simon (Darkside) Jackson
@SimonDarksideJ
Happy new year to all. Sincere apologies for the delay in responses as I've been avoiding tech for the holidays to take some much-needed rest. But let's crack on as I see some very interesting responses :D