├── .gitignore ├── Assets ├── Scenes.meta ├── Scenes │ ├── Game.unity │ ├── Game.unity.meta │ ├── Start Menu.unity │ ├── Start Menu.unity.meta │ ├── Win Screen.unity │ └── Win Screen.unity.meta ├── Scripts.meta └── Scripts │ ├── LevelManager.cs │ ├── LevelManager.cs.meta │ ├── NumberWizards.cs │ └── NumberWizards.cs.meta ├── LICENSE ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NavMeshLayers.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityAdsSettings.asset └── UnityConnectSettings.asset └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | *.sln 2 | *.userprefs 3 | *.csproj 4 | *.pidb 5 | *.unityproj 6 | .DS_Store 7 | /Library/ 8 | /obj 9 | /Temp 10 | /Builds 11 | /build/ 12 | 13 | -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 55cdeecc3c60642f68a8843be0a6bdaa 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Scenes/Game.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-UI-Original/f4b08b77fedcc73ac7e31c8762ead6d2d76861a9/Assets/Scenes/Game.unity -------------------------------------------------------------------------------- /Assets/Scenes/Game.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1b27f666f5e65459c8be59eaf27acbfb 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Scenes/Start Menu.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-UI-Original/f4b08b77fedcc73ac7e31c8762ead6d2d76861a9/Assets/Scenes/Start Menu.unity -------------------------------------------------------------------------------- /Assets/Scenes/Start Menu.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7fb2975dcf29a4142a061d5e32644c94 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Scenes/Win Screen.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-UI-Original/f4b08b77fedcc73ac7e31c8762ead6d2d76861a9/Assets/Scenes/Win Screen.unity -------------------------------------------------------------------------------- /Assets/Scenes/Win Screen.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 14c4ccf78295b44a4b81771a29ac16ba 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 285764bb993064e12b12abb921291bcb 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Scripts/LevelManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class LevelManager : MonoBehaviour { 5 | 6 | public void LoadLevel(string name){ 7 | Debug.Log ("New Level load: " + name); 8 | Application.LoadLevel (name); 9 | } 10 | 11 | public void QuitRequest(){ 12 | Debug.Log ("Quit requested"); 13 | Application.Quit (); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Assets/Scripts/LevelManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 914b8a75977ed47209fdf798a93ddac3 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/NumberWizards.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEngine.UI; 4 | 5 | public class NumberWizards : MonoBehaviour { 6 | 7 | public Text guessText; 8 | 9 | int max = 1000; 10 | int min = 1; 11 | int guess; 12 | 13 | void Start () { 14 | StartGame(); 15 | } 16 | 17 | void StartGame () { 18 | max = max + 1; 19 | NextGuess(); 20 | } 21 | 22 | public void GuessHigher(){ 23 | min = guess; 24 | NextGuess(); 25 | } 26 | 27 | public void GuessLower(){ 28 | max = guess; 29 | NextGuess (); 30 | } 31 | 32 | public void GuessCorrect(){ 33 | StartGame (); 34 | } 35 | 36 | void NextGuess () { 37 | //guess = (max + min) / 2; 38 | guess = Random.Range(min, max); 39 | print ("Next guess is " + guess); 40 | guessText.text = guess.ToString(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Assets/Scripts/NumberWizards.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bae0d8fef852e4029bcf349613c0a911 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 EmbraceIT Ltd 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-UI-Original/f4b08b77fedcc73ac7e31c8762ead6d2d76861a9/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-UI-Original/f4b08b77fedcc73ac7e31c8762ead6d2d76861a9/ProjectSettings/ClusterInputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-UI-Original/f4b08b77fedcc73ac7e31c8762ead6d2d76861a9/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-UI-Original/f4b08b77fedcc73ac7e31c8762ead6d2d76861a9/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-UI-Original/f4b08b77fedcc73ac7e31c8762ead6d2d76861a9/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-UI-Original/f4b08b77fedcc73ac7e31c8762ead6d2d76861a9/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-UI-Original/f4b08b77fedcc73ac7e31c8762ead6d2d76861a9/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-UI-Original/f4b08b77fedcc73ac7e31c8762ead6d2d76861a9/ProjectSettings/NavMeshAreas.asset -------------------------------------------------------------------------------- /ProjectSettings/NavMeshLayers.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-UI-Original/f4b08b77fedcc73ac7e31c8762ead6d2d76861a9/ProjectSettings/NavMeshLayers.asset -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-UI-Original/f4b08b77fedcc73ac7e31c8762ead6d2d76861a9/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-UI-Original/f4b08b77fedcc73ac7e31c8762ead6d2d76861a9/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-UI-Original/f4b08b77fedcc73ac7e31c8762ead6d2d76861a9/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.3.2f1 2 | m_StandardAssetsVersion: 0 3 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-UI-Original/f4b08b77fedcc73ac7e31c8762ead6d2d76861a9/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-UI-Original/f4b08b77fedcc73ac7e31c8762ead6d2d76861a9/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-UI-Original/f4b08b77fedcc73ac7e31c8762ead6d2d76861a9/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /ProjectSettings/UnityAdsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-UI-Original/f4b08b77fedcc73ac7e31c8762ead6d2d76861a9/ProjectSettings/UnityAdsSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CompleteUnityDeveloper/Number-Wizard-UI-Original/f4b08b77fedcc73ac7e31c8762ead6d2d76861a9/ProjectSettings/UnityConnectSettings.asset -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Complete Unity Developer - Section 4 - Number Wizard 2 | 3 | This is the [Complete Unity Developer](http://gdev.tv/cudgithub) - 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 over 360,336 students game development, many shipping commercial games as a result. 4 | 5 | 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](http://gdev.tv/cudgithub) 6 | 7 | ## In This Section 8 | 9 | ### Introduction To User Interface ### 10 | 11 | In this section, we will go through building a basic User Interface consisting 12 | of simple menus. We'll be reusing the code from our previous section to 13 | recreate a visual Number Wizard game. After this section, you'll be able to 14 | add and modify scripts on objects in your game and create simple menus that 15 | respond to mouse input. 16 | 17 | ### Section 4 Game Design Document ### 18 | 19 | The Game design Document for the Number Wizard UI Game. 20 | 21 | ### Section 4 Notes ### 22 | 23 | These notes are meant as supplementary material for Number Wizard UI. 24 | 25 | ### About Objects And Classes ### 26 | 27 | In this video, we discuss basic Object Oriented Programming principles and 28 | introduce you to the terminology. By the end, you will be able to define the 29 | following terms in the context of Object Oriented Programming: 30 | + Class 31 | + Instance 32 | 33 | **Resources** 34 | + [SOLID (object-oriented design) - Wikipedia, the free encyclopedia](https://en.wikipedia.org/wiki/SOLID_(object-oriented_design)) 35 | 36 | ### Creating and Saving Levels ### 37 | 38 | After Watching this video, you will be able to 39 | + Create and Save new Levels 40 | + Understand that Levels and Scenes are interchangeable terms 41 | 42 | ### How To Add Text To The Scene ### 43 | 44 | After watching this video, you will be able to: 45 | + Add a Canvas to a scene 46 | + Add Text to a Canvas 47 | + Position Text in a Canvas 48 | 49 | ### Adding a Start Button ### 50 | 51 | After watching this video you will be able to... 52 | + Turn a UI Text object into a button by adding the button component 53 | + Get the text to change colour on mouseover and click 54 | 55 | ### Calling Scripts from Buttons ### 56 | 57 | After watching this video you will be able to: 58 | + Create a new script 59 | + Attach Scripts to objects using various methods 60 | + Trigger function calls from UI buttons 61 | 62 | ### How To Load Scenes and Quit ### 63 | 64 | After watching this video you will be able to: 65 | + Use `Application.LoadLevel()` in your scripts to load a new level 66 | + Use `Application.Quit()` in your games to quit the game 67 | + Understand when `Application.Quit()` Won't work as expected 68 | 69 | ### Using A Game Design Document ### 70 | 71 | After watching this video you will be able to: 72 | + Create your own Game Design Document (GDD) 73 | + Copy and paste scenes hierarchies for fast duplication 74 | + Understand the purpose and limits of a GDD 75 | 76 | ### Importing Previous Number Wizard Script ### 77 | 78 | After watching this video you will be able to... 79 | + Import assets into a Unity project 80 | + Extract method from your code 81 | + Connect a script's methods to UI Objects 82 | 83 | ### Old Number Wizard Code ### 84 | 85 | The `NumberWizard.cs` file to be imported for reference. 86 | 87 | ### Finishing Number Wizard UI ### 88 | 89 | After watching this video you will be able to... 90 | + Change the text to reflect the computer's guess at the start of the game. 91 | + Use `Random.Range()` to generate random numbers 92 | 93 | ### NW UI Unity 5 & Web GL Sharing (Optional) ### 94 | 95 | + Upgrade to Unity 5. 96 | + About Web GL builds. 97 | + Build for Web GL and share. 98 | 99 | ### DOWNLOAD Section 4 Unity Project ### 100 | 101 | 102 | 103 | ### Section 4 Wrap Up ### 104 | 105 | In this video, we talk a little more about the structure of the course and how 106 | you should approach the challenges. We also show you how you can send us 107 | feedback on the course and how to get in touch with us. 108 | --------------------------------------------------------------------------------