A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Assets and Asset Store' started by ilih, Feb 11, 2015.
Thanks a lot
I want to know if your UI elements work with the popular Curved UI asset used in the official Unity tutorial.
Unfortunately, I do not have VR device to check it, but all widgets use Image, RawImage, and Text (all of them supported by Curved UI) so should work fine.
Exceptions are TreeGraph and Connectors because they use custom Graphic component but should be easy to fix them to work with Curved UI.
I ve got a TreeView with the multiselect option enabled (see image)
what I d like to do is :
in the case of multiselected items, if the user click on one Eye toggle, it should send the same click event on every others selected item.
is there any way to do it ?
You can add a callback on Eye click to process all selected nodes:
public class ProcessEyeClick : MonoBehaviour
public TreeView Tree;
public void ProcessSelectedNodes()
// do something with selected node
var component = Tree.GetItemComponent(x.Index);
if (component != null) // not visible component will be null
// do something with component
"ProcessSelectedNodes()" should be attached to DefaultItem.Eye.
Hi, any news about the stable release?
Released. Will be available in Asset Store after approving.
TextMesh Pro support and Data Bind support enabled with menu "Project Settings / UIWidgets / Enable <package> support"
Added styles support (Styles folder, new styles can be created from context menu "Create / UIWidget - Style")
Added widget generation (context menu "Create / UIWidget - Widgets" on file with item class definition)
Added DateTime, Time24 and Time12 widgets
Added DateTimePicker and TimePicker widgets
Added ColorPickerRangeHSV widget
Added ColorsList widget to display list of the selected colors, should be used with ColorPicker or ColorPickerRange
Added "Data Bind for Unity" support (requires Unity 5.6 or later)
Added base ListView Picker class for the custom ListView
Added base TreeView Picker class for the custom TreeView
Added base drop support class for the custom TreeView
Added base drop support class for the custom TreeView node
Added assembly definitions
Improvement: Drag can be canceled with Cancel button
Accordion: added AllItemsCanBeClosed option
Autocomplete: added GetInputFieldText() function
Calendar: added DateMin and DateMax properties
Calendar: added currentDateAsDefault option
ColorPicker: added Hex block
ColorPicker: added new palette mode HSVCircle
ColorPickerRange: DefaultShader replaced with DefaultShaderHorizontal and DefaultShaderVertical
Connectors: now works correctly with "Screen Space - Camera"
EasyLayout: reduced memory allocations
EasyLayout: EasyLayout namespace renamed to EasyLayoutNS to avoid problems with Unity 2018.2 and later
Interfaces: IItemWidth, IItemHeight, IListViewItemHeight, IListViewItemWidth not used anymore
ListView: added CenterTheItems property
ListView: added overridable functions CanBeSelected() and CanBeDeselected()
ListView: added LoopedList option
ListView: added Interactable option
ListView: added IsTable option (required to valid stylization)
ListView and TileView: ListViewCustomWidth, ListViewCustomHeight, TileViewCustom and TileViewCustomSize replaced with ListViewCustom with List Type option
ListViewCustomWidth: TItem now does not require IItemWidth implementation
ListViewCustomHeight: TItem now does not require IItemHeight implementation
ListViewDropIndicator: added styles support
ResizableHeader: fixed resize on touch devices
Sidebar: added OnOpeningStarted and OnClosingStarted, called when appropriated animation started
other: prefabs in "Sample Assets" folder replaced with scenes
other: "Standart Assets" folder renamed to "Scripts"
other: "Sample Assets" folder renamed to "Examples"
other: removed ListViewGameObjects prefab
other: removed outdated prefabs and sprites
other: namespace "UIWidgetsSamples" renamed to "UIWidget.Examples"
It seems that the version for Unity 2018.2.4 has a 0 size package
Again made a typo in a filename.
I m on 2018.2.14f1 using the new UIwidget.
the treeview sample is not working.
any ideas ?
sorry to be a pain but i m using uiwidget a lot for your great treeview...
I tried to use treeview with textmeshpro and i ve got this :
It's an error in v1.10.0f1 and fixed in v1.10.0f2 - TestTreeView component has attached the wrong TreeView gameobject (TreeViewWithColumns instead TreeView)
Are you enable TextMesh Pro support from the menu? Or just import package?
If you import package you need to enable support from the menu or add "UIWIDGETS_TMPRO_SUPPORT" in Player Settings to "Scripting Define Symbols"
I installed 1.10f2 and still error with Treeview with textmesh pro.
if you use right click and add treeview like this :
you ll get the wrong treeview :
Please try to do the following thing:
open TreeViewComponentTMPro.cs and add a line public int a; after the line "public TextMeshProUGUI TextTMPro;"
then wait until Unity recompile scripts
and try to create TreeView from the menu again - now it's should work
now the line public int a; can be deleted
I made some checks and look like Unity is some cases does not recompile scripts until they directly edited.
public int a;
yep it works.
all the links were gone. I filled them easily.
but when i click on run i ve got this
it seems there is no probleme without textmesh pro
Probably create widgets from the menu will be faster - after fixing the error links should be correct, but if links are broken better reimport package.
There is TreeView (or ListView) with unspecified DefaultItem, click on error should select this gameobject in hierarchy window.
@ilih please povide a new buiild that works with Unity 2018.3 beta
I'm unable to enable support for TMPro due to new unified project settings.
Probably you just miss it, with 2018.3 beta becomes two "Project Settings" menu, use the second to enable TMPro support.
@ilih, hello. I see that ListViews can work with unevenly sized content. Do they have the ability to act like the OSX dock, with its "tsunami" effect? If not, is this something you'd plan to implement?
Sorry, I don't have any experience with OS X.
Please explain more: is it such tsunami effect? When item size is changed with distance to cursor?
I can try to reproduce it.
@ilih, yes that is exactly the effect. Thank you for your effort!
I added tsunami effect in the new beta v1.10.1b2
It's a separate script attached to DefaultItem gameobject.
Wow, thank you for being so responsive! I will give this a try tonight.
I've a problem with ListView in 1.10. I have some list under some canvases that start inactive, and those lists don't seem to initialize correctly, most of the time the problem is in visualization (the viewport appears smaller than it should be) and also if I add some objects by code, while still inactive, I can have an ArgumentOutOfRangeException. Is something changed from 1.9?
No, there should be no changes that cause such behavior.
Viewport appears smaller because it's size changed or his own scale or one of the parents gameobjects scale are changed?
Please show full stack trace for ArgumentOutOfRangeException.
This is mostly really nice, though It does have one problem so far. If you notice, the last item(s) on the list might never be able to scroll up into view because the tsunami seems to shift items downward no matter where in the visible rect they are. If it were possible to shift items above the pointer upwards, and items below the pointer downwards, it would probably be correct.
That said, I understand the difficulty of that in a scrollable list view. This effect might be best for a static, non-scrolling list with a known number of entries.
I'll try to add scroll compensation for tsunami effect.
@ilih Can you please add a "selected" color in toggle? currently ugui toggle has normal, highlighted, pressed and disabled but not selected. SelectableHelper could also have that feature too.
How "selected" color should be used? If you want to change color when Toggle is On state then you change checkmark image with required color.
For example, this is toggle, world is selected but friends is not
when i say toggle, i mean using ugui's toggle as radio buttons
If you just add it "SelectableHelper" , so normal will be for a radio which is not selected but "selected" will be used for radio which is actually selected
I added scroll compensation, please try v1.10.1b4
I'll think about it, not sure if this possible.
1. Toggles will work as radio button if you set same Toggle Group.
2. To make text selected you need to duplicate text and change text color then set original text as Toggle.TargetGraphic and selected text as Toggle.Graphic instead checkmark.
ListView: added ScrollTo(item) and ScrollToAnimated(item) functions
Paginator: added StopAnimation() function
ListViewPaginator: fixed toggle direction problem
TreeView: added ScrollTo(node) and ScrollToAnimated(node) functions
TreeView: added FindNode() function
TreeView: now ScrollTo(..) and ScrollToAnimated(…) correctly work with node indentation
Widget Generation: added interface types support
Widget Generation: fixed property support
I get following errors when I show ColorPicker. Did I set up something wrong?
Trying to remove PaletteCursor (UnityEngine.UI.Image) from rebuild list while we are already inside a rebuild loop. This is not supported.
UIWidgets.ColorPickerHSVPalette:UpdateView() (at Assets/New UI Widgets/Scripts/ColorPicker/ColorPickerHSVPalette.cs:497)
UIWidgets.ResizeListener:OnRectTransformDimensionsChange() (at Assets/New UI Widgets/Scripts/Utilites/ResizeListener.cs:55)
Trying to remove Palette (UnityEngine.UI.Image) from rebuild list while we are already inside a rebuild loop. This is not supported.
What Unity version you use?
It's not a critical error and you can ignore it.
The problem caused by an old fix for Unity 5.2 (sprites was not updated after shader variable changed and fix disable and enable objects back to update sprites) and later versions and not needed at least since Unity 2017.1.
Here is fix:
Replace lines in files ColorPicker/ColorPicker*.cs
#if UNITY_5_2 || UNITY_5_3 || UNITY_5_3_OR_NEWER
#if (UNITY_5_2 || UNITY_5_3 || UNITY_5_3_OR_NEWER) && !UNITY_2017_1_OR_NEWER
Or update to v1.10.2b3
#if UNITY_5_2 || UNITY_5_3 || UNITY_5_3_OR_NEWER
#if (UNITY_5_2 || UNITY_5_3 || UNITY_5_3_OR_NEWER) && !UNITY_2017_1_OR_NEWER
Any infinite scroll or something that can handle a lot of items more efficiently, and provides good system for adding items into it... and maybe removing from certain indexes?
Infinite scroll not possible, but you can make ListView looped.
ListView creates game objects to display only visible items, so it works very efficiently unless items have variable size like strings with different lines count. Because the sizes of items are precalculated it can became a problem with long initialization for huge lists.
ListView.DataSource have the same interface as List<T>.
aah shame... yeh I have strings that would be going into these where the line count will definitely vary a bit
I found https://github.com/qiankanglai/LoopScrollRect which looked really good for an example .. but actually using it in a project is just a mess that would need taking apart as there is no real api for adding things, just a good demo project really. Maybe you could implement similar with better api
I plan to add an option to disable precalculate items sizes for such lists with the next update.
Calculations will use default size until item displayed then size will be replaced with actual item size.
beta works fine.
how can i use UnityEventTools.AddBoolPersistentListener with switch component as editor script so i dont have to manually drag n drop?
Something like this:
// required data
var target = your_object;
var method_name = "SomeMethod";
var listener = switch_object.OnValueChanged;
// adding listener
var method = UnityEventBase.GetValidMethodInfo(target, method_name, Type.EmptyTypes);
var method_delegate = Delegate.CreateDelegate(typeof(UnityAction), target, method) as UnityAction;
This is using reflection, cant i use a non-reflection method so i dont have to provide string based method, something like this?
public static void AddPersistentListener(this Button button, UnityAction onClickHandler)
Ideally i want to send switch as sender like this using 2nd approach
void AddSwitchListener(Switch target, UnityAction<Switch> listener)
UnityEventTools.AddObjectPersistentListener<Switch>(target.OnValueChanged, listener, target);
public void TestAttach()
public void TestSwitch(Switch sender)
Debug.Log("Switch value: " + sender.IsOn);
I liked LayoutSwitcher and how it works, However i'm unable to meet my objective due to hard coded nature of aspect ratios.
What i prefer is following workflow:
- I add layout switcher.
- I add aspect ratios myself, in my case 2 (portrait and landscape)
- i save the objects and thats it.
another workflow is
I added 3 aspect ratios or "ranges"
where 3:4 will be used if aspect is either 3:4 or less than it
16:9 will be used if aspect is either 16:9 or greater than it
anything else appear in 9:16
These workflows will make it layout switcher very extensible. If you could add those features, it'd be great.
Please explain how are you compare aspect ratios?
3:4 = 0.75
9:16 = 0.5625
16:9 = 1.78
And 3:4 are real? Maybe 4:3 - it's a TV standard and 16:9 HDTV standard.
I can add an option to choose an appropriate aspect ratio with a custom function instead of hardcoded.
So i have a portrait game for iOS n Android, but it will also be playable on desktop (as landscape)
So what i want is that on mobile aspect ratios (portrait)
such as (3:4 as portrait ipad pro etc) which is kind of square have different rectransform settings
and on (9:16 as portrait) which is quite long rectangular shape (iPhoneX) i will have different rectransform setting
but on desktop 16:9 (landscape) ill have different values.
importnat thing is i myself able to add aspect ratio values 9:16 portrait and 16:9 landscape and layout switcher automatically falls between min, middle and max like bootstrap.
I added "LayoutSelector" field which selects the required layout in v1.10.2b7:
/// Test layout switcher.
public class TestLayoutSwitcher : MonoBehaviour
public LayoutSwitcher Switcher;
public void Start()
Switcher.LayoutSelector = Selector;
UILayout Selector(List<UILayout> layouts, float displaySize, float aspectRatio)
if (aspectRatio < 1f) // portrait mode
// select all portrait layouts greater then current aspect ratio and then select layout with lowest aspect ratio
var layout = layouts.Where(x => x.AspectRatioFloat >= aspectRatio).OrderBy(x => x.AspectRatioFloat).FirstOrDefault();
if (layout != null)
// landscape mode
return layouts.Where(x => x.AspectRatioFloat >= 1f).OrderBy(x => Mathf.Abs(aspectRatio - x.AspectRatioFloat)).FirstOrDefault();