UNITY GAME DEVELOPMENT Creating an Interactive Character CLASS

  • Slides: 20
Download presentation
UNITY GAME DEVELOPMENT Creating an Interactive Character

UNITY GAME DEVELOPMENT Creating an Interactive Character

CLASS OVERVIEW Unity User Interface Lighting C# Variables Functions Code grouping Creating & adding

CLASS OVERVIEW Unity User Interface Lighting C# Variables Functions Code grouping Creating & adding scripts to Game. Objects Time. delta. Time Rigidbody Character. Controller Input Prefabs Audio & Importing Assets

UNITY USER INTERFACE Creating 3 D Objects Move, Rotate, Scale Inspector Window & Scene

UNITY USER INTERFACE Creating 3 D Objects Move, Rotate, Scale Inspector Window & Scene Hierarchy Adding components Creating Materials

1. Scene Hierarchy 4. Project Window 2. Scene View 5. Game View 3. Inspector

1. Scene Hierarchy 4. Project Window 2. Scene View 5. Game View 3. Inspector Window

3. Application Actions 1. Tools 2. Selected Object Axis 4. Active Axis

3. Application Actions 1. Tools 2. Selected Object Axis 4. Active Axis

LIGHTING Using lighting to create atmosphere (Omni light, Directional Light, . . . )

LIGHTING Using lighting to create atmosphere (Omni light, Directional Light, . . . )

C# Programming language developed by Microsoft Used for AI, Game logics, … Code in

C# Programming language developed by Microsoft Used for AI, Game logics, … Code in Microsoft Visual Studio Used in Unity 3 D

 player. Name health rin Something that stores information st Variable: g VARIABLES name

player. Name health rin Something that stores information st Variable: g VARIABLES name <variabletype> <variablename> = <variablevalue> “John Doe” st ri ng Modifying a variable: name

FUNCTIONS Function / Method: A group of code that can run Save. Game Do.

FUNCTIONS Function / Method: A group of code that can run Save. Game Do. Damage Functions execute code once each time the function is called Function body: Calling a function:

FUNCTIONS void On. Hit() void On. Hit(int damage) Code inside Function just executes the

FUNCTIONS void On. Hit() void On. Hit(int damage) Code inside Function just executes the function reduces health int Get. Enemy. Count() int Searches the map for enemies and returns the # Code inside the function reduces Function executes AND Needs Input health by <damage> int Double. Value(int value) int Function executes AND returns value int Code inside the function Function executes AND needs input doubles <value> and returns it

CODE GROUPING In C#, all code is grouped, and sub-grouped. For this we use

CODE GROUPING In C#, all code is grouped, and sub-grouped. For this we use curly brackets. { = opening curly bracket } = closing curly bracket My. Game Program My. Function My. Other. Function

CREATING & ADDING SCRIPTS TO GAME OBJECTS Start, Update (+ Awake, Fixed. Update, .

CREATING & ADDING SCRIPTS TO GAME OBJECTS Start, Update (+ Awake, Fixed. Update, . . . ) On. Trigger. Enter, On. Trigger. Exit Instantiating & Destroying Game. Objects from scripts Accessing variables from the Editor (public, private, serializable)

TIME. DELTATIME Time. delta. Time = time between updates Update() has a variable. Time.

TIME. DELTATIME Time. delta. Time = time between updates Update() has a variable. Time. delta. Time Fixed. Update() has a fixed Time. delta. Time 5 FPS = 5 Frames per Second 60 FPS = 60 Frames per Second

RIGIDBODY Collisions & Triggers Physics using Rigidbody & Add. Force On. Trigger. Enter and

RIGIDBODY Collisions & Triggers Physics using Rigidbody & Add. Force On. Trigger. Enter and On. Trigger. Exit

CHARACTER CONTROLLER Using a Character Controller to control and move a character

CHARACTER CONTROLLER Using a Character Controller to control and move a character

INPUT Detecting Player. Input (Mouse movement and Key presses)

INPUT Detecting Player. Input (Mouse movement and Key presses)

JUMPING LOGICS Applying gravity constantly vs. Applying gravity at a variable intensity

JUMPING LOGICS Applying gravity constantly vs. Applying gravity at a variable intensity

PREFABS Creating assets for instancing and updating scene

PREFABS Creating assets for instancing and updating scene

AUDIO & IMPORTING CUSTOM ASSETS Playing sounds / Music using Audio. Source and Audio.

AUDIO & IMPORTING CUSTOM ASSETS Playing sounds / Music using Audio. Source and Audio. Clips

Q&A Do you have any questions related to the topics mentioned?

Q&A Do you have any questions related to the topics mentioned?