mukarillo / unitydynamicscrollrect Goto Github PK
View Code? Open in Web Editor NEWAn optimized approach to lists with dozens of elements and a Pooling system
License: MIT License
An optimized approach to lists with dozens of elements and a Pooling system
License: MIT License
I know there hasn't been much work done to this in years, but I still figured I'd throw the question your way.
Any chance we can have this updated so that one can add the package through the Package Managers "Add package from git URL"?
If you make a little change and use IList interface instead of info array list, your solution will be prepared for use in new scenarios.
For example, I can't load all information and store it in an array, because it is too big. But if I can use an IList, I can implement a way to load only information which dynamic scroll needs.
Hi
One of the users of the Unity UI Extensions project spotted your control and suggested it would be a good for including in the project.
https://bitbucket.org/UnityUIExtensions/unity-ui-extensions
Would you be ok with your control being uplifted there?
Hi,
I am trying to integrate this into my project. My items are addable and deletable. When I add or delete them, I do this:
public void UpdateList(ItemData[] listData) //updated list of items, could be more, could be less than before
{
if(!dynamicScroll.Initialized) //I added this bool in the DynamicScroll to know if DynamicScroll.Initiate(...) has been called already
{
dynamicScroll.spacing = scrollSpacing;
dynamicScroll.centralizeOnStop = scrollCentralizeOnStop;
dynamicScroll.Initiate(dynamicScrollRect, listData, 0, sceneObjectTemplate);
}
else
{
dynamicScroll.ChangeList(listData);
}
}
It works for adding new items. But when I remove items, the UI elements are not removed (or hidden).
Am I using this right? How do I do this properly?
Hi, first of all, thank you to sharing this great asset.
The thing is that i need to change the start point of the scroll, by this I mean to start at the end of the list, on the last object, therefore on the end of the scrollrect so you can only start scrolling up.
I saw that on the methods Initialize and ChangeList, there is a startIndex that can be set, but if for example i use the mData.Length - 1 instead of 0, it only shows the last object. Looking why this is happening I found that in the CreateList method is no support for using the the max size of a collection. So I proceeded to modify this and add the functionality to iterate from the last object to the first one but it still not working as I want.
Can you guide me what I need to change/modify on the pooling or the refreshing of objects to achieve this ?
Thanks.
Hello,
First, thank you to sharing with us this great project, this is very useful!
Now I would like to apply the same kind of process but for elements inside of a grid layout that is inside a VerticalScrollRect
.
Basically, it the almost same thing instead of I have more than one element by row, and it doesn't seem to work well from now.
I will try to update the code to make this possible, but if you have any advice of how you would do it, it will be great! ๐
I think it's not necessary to add a mono script on each item in scroll list. When driving from monoBehaviour, unity have to execute code in Awake
, which is performance-cost.
As a replacement, I prefer to add a virtual methd in PoolingObject
like:
public GameObject gameObject { get; set; }
public virtual void AttachView(GameObject go)
{
gameObject = go;
}
And call it in Pooling.CreateObject
:
var go = GameObject.Instantiate(referenceOjbct);
var obj = new T();
obj.AttachView(go);
Hi, thanks for this great component.
I want to show a scrollbar on my UI, which can interact with the ScrollRect.
I set a vertical scrollbar to Dynicamic ScrollRect, but the scrollbar did not work properly.
How can I config the scrollbar?
Asset works great from the first look. However I'm missing elastic movement when dragging beyond the end or beginning. Is there a plan to include it?
Hello, i think you might want to add some feature, that will be great: scroll to index
it basically do is that scrolls the scrollview to make the element visible, on center of the scrollRect (if possible), you'll need to pass an index argument to the method and it should animate or jump directly to the scroll position (by an optional bool/speed parameter?)
i have seen that feature in similar assets and i think it will be a great addiction if you can for sure :)
The way that it is implemented today doesn't work very well because it changes the position of objects and the scrollrect.velocity gets messed up, so the scroll gets very fast when the offset happens.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.