Search Unity

New UI Widgets

Discussion in 'Assets and Asset Store' started by ilih, Feb 11, 2015.

  1. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Thanks for prompt response :)
     
    Last edited: Sep 25, 2021
  2. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Update: @ilih
    I think im making some mistake, so ill wait for beta upload on your site with working example.
    Thanks
     
  3. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,413
    Please check Examples / ScrollRectUtilities / DoubleCarousel scene at v1.15.2b1
     
    jGate99 likes this.
  4. KitBarry1809

    KitBarry1809

    Joined:
    Jun 27, 2018
    Posts:
    34
    I want to modify TreeViewCustomDropSupport CanRecieveDrop to accept drops as children of existing nodes only. Is there a way to test if the drop position is as a child or a node?
     
  5. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,413
    You can check the
    Parent
    property; it is null for the root nodes.
    vae is_child = Node.Parent != null;


    And if I understand your problem correctly, you can remove the DropSupport component from the TreeView and use only DropSupport on nodes; the downside of this solution is nodes cannot be reordered.
     
    Last edited: Sep 26, 2021
  6. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Hi @ilih,
    I streched carousel game object to cover parent size and playing the scene dont have image until you click it
    and these errors started to appear as well

    upload_2021-9-26_13-11-25.png
     
  7. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,413
    It's not a critical error, you can ignore it for now.
    Will be fixed in the next beta.
     
    jGate99 likes this.
  8. KitBarry1809

    KitBarry1809

    Joined:
    Jun 27, 2018
    Posts:
    34
    Yep, that's why I want to modify the CanRecieveDrop method ;) Thanks for the quick reply.
     
  9. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,413
    Fixed in v1.15b2
     
    jGate99 likes this.
  10. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Hi @ilih

    ListViewAutoResize doesnt seem to work if items are fewer. ListView is inside Custom Content Dialog.

    Please advise

    upload_2021-10-8_0-38-40.png
     
  11. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,413
    Is ListView height under layout group control?

    Something like this:
    ListView has parent game object Content with "Vertical Layout Group" and enabled control child height option
    upload_2021-10-7_23-53-5.png
     
    jGate99 likes this.
  12. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Its this:
    BTW, first time it appears fine, then i show more items in list so it hit max size, then i provide less items and then it become smaller (way smaller than its original items)
    upload_2021-10-8_19-44-6.png
     
  13. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,413
    Please show result of
    ListView.PrintDebugInfo()
    .
    Is a resize bug happens if the same ListView is used outside dialog?
     
  14. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943


    Direction: Vertical
    Type: ListViewWithVariableSize
    Virtualization: True
    DataSource.Count: 5
    Container Size: (368.2, 266.3)
    Container Scale: (1.0, 1.0, 1.0)
    DefaultItem Size: (368.2, 1.0)
    DefaultItem Scale: (1.0, 1.0, 1.0)
    ScrollRect Size: (368.2, 30.0)
    Looped: False
    Centered: False
    Precalculate Sizes: True
    DisplayedIndices (count: 5): 0; 1; 2; 3; 4
    Components Indices (count: 5):
    0 DefaultItem(Clone): 0
    1 DefaultItem(Clone): 1
    2 DefaultItem(Clone): 2
    3 DefaultItem(Clone): 3
    4 DefaultItem(Clone): 4
    StopScrollAtItemCenter: False
    ScrollCenterState: None
    ScrollPosition: 0
    ScrollVectorPosition: (0.0, 0.0)
    #############
    **Renderer Info**
    IsTileView: False
    Max Visible Items: 7
    Visibility
    Visibility.FirstVisible: 0
    Visibility.LastVisible: 5
    Visibility.Items: 5
    First Visible Index: 0
    Last Visible Index: 6
    List Size: 25
    Items Per Block: 1
    Top Filler: 0
    Bottom Filler: 0
    Items
    0. size: (368.2, 1.0); position: 0; block: 0
    1. size: (368.2, 1.0); position: 6; block: 1
    2. size: (368.2, 1.0); position: 12; block: 2
    3. size: (368.2, 1.0); position: 18; block: 3
    4. size: (368.2, 1.0); position: 24; block: 4
    #############
    **Layout Info**
    Layout: EasyLayout
    RectTransform.size: (368.2, 266.3)
    localScale: (1.0, 1.0, 1.0)
    Main Axis: Horizontal
    Type: Compact
    Group Position: UpperLeft
    Row Align: Left
    Inner Align: Top
    Compact Constraint: MaxColumnCount
    Compact Constraint Count: 1
    PaddingInner: Padding(left: 0, right: 0, top: 0, bottom: 0)
    Spacing: (0.0, 5.0)
    Margin Symmetric: True
    Margin: (0.0, 0.0)
    TopToBottom: True
    RightToLeft: False
    Skip Inactive: True
    Reset Rotation: False
    Children Width: DoNothing
    Children Height: SetPreferred
    Children: DefaultItem(Clone): (368.2, 49.3)
    DefaultItem(Clone): (368.2, 49.3)
    DefaultItem(Clone): (368.2, 49.3)
    DefaultItem(Clone): (368.2, 49.3)
    DefaultItem(Clone): (368.2, 49.3)
    UnityEngine.Debug:Log (object,UnityEngine.Object)
    UIWidgets.ListViewBase:printDebugInfo () (at Assets/New UI Widgets/Scripts/ListView/ListViewBase.cs:1389)
    ARow.UI.Controls.ListViews.AuGUIListViewActionSheet:Update () (at Assets/Spark/Arrow/ARow/Foundation/UI/AuGUI/ListViews/ActionSheet/AuGUIListViewActionSheet.cs:66)
     
  15. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,413
    Problem because actual item sizes and item sizes received by ListView do not match.

    What Unity version are you use?
    Please check the scene in the attached package, is the problem reproduced with it?
     

    Attached Files:

  16. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Thanks @ilih for providing unmatched support
     
    ilih likes this.
  17. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Hi @ilih
    Can you please provide modal color property for SideBar
     
  18. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,413
    added in v1.15.2b4
     
    jGate99 likes this.
  19. gkfls2206_unity

    gkfls2206_unity

    Joined:
    Aug 19, 2020
    Posts:
    5
    When building after updating from 14.1 to 15.1,
    Native extension for Android target not found
    Native extension for WebGL target not found
    Native extension for Windows Standalone target not found
    error comes out and cannot be build. Do you know the solution?
     
  20. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,413
    Please show the full console log or Editor.log file, there should be more detailed infromation.
     
  21. gkfls2206_unity

    gkfls2206_unity

    Joined:
    Aug 19, 2020
    Posts:
    5
    Upload a copy of the Editor.log file. There are no errors in the console log.
     

    Attached Files:

  22. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,413
    You are using assembly definition, but it also includes the "Scripts / Style / Editor" folder with the editor scripts.
    You need to create a separate assembly with references to UnityEditor and original assembly for this folder or move those scripts outside the assembly.

    And found this error:
    Probably you added the "ScrollToCustom" method to TreeViewCustom.cs or ListViewCustom.cs, but those changes were lost with the package update.
     
    Last edited: Oct 13, 2021
  23. gkfls2206_unity

    gkfls2206_unity

    Joined:
    Aug 19, 2020
    Posts:
    5
    I knew the second error and I don't think the Editor.log file is up to date. I'll check it again and post it. Thank you.

    As ilih said, moving the script/style/editor makes it a build. Thank you so much.
     
  24. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Hi @ilih

    [1] Can you please add a parameterless constructor to ButtonConfiguration as well as its child classes like
    Notification/DialogButtons

    Reason is, currently I create and cache the instances and reuse them by only changing label and their Func depedning on the need.


    Update:
    [2] After wasting considerable time, i found the bug in notify
    If we set our own button in button templates, it doesnt get drawn
    I simply supplied my own button template to notify in your test notify button sample.
    Please check

    Thanks
     
    Last edited: Oct 14, 2021
  25. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,413
    I'll add it in the next update.

    Please show code how are you change buttons templates?
    Make sure that buttons game objects are inside the notification hierarchy; otherwise they not be visible.
     
    jGate99 likes this.
  26. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,413
    Added in v1.15.2b5

    I added the ButtonsContainer option to the Notification, use it to specify where buttons should be located.
     
    jGate99 likes this.
  27. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    thanks and its working :D
     
  28. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Hi @ilih

    Please provide an optimized version of tooltip, which reused across places.

    For example, i want to show tooltip on buttons progammaticaly, and instead of placing multiple tooltips everywhere it'd be great if i could do something like that,

    var myGenericToolTipJustLikeDialogOrNotifi = tootipManager.showToolTip(buttonTransform, Position.OnTop);
    myGenericToolTipJustLikeDialogOrNotifi.SoIcanDoCustomFunc();

    Regards
     
  29. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    upload_2021-10-17_17-36-28.png
    like this
     
  30. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,413
    OK.
     
    jGate99 likes this.
  31. KitBarry1809

    KitBarry1809

    Joined:
    Jun 27, 2018
    Posts:
    34
    I have a TreeView with TreeViewItems with a unique string id (using GUID). Is there a function I can use to return me the TreeViewItem with a particular id? If not, what's the best way to search all the nodes & their children ? (or is Tree.Nodes actually just a flat list I can go through with a simple loop?)
     
  32. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,413
    You can use
    TreeView.FindNode()

    Code (CSharp):
    1. var node = FindNode(node => node.Item.guid == guid);
     
    KitBarry1809 likes this.
  33. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Hi @ilih
    I'm having serious trouble with ComboBox 's list view that depends on ParentCanvas
    First, please make it public so i can set it on runtime

    Secondly issue is i'm using Zenject which uses a ProjectPrefab (DontDestroyonLoad), where i place it
    then i instantiate it inside a scene (copy) but when i click on it list is not where to be found and when it appears it keeps moving from





    upload_2021-10-18_0-39-59.png
     
  34. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Update 2: So i manually set the canvas but list is appearing way outside of the canvas
    Please advise

    upload_2021-10-18_0-45-27.png
     
  35. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,413
    I'll do it in the next update.

    Please show both hierarchy and ListView RectTransform in the closed state and opened state (when it is outside the canvas).
     
  36. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Opened State
    upload_2021-10-18_1-27-53.png

    Closed State

    upload_2021-10-18_1-28-48.png
     
  37. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,413
    ListView.RectTransform values are not on screenshots.

    Is ListView correctly positioned in the editor mode?
    Why is a closed ListView under the Combobox hierarchy?
     
  38. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Yes its correctly positioned, and
    If i place component (which contains combo) manually in canvas where i need it and play then it works fine

    Problem starts to happen when i instantiate a copy which is on a different canvas (using Zenject Project Prefab), to another canvas and set its parent canvas on runtime
    I tried to regenerate it on your sample scene but failed.

    upload_2021-10-18_8-21-25.png
     
  39. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,413
    Original canvas and new canvas have the same Render mode or different?
     
    jGate99 likes this.
  40. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Rendermode are same, i tried with different canvas scale mode but couldnt regenerate on your sample scene
    seems like its only regenerable if i go all the way with zenject project prefab
    for now i started using a manually placed combobox component, so you can ignore it for now, we can come up back it hurts again
     
  41. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Hi @ilih

    Double Carousel applies alpha on slides, can you make it optional
    So we can disable alpha when we dont need it just like we can customize scale we should be able to customize alpha

    Similarly scale is only for images, can we also have it for text slide?

    Ideally we should set "Graphics" (more than one just like DefaultItem) so we can apply scale on multiple items and alpha on multiple items
     
  42. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Hi @ilih
    I onced mention that carousel swiping is not as smooth as https://daniellochner.itch.io/unity3d-assets this asset
    and you replied that i can customize it using Movement Curve, but i'm failing to get same result
    Can you please update sample which works as smooth as scroll snap
    Thanks
     
  43. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,413
    You can replace the ScaleAndFade method with the following code and then specify your own function with the CustomScaleAndFade field.
    Code (CSharp):
    1.         public System.Action<RectTransform, float> CustomScaleAndFade;
    2.  
    3.         protected virtual void ScaleAndFade(int index, float ratio)
    4.         {
    5.             var page = ReverseContent.GetChild(index) as RectTransform;
    6.             if (CustomScaleAndFade != null)
    7.             {
    8.                 CustomScaleAndFade(page, ratio);
    9.             }
    10.             else
    11.             {
    12.                 ScaleAndFade(page, ratio);
    13.             }
    14.         }
    15.  
    16.         protected virtual void ScaleAndFade(RectTransform page, float ratio)
    17.         {
    18.             var scale = Mathf.Lerp(1f, Scale, ratio);
    19.             page.localScale = new Vector3(scale, scale, scale);
    20.  
    21.             var graphic = page.GetComponent<Graphic>();
    22.             var color = graphic.color;
    23.             color.a = 1f - ratio;
    24.             graphic.color = color;
    25.         }
    and then use it like this:
    Code (CSharp):
    1.        carousel.CustomScaleAndFade = MyScaleAndFade;
    2.  
    3.         void MyScaleAndFade(RectTransform page, float ratio)
    4.         {
    5.             var slide = page.GetComponent<DoubleCarouselSlide>();
    6.  
    7.             var scale = Mathf.Lerp(1f, Scale, ratio);
    8.             foreach (var label in slide.Labels)
    9.             {
    10.                 label.localScale = new Vector3(scale, scale, scale);
    11.             }
    12.  
    13.             foreach (var graphic in slide.Graphics)
    14.             {
    15.                 var color = graphic.color;
    16.                 color.a = 1f - ratio;
    17.                 graphic.color = color;
    18.             }
    19.         }
    20.  
    21.         public class DoubleCarouselSlide : MonoBehaviour
    22.         {
    23.             [SerializeField]
    24.             public Graphic[] Graphics;
    25.  
    26.             [SerializeField]
    27.             public RectTransform[] Labels;
    28.         }

    Please try this movement curve:
    Code (CSharp):
    1. Paginator.Movement = AnimationCurve.EaseInOut(0f, 0f, 0.3f, 1f);
    0.3 is how much time animation take in seconds, default value is 1, you can try to decrease it even more.

    Also, you can try to open curve editor in inspector mode and try other options, but you will need to decrease lime after the change.
    upload_2021-10-19_17-2-21.png
     
    jGate99 likes this.
  44. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Hi @ilih,

    I'm facing this problem in original double carousel, when i play it then carousel appears like that, however when i click and slide on it that slide instantly appear fine
    upload_2021-10-20_8-13-27.png

    Secondly how do i programmatically jump (without animtation) to a slide (for example first slide)
    This i believe will also solve above bug

    Please advise
     
    Last edited: Oct 20, 2021
  45. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Please do let me know once this is in the plugin so i can test it
     
  46. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,413
    added in v1.15.2b6 with demo scene DoubleCarouselCustomized.

    You can use
    Paginator.SetPage(Paginator.CurrentPage);

    This method was added in v1.15.2b6.
     
    jGate99 likes this.
  47. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Amazing man :D
     
  48. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Hi @ilih,
    I'm able to reproduce this issue on DoubleCarouselCustomized,
    Either download this exported double carousel OR

    1- Set Carousel Game Object to take full size (Stretch, 0 across all sides)

    2- Set prefered height to for Vertical to Unconstraint for "Content" of both viewports, because i want slide to take full height.

    3- play, and you will see the issue
     

    Attached Files:

  49. ilih

    ilih

    Joined:
    Aug 6, 2013
    Posts:
    1,413
    fixed in v1.15.2b7
     
  50. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,943
    Hi @ilih

    [1]
    One thing that i love about new Ui widgets is that you are putting extra effort in making it mobile efficient. I noticed that DoubleCarousel is doing GetcomponentCall. It'd be great if you can provide a generic version like dialog/notify <T> to avoid garbage every time.


    [2] Second question is,
    If you check this sample
    upload_2021-10-21_21-6-0.png

    and then move your mouse from top left edge to right edge, you will notice only 1 slide moves at a time

    However, in double carousel, i can start from one slide and move to last slide with just one mouse swipe.
    If its not clear i can send a video recording.

    Thanks