Book Image

Unity 3 Game Development HOTSHOT

By : Jate Wittayabundit
Book Image

Unity 3 Game Development HOTSHOT

By: Jate Wittayabundit

Overview of this book

<p>Unity 3d is the game engine of choice for creating professional looking games at no cost. Its combination of powerful tools and outstanding community support make it the natural choice for experienced and aspiring game developers. <br /><br />Unity3D Game Development Hotshot will show you how to exploit the full array of Unity3Dtechnology in order to create an advanced gaming experience for the user. It has eight exciting and challenging projects with step- by-step explanations, diagrams, screenshots, and downloadable materials.<br /><br />Every project is designed to push your Unity skills to the very limits and beyond. You will create a hero/heroine for a role playing game. Create a menu for the RPG game allowing you to customize your character with powerups, armor, and weapons. You will shade, model, rig, and animate your hero/heroine. The end result will be a&nbsp; character on the level of Final Fantasy, far superior to a simple sprite.<br /><br />Now for some damage - rocket launchers! Typically the most powerful weapons in any first person shooter, you will create a rocket launcher that has fire and smoke particles and most importantly causes splash damage for that all important area effect. Create AI controlled enemies for your hero/heroine to eliminate with the rocket launcher. Forge&nbsp; a destructible&nbsp; interactive world so if the rocket launchers miss their target they will at least cause significant damage to the surrounding environment. Learn to save and load your game so you can take a break from the action for life’s necessities like going to the bathroom. Incorporate social gaming by uploading scores online so everyone can see the carnage.</p>
Table of Contents (19 chapters)
Unity 3 Game Development HOTSHT
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

ShaderLab properties


From the preceding example code, in the Properties block, we can define the type of properties, as shown in the following table:

Type

Description

name ("display name", Range (min, max)) = number

Defines a float property, represented as a slider from min to max in the Inspector view.

name ("display name", Color) = (number,number,number,number)

Defines a float property, represented as a slider from min to max in the Inspector view.

name ("display name", Color) = (number,number,number,number)

Defines a color property.

name ("display name", 2D) = "name" { options }

Defines a 2D texture property.

name ("display name", Rect) = "name" { options }

Defines a rectangle (non power of 2) texture property.

name ("display name", Cube) = "name" { options }

Defines a cubemap texture property.

name ("display name", Float) = number

Defines a float property.

name ("display name", Vector) = (number,number,number,number)

Defines a four-component vector property.

Each property inside the shader is referenced by name (in Unity, it's common to start shader property names with underscore). The property will show up in material inspector as Display name. For each property a default value is given after the equals sign:

  • For Range and Float properties: It's just a single number

  • For Color and Vector properties: It's four numbers in parentheses

  • For texture (2D, Rect, Cube): The default value is either an empty string, or one of the built-in default textures—white, black, gray, or bump.

Example

Properties { 
  _MainTex ("Texture ", 2D) = "white" {} // textures    

  _SpecColor ("Specular color", Color) = (0.30, 0.85, 0.90, 1.0) // color    

  _Gloss ("Shininess", Range (1.0,512)) = 80.0 // sliders    
}