Skip to content

Building upon our simple Number Wizard guessing game, we add buttons and scenes to create a UI version of the game. This repo is part of our Complete Unity C# Developer 2D course (http://gdev.tv/cudgithub). (Ref: UI_CUD)

License

Notifications You must be signed in to change notification settings

CompleteUnityDeveloper/04-Number-Wizard-UI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Complete Unity Developer 2D - Number Wizard UI

This is the Complete Unity Developer - one of the most successful e-learning courses on the internet! Completely re-worked from scratch with brand-new projects and our latest teaching techniques. You will benefit from the fact we have already taught nearly half a million students game development, many shipping commercial games as a result.

You're welcome to download, fork or do whatever else legal with all the files! The real value is in our huge, high-quality online tutorials that accompany this repo. You can check out the course here: Complete Unity Developer

In This Section

We add interactable user interface and scene loading to our previous Number Wizard guessing game code. (ref: UI_CUD)

How To Build / Compile

Lecture List

Here are the lectures of the course for this section.

1 Welcome To Number Wizard UI

In this video (objectives)…

  1. Overview of this section.
  2. Focus on UI - adding buttons, text, images.
  3. Linking our button functionality with our code.
  4. Creating scenes and loading scenes.

After watching (learning outcomes)… Ready and raring to start this section.

2 Number Wizard UI Game Design

In this video (objectives)…

  1. Reminder of the core guessing game mechanic.
  2. Presentation of our game flow through the main scenes.
  3. Discussion of theme and tone of the game.

After watching (learning outcomes)… Clear on the design objectives for the game.

3 UI Anchors

In this video (objectives)…

  1. Add a button to our canvas.
  2. Add an image to our canvas.
  3. Adjust the stretch and anchor settings so that our UI assets are aligned how we want them to be even if the game is played at different aspect ratios or resolutions.

After watching (learning outcomes)… Capable of implementing UI anchor points works.

4 Making Buttons

In this video (objectives)…

  1. Add mouse over and click effect to our button.
  2. Improve font quality using TextMesh Pro text for the button.
  3. Create 3 scenes, each of which has a button that can be used to load new scenes.

After watching (learning outcomes)… Create nice looking buttons that can be used for awesome functionality.

5 Button Click Loads Scene

In this video (objectives)…

  1. Create public method to load the next scene.
  2. Add build index to scenes.
  3. Hook up start button with LoadNextScene() public method.

After watching (learning outcomes)… Create public method to load next scene, triggered from a button.

6 Load All Scenes

In this video (objectives)…

  1. Create new method to load straight to our first scene.
  2. Hook up all buttons to loading functionality.
  3. Load all scenes.

After watching (learning outcomes)… Load all scenes in our game using buttons.

7 Prepare Game Screen

In this video (objectives)…

  1. Examine our "spec" for the game screen.
  2. Implement all the buttons, text, images required for the game screen.
  3. Ensure all game objects are properly named and ready for action.

After watching (learning outcomes)… Implement UI elements required for our core game from our game design.

8 Import & Refactor Code

In this video (objectives)…

  1. Import our NumberWizard.cs code from previous section of the course.
  2. Assess what needs to be refactored / changed in order to have our code work with our user interface.
  3. Refactor the code including player input mechanism.

After watching (learning outcomes)… Refactor our code so that it is ready to hook up with our user interface.

9 Using ToString()

In this video (objectives)…

  1. Hook up our buttons to the previously created methods.
  2. Link our UI text field to our code.
  3. Use ToString() to convert our integer into a string to be displayed in our text field.

After watching (learning outcomes)… Connect a variable in our code with a text field in our UI.

10 Use Random.Range()

In this video (objectives)…

  1. Use Random.Range() for our guess to introduce randomness.
  2. Refactor our code to only have 1 place of calculating guess.
  3. Tweak our logic to prevent the computer from guessing a number already guessed.

After watching (learning outcomes)… Use Random.Range() to add randomness to the number guessed.

11 Polish & Standalone Build

In this video (objectives)…

  1. Use Application.Quit() to create a quit button for our game.
  2. Add final text, colours and tweaks to the game.
  3. Build to PC, Mac, Linux Standalone.

After watching (learning outcomes)… Create a final PC / Mac / Linux Standalone build.

12 NWUI Instructor Hangout #1

In this video (objectives)…

  1. We discuss namespaces in more detail.

After watching (learning outcomes)… A hangout where Ben and Rick talk about namespaces.

About

Building upon our simple Number Wizard guessing game, we add buttons and scenes to create a UI version of the game. This repo is part of our Complete Unity C# Developer 2D course (http://gdev.tv/cudgithub). (Ref: UI_CUD)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published