For That We need to Declare Number of System File Like :
Wednesday, June 29, 2011
Sunday, June 26, 2011
GUI Basics For The Unity3d
Making Controls with UnityGUI
UnityGUI controls make use of a special function called OnGUI(). The OnGUI() function gets called every frame as long as the containing script is enabled - just like the Update() function.Code :
function OnGUI ()
{ // Make a background box GUI.Box (Rect (10,10,100,90), "Loader Menu"); if (GUI.Button (Rect (20,40,80,20), "Level 1"))
{ Application.LoadLevel (1); } // Make the second button. if (GUI.Button (Rect (20,70,80,20), "Level 2"))
{ Application.LoadLevel (2); } }
It Will Look Like This :
Now Controls in GUI :
How To add Lable in GUI ?
--> CODE :
function OnGUI ()
{ GUI.Label (Rect (0,0,100,50), "This is the text string for a Label Control"); }
If you Want to Add Texture2D then it calls like
--> var controlTexture : Texture2D; function OnGUI ()
{
GUI.Label (Rect (0,0,100,50), controlTexture);
}
How To Add Button in GUI Function ??
--> Code :
var icon : Texture2D;
function OnGUI ()
{ if (GUI.Button (Rect (10,10, 100, 50), icon))
{ print ("you clicked the icon"); } if (GUI.Button (Rect (10,70, 100, 20), "This is text"))
{ print ("you clicked the text button"); } }
---
Vivek P Shah
Game Developer in Unity3d
Basics Of Collision and Collider Cont ...
Wheel ColliderThe Wheel Collider is a special collider for grounded vehicles. It has built-in collision detection, wheel physics, and a slip-based tire friction model. It can be used for objects other than wheels, but it is specifically designed for vehicles with wheels. | |||||||||||||||||||||
Properties
| |||||||||||||||||||||
-- Vivek P Shah Game Developer in Unity3d Source : www.unity3d.com |
Subscribe to:
Posts (Atom)