Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
Jamjardavies
@Jamjardavies
Anyone know what I'm doing wrong with the ContentScrollSnapHorizontal? I have one in my canvas, with no children until runtime (children are populated using a factory in code) and it gives errors (noticed it was not checking child count or null-checking contentPositions), so fixing these up, I notice that I can't scroll and snap to items. I've tried calling UpdateLayout but this seems to also not make a difference. If I keep 1 item as a child before running the game, it snaps right to the one item, but as soon as my factory adds more, it doesn't allow snapping to any new items, only the first, and now the snapping position is incorrect.
Simon (Darkside) Jackson
@SimonDarksideJ
That is curious @Jamjardavies , as the control has been tested programmatically. Can you raise an issue on the Bitbucket and I'll get this looked at today
Please ensure to include replication steps and, if possible, the script you're using to initialise the control.
Jamjardavies
@Jamjardavies
I'll take a quick look to make sure I'm not doing something silly, but was strange seeing errors when there were no children in the Content transform... I'll remove the changes I've done just in case that caused issues elsewhere...
It would be tricky to share code as it's using Zenject as the main DI, but I can see if I can make a repro in a new project.
Jamjardavies
@Jamjardavies
Okay in my tests on a new project, I've added a "Content Scroll Snap Horizontal" from the create menu, and then removed the 5 children it comes with. I get no errors until I play and stop, to which I notice the ContentScrollSnapHorizontal has set it's enable to false. Upon enabling this component in the editor (in edit mode, not play mode), I start getting error spam in the console. Also, when adding children to the content using Awake, it works, but if I delay it (in Start for instance), it then doesn't work or snap. What I seem to need to do is enable the snap, and update the layout, but this still causes an exception, since there's no children at the start.
Jamjardavies
@Jamjardavies
Note: I also use a Horizontal Layout Group to align the children, that seems to also make it mis-align when adding (most likely due to delay of the layout code)
Simon (Darkside) Jackson
@SimonDarksideJ
Thanks @Jamjardavies , can you please ensure you include all that detail in the issue log on the Bitbucket site.
phil matthews
@flamindelux_twitter

Hi all, firstly thanks for the great tools/extensions!! I am just dipping my toe with the conflict manager and I have a quick question:

Ive prefab'd a horzontal slider (holder) to populate dynamically. Im struggling with trying to set the ParentScrollRect through code in my loop. I have a vertical scroller in the scene awaiting the prefab objects.
Any suggestions of best way to tackle? ps ive used the search and found a post of similar but ultimately not ending in a strategy

Simon (Darkside) Jackson
@SimonDarksideJ

Big push tonight to get some of the finishing touches for the next release of the UI Extensions in, including:

  • New Magnetic Infinite scroll control
  • Programmable goodness added to the UI Knob control to set its value
  • New touchable mask for the UI Knob control to increase the surface area to control the knob (new example too)
  • A few reworked fixed to support 2018, mainly due to the new Input System wrapper
  • Finalised testing and updating of the examples back to 2018

(one day I will remember to only add or fix examples in Unity 2018, because Unity... Backwards compatibility is fun...)

So hopefully should have the 2.2.3 release out shortly after a few last checks through the worklist.

Apologies @flamindelux_twitter , just spotted your message
As ever @flamindelux_twitter . could you log your request as an issue on the Bitbucket repo, and if possible, include a sample (replica?) scene for what you are trying to achieve and include detailed replication instructions.
Simon (Darkside) Jackson
@SimonDarksideJ
Ok, @flamindelux_twitter , done a quick bit of digging and I can see the issue. In fact in your use case you should be seeing a null-reference exception in the log when you try and assign the parent scroll rect through code.
Working on a fix now
Simon (Darkside) Jackson
@SimonDarksideJ
OK, fix pushed to development @flamindelux_twitter , will be in the next release. (or you can grab the development version, just check the UPM docs for information)
Simon (Darkside) Jackson
@SimonDarksideJ
OK, Can replicate your null ref issue @Jamjardavies , will post an issue log from your description above and see what I can do
Simon (Darkside) Jackson
@SimonDarksideJ
@Jamjardavies I've created your issue on the bitbucket site.
https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/issues/354/content-scroll-snap-raises-exception-when
Stay tuned for more details
Simon (Darkside) Jackson
@SimonDarksideJ
And the issue with the ContentScrollSnap is resolved @Jamjardavies and the fix is in the development branch.
Jamjardavies
@Jamjardavies
@SimonDarksideJ Ah sorry, been busy with rapid fast sprints so wasn't able to populate a full repro.
Simon (Darkside) Jackson
@SimonDarksideJ
Well, if it helps, you can check out the changes in this PR which resolves the issue.
https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/pull-requests/103
That way you'll be aligned with the official updates when they drop. ANy issues @Jamjardavies , let me know and I'll update the project if you find something doesn't work for you
There is even a new method that was added, to enable adding items programmatically and have the control still operate as expected, works with both prefabs and code built items
Simon (Darkside) Jackson
@SimonDarksideJ
OK, final call before the next release is pushed. Two pending PR's need some help testing.
Simon (Darkside) Jackson
@SimonDarksideJ
Particle system PR merged, tested on several scenes and works as expected.
Simon (Darkside) Jackson
@SimonDarksideJ
Last PR merged. Any last calls before I kick the next release out?
Simon (Darkside) Jackson
@SimonDarksideJ

