InvexGames / MaterialUI

MaterialUI is a UI kit for Unity that follows Google's official material design guidelines.
http://invexgames.com/materialUI.html
Other
771 stars 200 forks source link

Component: Dialogs #41

Open nah0y opened 9 years ago

nah0y commented 9 years ago

I had to fix 2 of the 3 popups because they were using outdated buttons. The popup examples are great, but I think that that's what they are, popup examples. They are examples of popups people can create and have in their scene to call.

What would be way better, is to create a bunch of different dialog types (see below), and allow users to call them via code (same thing than the Toasts). Because if you have 200 different dialogs in the game, you will certainly not create all of them in the scene and just display them.

So, once thing awesome, would be to have a DialogManager, on which there is multiple public methods to display different dialogs, such as :

And even better, it could be just 3 different prefabs, the first one for the basic things, the second for the select, and the third for image select. And we could have just one public method call for each, that requires title, text, button1, button2, and if you pass null to one of them, we do not display the title, or do not display 1 or all the buttons etc...

All of these dialogs will have a scrolling by default? Like, if the content is bigger than the height of the screen, it become scrollable? I don't know :/

And if someone wants to use a custom dialog, either he will use one that he already added in the scene, or better, we could add a public method, that take a Resources name as parameter, such as: DialogManager.ShowCustomDialog("MyGreenListDialog") it would maybe return the gameObject that has just been instantiated. So users can just have MyCustomDialogManager for example, and do what they want with it inside (we could provide one as example).

What do you think about all that? Do you want to do it? Or should I? :)