Download presentation
Presentation is loading. Please wait.
1
Adding UI and Audio element Telerik Academy Plus http://academy.telerik.com Unity 2D Game Development
2
1. UI Elements 1.Panels 2.Images 3.Buttons 4.Making A Game Menu 2. Audio 1.Adding Background Music 2.Playing “One-shot” Sounds 2
3
With Buttons And Such!
4
Panel Responsive units Container for other UI elements Add it with GameObject -> UI -> Panel The Panel will be added to the Hierarchy Add image to the panel by dragging it from the Project window You may change the Alpha value of the color of the image 4
5
Button Add a button by GameObject -> UI -> Button Drag it to be child of the Canvas element You may change its color Inside the button there is a Text component Change the text, font and so on Change the anchors of the button to make it responsive Check the Best Fit if you want the font to be responsive 5
6
Add a script for the click events Attach it to some object -> Main Camera is OK Select the Button and add the click event There are other components as well Text Toggle Image More 6
7
Play Music!
8
Create Audio folder in your project Drag’n’drop all audio files you will need Select the files and uncheck “3D Sound” because we do not need it for a 2D game You can add sound clips to any GameObject Just add “Audio Source” component Drag’n’drop a file to that component Select “Play On Awake” and “Loop” if needed 8
9
For background music you can add audio to the camera object For other effect audio clips -> add “Audio Source” to an object Add public AudioClip fields Drag’n’drop the clips you want You can then play them when needed 9 public AudioClip enemyContactSound; audio.PlayOneShot(enemyContactSound);
10
форум програмиране, форум уеб дизайн курсове и уроци по програмиране, уеб дизайн – безплатно програмиране за деца – безплатни курсове и уроци безплатен SEO курс - оптимизация за търсачки уроци по уеб дизайн, HTML, CSS, JavaScript, Photoshop уроци по програмиране и уеб дизайн за ученици ASP.NET MVC курс – HTML, SQL, C#,.NET, ASP.NET MVC безплатен курс "Разработка на софтуер в cloud среда" BG Coder - онлайн състезателна система - online judge курсове и уроци по програмиране, книги – безплатно от Наков безплатен курс "Качествен програмен код" алго академия – състезателно програмиране, състезания ASP.NET курс - уеб програмиране, бази данни, C#,.NET, ASP.NET курсове и уроци по програмиране – Телерик академия курс мобилни приложения с iPhone, Android, WP7, PhoneGap free C# book, безплатна книга C#, книга Java, книга C# Николай Костов - блог за програмиране http://academy.telerik.com
11
C# Programming @ Telerik Academy csharpfundamentals.telerik.com csharpfundamentals.telerik.com Telerik Software Academy academy.telerik.com academy.telerik.com Telerik Academy @ Facebook facebook.com/TelerikAcademy facebook.com/TelerikAcademy Telerik Software Academy Forums forums.academy.telerik.com forums.academy.telerik.com
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.