Hi there!
I’ve some programming experience but I’m pretty new to unity.
I want to create an advanced interface where i want to simulate a combat phase.
The combat is based on a dice roll.
I’m using the onGui function to handle all the interface stuff. I splitted them in 3 parts: “next turn”, “unit information” and “combat”. I’ve 3 variables to show every part when i need it.
Do you have any link for ngui? Maybe a tutorial…
If possible i want to show the dice rolling, and then compare the two result and decide who win. Every player throws a dice of course, so they have to be synchronised
I think the better way of doing this will be second camera with proper culling mask. On main cam do some fade screen and create second cam to show your dice stuff somewhere in the scene.
I agree that you should use some package like nGUI. Historically Unity GUI/HUD capabilities were limited. nGUI (or comparable GUI packages like Daikon GUI) are on sale all the time if you don’t want to spend the full amount. Just search Asset store. nGUI website (linked from the asset store) has tons of tutorials. nGUI also has a free trial package that you can use to see if it does what you want before spending the money. I bought nGUI a long time ago on sale and so far it did what I wanted. It does have a learning curve though.
There’s also the built-in GUI in the 4.6 beta, if you don’t have need of more than the basic controls. Should it be insufficient, NGUI has a trial version (or possibly older version that is free now).
Probably what I’m gonna do is something very easy like:
Click a button and open the combat interface;
Calculate a random number from 1 to 6 and show an immage of the number as a dice face. Maybe I’m gonna add a “close” button to end the combat phase and close the interface.
The new UI in the Unity 4.6 beta is really great (and free!). It has an excellent set of tutorials. If you don’t mind developing on a beta version until Unity 4.6 is released to production, I recommend it. No sense learning NGUI or the legacy Unity GUI, with their own complexities, if you can use the new UI.
You can create a simple dice-rolling animation in Unity (or six, one for each number) and play that in a UI canvas. The example project animates a spinning rabbit sculpture. Playing the animation for dice would use the same technique.