Academy PRO: Unity 3D. Environment

20
Unity 3D Environment binary-studio.com

Transcript of Academy PRO: Unity 3D. Environment

Page 1: Academy PRO: Unity 3D. Environment

Unity 3DEnvironment

binary-studio.com

Page 2: Academy PRO: Unity 3D. Environment

Contents

1. Intro

2. IDE

3. Main Windows

4. Creating Gameplay

Page 3: Academy PRO: Unity 3D. Environment

Intro

1. Popular (More than 10 years)

2. Multi-platform (Console, PC, Mac, Web, Mobile)

3. User friendly (Big community, Asset Store)

4. Languages (JS, C#, Boo)

Page 4: Academy PRO: Unity 3D. Environment

IDE

Page 5: Academy PRO: Unity 3D. Environment

IDEVisual Studio Integration (Express, Professional)

Monodevelop Integration (IOS, Android remote debugging)

Sublime Integration (Unity3D Syntax Highlighting, Unity3D Snippets and Completes)

Page 6: Academy PRO: Unity 3D. Environment

Main Windows

Page 7: Academy PRO: Unity 3D. Environment

Main Windows

Page 8: Academy PRO: Unity 3D. Environment

Creating gameplay

1. Scenes

2. GameObjects

3. Components

4. Transforms

5. Lights

6. Cameras

7. Inputs

8. Triggers

Page 9: Academy PRO: Unity 3D. Environment

Scenes

1. View - container of objects.

2. Level - level of game, menu, individual menu and other.

3. Asset - binary file.

Page 10: Academy PRO: Unity 3D. Environment

GameObjects

1. 3D Objects

2. 2D Object

3. Lights

4. Audio

5. UI

6. Camera

Page 11: Academy PRO: Unity 3D. Environment

Components

1. Mesh

2. Effects

3. Physics / Physics 2D

4. Audio

5. Layout

6. UI

7. Scripts

Page 12: Academy PRO: Unity 3D. Environment

Transforms

Position - X, Y, Z

Rotate - X, Y, Z

Scale - X, Y, Z

Page 13: Academy PRO: Unity 3D. Environment

Lights

1. Point light - sends light out in all directions.

2. Directional light - the sun.

3. Spot light - sends light to one direction.

4. Area light

Page 14: Academy PRO: Unity 3D. Environment

Lights

Light’s properties:

1. Range

2. Color

3. Intensity

4. Shadow

Page 15: Academy PRO: Unity 3D. Environment

Cameras

1. Projection (Perspective, Orthographic)

2. Background

3. Depth

Page 16: Academy PRO: Unity 3D. Environment

Inputs

Axe’s properties:

1. Name

2. Negative/Positive button

3. Gravity

4. Sensitivity

5. Snap

6. Invert

7. Type

Page 17: Academy PRO: Unity 3D. Environment

Triggers

Components -> Physics -> xxx Collider -> IsTrigger

Main events:

1. OnTriggerEnter(Collider coll)

2. OnTriggerStay(Collider coll)

3. OnTriggerExit(Collider coll)

*Needs Rigidbody (Character controller).

Page 19: Academy PRO: Unity 3D. Environment

Home Task

1. Create maze. (Add colors and lights)

2. Create movable controller. (Sphere or capsule)

3. At the end of the way create trigger which removed floor under the controller.

4. (Optional) Add camera to the controller and turn it with A and D keys.

Page 20: Academy PRO: Unity 3D. Environment

Move Characterpublic class MoveController : MonoBehaviour { public float speed = 6.0F; public float jumpSpeed = 8.0F; public float gravity = 20.0F; private Vector3 moveDirection = Vector3.zero; void FixedUpdate() { CharacterController controller = GetComponent<CharacterController>(); if (controller.isGrounded) { moveDirection = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical")); moveDirection = transform.TransformDirection(moveDirection); moveDirection *= speed; if (Input.GetButton("Jump")) moveDirection.y = jumpSpeed; } moveDirection.y -= gravity * Time.deltaTime; controller.Move(moveDirection * Time.deltaTime); }}

public class MoveRigidbody: MonoBehaviour{ public float speed; private Rigidbody rb; void Start() { rb = GetComponent<Rigidbody>(); } void FixedUpdate() { float moveHorizontal = Input.GetAxis("Horizontal"); float moveVertical = Input.GetAxis("Vertical"); Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical); rb.AddForce(movement * speed); }}