add GameObject on Game

December 21, 2012   ·   0 Comments

Screen Shot 2012-12-20 at 10.39.38 PM

public GameObject m_prefab_ball;

void Start () {
gameObject.transform.position=new Vector3(-0.98f,5.7f,0);

for(float y=1;y<=5;y=y+0.6f ){ for(float x=-4;x<=5;x=x+1.2f){ GameObject t_cube = Instantiate(m_prefab_ball, new Vector3(x,y, 0), Quaternion.identity) as GameObject; t_cube.name=”wall”; t_cube.renderer.material.color =new Color(x*50/255f, y*50/255f, 1f); } } }

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