Update 2019.5 - 2.3 - Accelerated Deployment

Since the move to UPM, the team have been able to react quicker and push out fixes a lot easier, without affecting previous installation (whilst still adhering to Unity's backwards compatibility pattern). So it is with great news we announce this new release, faster that ever :D (and thanks to UPM, easier to upgrade than ever).
Be sure to also check out the "Examples" option in the Package Manager window to import the samples to your project.

Be sure to logon to the new Gitter Chat site for the UI Extensions project, if you have any questions, queries or suggestions

Much easier than posting a question / issue on YouTube, Twitter or Facebook :D

UIExtensions Gitter Channel

New / updated features

  • Add squircle primitive
  • Adding new magnetic scroll control
  • Added a static library to collate shaders on first use.
  • Finalized new InputManagerHelper, which translates input based on the operating input system, new or old Updated CardStack2D to have defined keyboard input or specific gamepad input over the older axisname for new input system.
  • Examples now included with UPM delivery and available as a button on the UPM package manager window
  • Updated DropDown and Autocomplete controls based on feedback in #204
  • Updated Accordion to support both Vertical as well as Horizontal layout
  • Updated ComboBox controls to improve better programmatic controls
  • Updates to the Infinite scroll to support content of various sizes
  • Updated UI Knob control - enabled dragging outside the target area, added example scene
  • Minor update to MagneticInfinite Scroll
  • Refactored and extended the ContentScrollSnap control
  • Added protection against errors and empty scrollrect content
  • Added new SetNewItems function to add children programmatically to the control and reset accordingly
  • Patch supplied by a contributor to improve the texture sheet use with the UIParticlesystem
  • Added "SetKnobValue" function which allows the setting of Value and loops
  • Added the programmatic capability to change the parent scroll rect on the ScrollConflictManager at runtime.

Examples / Examples / Examples

Examples now have their own package, this simplifies their use and deployment. Especially in 2019 with the UPM deployment.

  • New UI Knob examples
  • New Magnetic Scroll Example
  • Updated ComboBox examples for programmatic testing

Fixes

  • Fix to add a "RequireComponent" to Primitives as Unity 2020 does not add them by default
  • Remove old Examples submodule
  • Updated submodules to hide Examples folder Additionally, updated Package manifest to allow importing of examples direct from UPM package.
  • Fixed hard swipe to ensure it only ever moves one page, no matter how far you swipe.
  • Fixed a conflict when using the ScrollConflictManager in child content of a HSS or VSS
  • Fix for UI Particle system looping
  • Fixed public GoToScreen call to only raise events internally (not multiple)
  • Final roll-up and fix. Resolved race condition for associated pagination controls.
  • Fixed issue with page events not being raised when inertia was disabled (velocity was always zero)
  • When cloned, reorderable list was creating a second List Content component that was not initialized. Refactored to ensure only one list content was present and is initialized correctly
  • Reorderable list items marked as transferable, remain transferable after being dropped
  • Patch to resolve issues without the new Input System installed
  • Refined magnetic scroll and dependencies while documenting Updated example
  • Patch Tooltip
Big thanks to all of the community for their bug reports, new suggestions and requests. Dive in and see what's new (or fixed :D)
The biggest thing I'm happy about is the new Input System Support. Lost a fair few nights sleep working through that drama, but all good now :D
pdeclercq
@pdeclercq
Hey! I found out about this extension a few days ago and it's been game changing. My current game's gameplay is pretty much menus on top of menus and UI wasn't really on point and smooth so thanks a lot for the dedication. I just want to report a very small glitch with the HorizontalScrollSnap (probably with the Vertical one too) where if you ask dynamically to move to an index if you don't deactivate the velocity, it scrolls to the next one (only happened to me at very low velocity). Thanks again for your work !
Simon (Darkside) Jackson
@SimonDarksideJ
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.
papitosan
@papitosan

Hello! It maybe very simple but I can’t get the centered/selected page number in the Horizontal Scroll Snap.

I searched on the web but still not able to get this variable.

Could you tell me step by step how to access this variable from a script?

Thank you very much for this great extension!

Simon (Darkside) Jackson
@SimonDarksideJ
Both the Horizontal and Vertical Scroll snaps have a "CurrentPage" variable, which indicates the currently "snapped" page.
I've noticed the documentation only reflected properties available in the inspector and have updated them to include this property. Sorry for the confusion
https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/wiki/Controls/HorizontalScrollSnap
papitosan
@papitosan
Hey thanks. "To get access to the Current or snapped page in code, use the CurrentPage property details above". So where do I reference this variable? I tried to write "public int CurrentPage" in HorizontalScrollSnap script but without success.
Simon (Darkside) Jackson
@SimonDarksideJ
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; 
    }
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