How can I make a layover GUI for Android Unity game - c#

I have made an Android game using Unity, and now for the finishing touch I need a nice GUI, but unlike a GUI that just takes place in a different Unity scene, I would like it to just be a layover in the scene where the game is played. Basically you can see the game in the background, but there is a GUI with some buttons like setting and play. Say you click play, then the GUI would go away and the game would begin. Is this something that can be done in Unity? Any help would be greatly appreciated, thanks!
Bonus question - best way to make a good looking GUI, should I design it myself or should I buy from the Unity Asset Store? Pros and Cons of each?

You just need to create the ui in the same scene as your game using the new unity ui system and the canvas object. Than for example on play button click you just aniamte the ui outside of the visible area or remove it from the canvas.

Related

change scene with a button and also do it with an effect? Unity

I'm new to Unity and my goal is not to make a game, but a mobile application, I don't use the Android SDK because I need to do something with augmented reality and I need to do it with Unity, it's getting quite complicated because I'm not familiar or with the language or with anything, in short, I was able to change scenes by means of a button, like a log that verifies things, but Unity does not have a scene transition effect or something similar, I saw several videos where it can be done a transition, effects and so on, but they are for when you touch a button or touch the screen in this case, I would like to know if there is the possibility of being able to implement an effect after it effectively validates the information and then makes a translation effect to the other scene, is this possible, thanks!
You could use:
SceneManager.LoadSceneAsync
Unity SceneManager.LoadSceneAsync manual
for loading scene while you run your own transition. Fade in/out is the most common transition for such occasions.

How to communicate between 2 scenes in Unity?

I would like to make a color system for my player. In my game scene the player can pick up the coins and the amount of coins will be save with playerprefs , but I don' know how can I use the amount of coins in my menu scene.
And I need some help to a player color selecter too. When the player select a color than in my game scene must instiate the player with the color.
Soo I think , i need to know how to communicate between 2 scenes.
Can somebody help me with some tutorial?
There are multiple ways to achieve this, which I feel comes down to a matter of taste: save data to file, use DoNotDestroyOnLoad...
But from what I understand, the recommended way now is to create a "manager scene" which will stay alive throughout the lifetime of your app and pass data to and from your other scenes as they are opened and closed, instead of using DontDestroyOnLoad:
It is recommended to avoid using DontDestroyOnLoad to persist manager GameObjects that you want to survive across scene loads. Instead, create a manager scene that has all your managers and use SceneManager.LoadScene(, LoadSceneMode.Additive) and SceneManager.UnloadScene to manage your game progress. src
See the Unity guide here. Basically you would have 2 scenes open at the same time, at any given moment: the manager scene and whatever the actual active game scene is. Then you can communicate between scripts in the two open scenes via event delegates. The way it would work is:
Player selects color in scene1
Color is sent from scene1 to manager scene via event delegate
scene1 is unloaded and scene2 is loaded
Color is sent from manager scene to scene2
This is the approach I've been using for a project now which looks like this:
"0-Attract", "1-Sealant", "2-Paint", and "3-Conclusion" are my actual game scenes, and "Manager Scene" contains everything that exists in every other scene (thus no reason to kill and respawn them) as well as all of my "manager" scripts which handle the passing of data between scenes.
Note that multi-scene editing can be confusing at first, as there are new things you need to pay attention to (i.e., which scene is currently "active" and what that means) so be sure to go through the unity guide I posed above. Good luck!
you can Call DontDestroyOnLoad method on any object that you want that will remain wen you are moving the a new scene so it will not be destroyed when scene is closing.

I would like a button that leverage the AAA graphics

I EXPECT FOR MY ENGLISH, BUT I AM USING GOOGLE TRANSLATOR
hi I'm creating a multiplayer game I put the graphics AAA, among these I put the component PostProcessingBehaviour, on the UI menu I made, on the graphics settings, I would like with a button to disable all the components that I put on the camera to make the graphics AAA , for less powerful PCs, so they can play all, to give me an example even to disable the PostProcessingBehaviour via a UI button, then I tried to use onclick, put the camera and put on the "bool enable" works but the game is online , and then it does not work, but if it was offline my problem was solved enough to use the button ui, but with the online I can not of course, what script I could use, the script will have to put on the UI button and disable the script component in this PostProcessingBehaviour case,
how can I do? do you recommend a script? I have little experience and I'm learning, I would need this thing, thanks in advance
IN SHORT WORDS
I would like to know a script that disables the PostProcessingBehaviour component or script from the "camera" object
use language c#
use unity 3d

Unity ingame GUI

I want to create a GUI that could be at the bottom of a player's screen all the time. Not a main-menu UI, but an interactive, in-game UI.
For example:
It is crucial that the player in unity must be able to interact with the UI (i.e. click it) and it is also extremely crucial that the UI can be controlled by code (C#). I must be able to create and control this UI programmatically.
How would I go about this?
I have the very latest version of Unity3d installed.
First of all, you can't learn that here.
1. Learn Basic UI. Go to the Unity website and lean each UI compoent such as Button, Image, Panels...
https://unity3d.com/learn/tutorials/topics/user-interface-ui
2. Learn photoshop/Illustrator to get the good UI quality from the first link or hire a UI artist. Many videos on Youtube for photoshop/Illustrator UI design.
https://www.youtube.com/results?search_query=photoshop+ui+design+tutorial
3. Learn C#. Important Unity API for this:
Unity events
IPointerClickHandler
IPointerDownHandler
IPointerEnterHandler
IPointerExitHandler
IPointerUpHandler
Button.onClick ((Button.onClick event)
Text
Image
Slider
Good luck!

is there a way to make a 3D game in winforms or WPF in C#?

I'm thinking about making a 3D point and click game, is it possible to make one in winforms or WPF? I don't need any physics or anything all I need is to make the application render 3D objects. I know that I can use XNA but if I do then I will have to relearn almost everything again. My third approach would be to make the scenes in a 3D game engine and then print the screen and then load it as a image. Any suggestion would be appreciated.
There's a big difference between a 3D game, and just letting players interact with a rendered image.
Your approach of loading a pre-rendered image is possible to do in both Winforms and WPF. You would just need to capture click events on the image and check the location against your list of active areas. Then just handle what needed to be done, ie: move to the next area, activate item, etc.
Edit from comment:
It's not so much which is friendlier. You can host an XNA viewport in Winforms/WPF. It's more about how you want your game to work. If you never have moving 3D scenes, XNA is overkill, and images will work just fine.
If you want dynamic scenes, you'll need to be able to render them on the fly. Then, XNA makes more sense. It is a lot more work though compared to just displaying images.
If you just want to show pre-rendered 3d images in your game, why not create them using a real 3d graphics tool, such as 3D Studio Max or Maya (or a free one, such as Blender)? It sounds like there's no need for actually rendering the 3d scenes in a game engine at all.

Categories

Resources