PowenKo,Unity Tutorial 143, GameObject, AddComponent

November 30, 2011   ·   0 Comments

add Light

 myLight.AddComponent ("Light");

add Camera

myCamera.AddComponent ("Camera");

add GUI Layer

myCamera.AddComponent ("GUILayer");

add AudioListener

myCamera.AddComponent ("AudioListener");

add script

m_Targets.AddComponent("<script name>");

add and setup light


GameObject  lightGameObjecteffect = new GameObject("The Light");
					        lightGameObjecteffect.AddComponent<Light> ();
							lightGameObjecteffect.light.type= LightType.Spot;
					        lightGameObjecteffect.light.color = t_color; // Color.  // Color.  //Color.red ;
							lightGameObjecteffect.light.range=200;
					        lightGameObjecteffect.transform.position = new Vector3(30, 30, -9);		
							lightGameObjecteffect.light.spotAngle=36;
shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
Unity3D4

Amazon

adsbygoogle

Recent Posts

Categories

Amazon