- Tutorials
- User Interface (UI)
- Polishing Your Game Menu
Polishing Your Game Menu
Geprüft mit Version: 5.4
-
Schwierigkeitsgrad: Anfänger
In this live training session we will look at adding polish to your game menu including audio, animation and transitions using Unity's UI system.


Polishing Your Game Menu
Anfänger User Interface (UI)
This builds on content created in the Creating a Main Menu live training session which can be found here .
Download the original asset package used here
Get the audio used from the VR Samples package here
LoadOnEnter
Code snippet
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class LoadOnEnter : StateMachineBehaviour {
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
SceneManager.LoadScene (1);
}
}
QuitOnEnter
Code snippet
using UnityEngine;
using System.Collections;
public class QuitOnEnter : StateMachineBehaviour {
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
Quit ();
}
public void Quit()
{
#if UNITY_EDITOR
UnityEditor.EditorApplication.isPlaying = false;
#else
Application.Quit ();
#endif
}
}
Ähnliche Tutorials
- Creating A Main Menu (Lektion)
- Game jam menu template (Lektion)