UNITY WORKSHOP. Unity Editor. Programming(Unity Script)

Similar documents
Google SketchUp/Unity Tutorial Basics

Game Design Unity Workshop

Game Design Unity Workshop

if(input.getkey(keycode.rightarrow)) { this.transform.rotate(vector3.forward * 1);

Unity3D. Unity3D is a powerful cross-platform 3D engine and a user friendly development environment.

Unity Scripting 4. CS 491 / DES 400 Crea.ve Coding. Computer Science

Setting up A Basic Scene in Unity

Workshop BOND UNIVERSITY. Bachelor of Interactive Multimedia and Design. Asteroids

IAT 445 Lab 10. Special Topics in Unity. Lanz Singbeil

Game Design Unity Workshop

Tutorial: Using the UUCS Crowd Simulation Plug-in for Unity

Transforms Transform

Auto Texture Tiling Tool

Auto Texture Tiling Tool

Cláudia Ribeiro PHYSICS

Adding a Trigger to a Unity Animation Method #2

Introduction to Unity. What is Unity? Games Made with Unity /666 Computer Game Programming Fall 2013 Evan Shimizu

Pong. Prof Alexiei Dingli

CS248 Lecture 2 I NTRODUCTION TO U NITY. January 11 th, 2017

Tutorial Physics: Unity Car

Easy Decal Version Easy Decal. Operation Manual. &u - Assets

OxAM Achievements Manager

Basic Waypoints Movement v1.0

Pong in Unity a basic Intro

Unity Game Development

Unity introduction & Leap Motion Controller

Terrain. Unity s Terrain editor islands topographical landscapes Mountains And more

Coin Pusher Pro Asset - README

Planet Saturn and its Moons Asset V0.2. Documentation

Game Design From Concepts To Implementation

Terrain. Unity s Terrain editor islands topographical landscapes Mountains And more

Bonus Chapter 10: Working with External Resource Files and Devices

Index. Allan Fowler and Philip Chu 2017 A. Fowler and P. Chu, Learn Unity 2017 for ios Game Development,

OculusUnityMatlab Documentation

UFO. Prof Alexiei Dingli

STEP 1: Download Unity

COMS W4172 : 3D User Interfaces Spring 2017 Prof. Steven Feiner Date out: January 26, 2017 Date due: January 31, 2017

MIXED REALITY (AR & VR) WITH UNITY 3D (Microsoft HoloLens)

This allows you to choose convex or mesh colliders for you assets. Convex Collider true = Convex Collider. Convex Collider False = Mesh Collider.

Introduction to Unreal Engine Blueprints for Beginners. By Chaven R Yenketswamy

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Unity

C# for UNITY3d: Sem 1 a.k.a. The Gospel of Mark Part 1

Mechanic Animations. Mecanim is Unity's animation state machine system.

MIXED REALITY (AR & VR) WITH UNITY 3D (Microsoft HoloLens)

Class Unity scripts. CS / DES Creative Coding. Computer Science

CMSC 425 Programming Assignment 1, Part 2 Implementation Notes

The Shadow Rendering Technique Based on Local Cubemaps

User Guide. v1.0. A-Lab Software

Dice Making in Unity

Extract from NCTech Application Notes & Case Studies Download the complete booklet from nctechimaging.com/technotes

Creating and Triggering Animations

3dSprites. v

Pick up a book! 2. Is a reader on screen right now?! 3. Embedding Images! 3. As a Text Mesh! 4. Code Interfaces! 6. Creating a Skin! 7. Sources!

UI Elements. If you are not working in 2D mode, you need to change the texture type to Sprite (2D and UI)

MaxstAR SDK 2.0 for Unity3D Manual. Ver 1.2

Visual Novel Engine for Unity By Michael Long (Foolish Mortals),

How to add new 3D Models to Machines Simulator 3 & Machines Simulator VR

You can also export a video of what one of the cameras in the scene was seeing while you were recording your animations.[2]

Table of contents. Introduction. Having finally realized your ambitious plans for a game, you might face big performance

8K Earth, Moon and Mars Shaders Asset V Documentation

Merging Physical and Virtual:

ANIMATOR TIMELINE EDITOR FOR UNITY

NOTTORUS. Getting Started V1.00

IAP Manager. Easy IAP Workflow. Copyright all rights reserved. Digicrafts 2018 Document version Support

Creating the Tilt Game with Blender 2.49b

Chart And Graph. Features. Features. Quick Start Folders of interest Bar Chart Pie Chart Graph Chart Legend

About the FBX Exporter package

User Manual. Version 2.0

When you tag an object as static batched, then Unity will group that object in with other objects that share the same material.

MANAGING MODS Imported mods are located in:..\[steamlibrary]\steamapps\common\purefarming \ PureFarming_Data\StreamingAssets\IMPORTER\mod

Vuforia quick install guide. Android devices and Unity 3D models edition

PSD to Mobile UI Tutorial

3D Starfields for Unity

Workshop BOND UNIVERSITY Bachelor of Interactive Multimedia and Design Beginner Game Dev Character Control Building a character animation controller.

User Manual. Contact the team: Contact support:

8iUnityPlugin Documentation

User Manual. Luciano Rasente Asset Repository

Outline. CE318: Games Console Programming Lecture 3: 3D Games and Cameras. Outline. 3D Vectors. Diego Perez. 3D Principles. 3D Models.

Spell Casting Motion Pack 5/5/2017

VEGETATION STUDIO FEATURES

+ Typed Message [Vlissides, 1998]

Section 28: 2D Gaming: Continuing with Unity 2D

Tutorial: Getting Started - Flow Graph scripting

Quick Setup Guide. Date: October 27, Document version: v 1.0.1

Pacman. you want to see how the maze was created, open the file named unity_pacman_create_maze.

C# in Unity 101. Objects perform operations when receiving a request/message from a client

Damaging, Attacking and Interaction

Assignment 4: Flight Simulator

DAZ Page 1. DAZ3D to Unity (Objects and Clothing)

Mobile Touch Floating Joysticks with Options version 1.1 (Unity Asset Store) by Kevin Blake

User Manual v 1.0. Copyright 2018 Ghere Games

Contents Interior Mapping & Transistions... 1

Creating a 3D Characters Movement

INTRODUCTION 3 SYSTEM REQUIREMENTS 4 PACKAGE CONTENT 4 CHANGELOG 4 FAST GUIDE 8 PSD2UGUI IN DEPTH 12 PSD LAYERS STRUCTURES 14

DEVELOPERS MANUAL. Philip SUPER HAPPY FUN FUN INC Research Blvd. Suite C-220 Austin, TX, 78759

Lec 10 MEL for Dynamics

Introducing Autodesk Maya Chapter 2: Jumping in Headfirst, with Both Feet!

Sviluppo Di App Mobile Per Augmented Reality

Dialog XML Importer. Index. User s Guide

GAM 223 Game Design Workshop. Project 3D Maze Level Design DUE DATE: / / Design, Modeling & UV unwrapping

Transcription:

July, 2018 Hayashi UNITY WORKSHOP Unity Editor Project: Name your project. A folder is created with the same name of the project. Everything is in the folder. Four windows (Scene, Project, Hierarchy, Inspector), customizable layout. Everything is managed by "Object" (GameObject). Let's create "Object": Create "Cube" (right click on Hierarchy pane) View operation: FirstPersonShooter WASD key F key AroundObject Gizmo (xyz-coordinate, etc.) Operate "Object": Translate Rotation Scale Basic operation is: To attach "Component" to an "Object" then to operate the Component on Inspector pane. Camera view: Setup a camera Lighting: Directional light Point light Shadow Skybox etc. Let's run the program (scene): Be aware of Scene mode/game mode Save scene: Scene change available (level design) Programming(Unity Script) Let's add a C# script to "Asset", then open it with "Mono develop" (or Visual Studio). Start() and Update() functions. File name has to coincide with Class name (otherwise error) Let's move the object by giving: transform.position = new Vector3(Mathf.Sin (Time.time), 2, 0); Attach the script to an object then play it Try getting errors in a code. Debug (simplest): Display variables by "Debug.Log( xxx );" Let's rotate the object: transform.rotation = Quaternion.AngleAxis(Time.time, new Vector3(0,0,1)); Let's scale the object: transform.localscale = new Vector3(Mathf.Sin (Time.time), 1, 1); Save the scene, build, then Run.

Basic function Physics: Attach "RigidBody" component to an object. Try dropping it. Try adding a sphere and slant the floor to see the ball rolling out. Hierarchy structure (Parenting): Make a "kokeshi" with a ball and a cube. Create an empty object and drag the ball and the cube. Then add RigidBody to the parent object. Prefab: Create a prefab of the "kokeshi". Just drag the "kokeshi" in the Hierarchy pane and drop onto the Project pane. Instantiate a prefab: Just drag the prefab in the Project pane onto the Hierarchy pane. Let's create many instantiated objects then drop them all. Physic material : Right click on the Project pane to make a "Physic material" then drag it to a "Collider" component. Same as doing to the floor also. Check out how the object moves by adjusting "Bounce" and "Friction". Instantiate a prefab by Unity Script: public GameObject ballprefab; // Drag the prefab to the " ballprefab " in advance GameObject ball = (GameObject)Instantiate(ballPrefab, transform.position, Quaternion.identity); Give velocity to the ball: ball.getcomponent<rigidbody>().velocity = transform.up * 10.0f; Input and GUI // Keyboard, Mouse, Joystick, etc. void Update () { if (Input.GetKeyDown(KeyCode.Space)) { Debug.Log("HIT!"); // Button, Label, Checkbox, Text input, Slider, etc. void OnGUI () { if( GUI.Button(new Rect(10, 10, 100, 20), "PUSH") ) {

Debug.Log("PRESSED"); Appearance Material: Create in the project pane (right click on "Assets" pane). Coloring and Texturing, etc. Texture: Drag an image file on the Assets pane then set it to "Albedo" in the material. Import model: Asset Store: Download then use it. Easiest way. Free or Pay. Primitives: Assemble the primitives in the UnityEditor. DIY: Model your object by appropriate modeling tool such as Maya, Blender, etc. Export the model as a FBX or 3ds(or other) file then drag it to the Assets for importing. Add sound: Drag your sound files to the Assets and play it back. It needs an AudioSource component and an AudioListener component. Customize your buttons and texts: Use "GUIStyle": e.g. GUI.Label(Rect position, string text, GUIStyle style); You can drag and drop font files to import. You can store your player preferences by using "PlayerPrefs". Finally build it to make the executable. You can build it for any platform such as Windows, MAC, Linux, ios, Android etc. simply by changing the "Build platforms". You can change the platform by "Switch platform" in the BuildSettings. You may need to install necessary modules for the build. Most of them are free. Check out "Edit~ProjectSettings~PlayerSettings" when building. Trouble shooting Google it. Retrieve the similar question in the community "Unity Answer". Ask by yourself in "Unity Answer" (English)

Join "Unity ユーザー助け合い所 " of Facebook and ask in Japanese. Ask your friend. Ask your teacher. Workout:"Bowling game" Create a floor, a pin and a ball by Primitives then attach RigidBody to the pin and the ball, then add Physic material to the floor, the pin and the ball and adjust Bounce etc. Create a prefab of the ball, then Instantiate it in Unity Script, then give a velocity to the ball and roll it on the floor. Change the direction of the ball throw: this.transform.rotation = Quaternion.AngleAxis (90, new Vector3 (1, 0, 0)) * Quaternion.AngleAxis (-10 * dir, new Vector3 (0, 0, 1)); Use "Quaternion" for rotation. Use multiplication for a series of rotations around axis. In the above example, it rotates around Z-axis after the rotation around X-axis. Aware of multiplying order. When you change the throwing position: this.transform.position = new Vector3 (0, 0, -10); Obtain a Mouse position: Use "Input.mousePosition.x", "Input.mousePosition.y" If you want to normalize by a screen size, use "Screen.width" to get the screen size. Make enable to set the pins: Create an empty Game Object (e.g. pins) and drag all the pins to the object. Then drag the "pins" to "Assets" to make a prefab. When you set the group of pins, call "Instantiate()" to instantiate the prefab (like below). Drag the "pins" prefab to the "pinobj" in advance. GameObject pins = (GameObject)Instantiate(pinobj, new Vector3 (0, 0, -10), Quaternion.identity); Make a button to set the pins: void OnGUI () { if( GUI.Button(new Rect(10, 10, 100, 20), "PIN") ) // Instantiate the pins

Clean up the pins: Destroy(pins); To judge whether the pin fall or remain: Get a child "pin" by calling foreach (Transform child in pins.transform); Then check its orientation by using "child.eulerangles.x". Add a score: Display the score by "Label" of GUI. and so on...