note

1、随机数:

  NGUITOOLS.RandomRange(0,3);

2、异步加载场景:

  Application.LoadLevelAsyn("abc场景名");

-----------------------------------------------------

AsyncOpration async=Application.LoadLevelAsync("level");

3、任务栏

 Transform【】 allchildren=GetComponetsInChildren<Transform>();

4、生成随机位置(敌人)

IEnumerator EnemyDelay(int a,int b, int c,int d,int e,int f,int g,int h)

{

yieldreturnnewWaitForSeconds(1);

for(int i=0;i<a;i++)

{

Instantiate(chuxian,EnemyPoint[h+i].position,Quaternion.identity);

}

for(int j=0;j<b;j++)

{

Instantiate(chuxian,EnemyPoint[h+a+j].position,Quaternion.identity);

}

for(int k=0;k<c;k++)

{

Instantiate(chuxian,EnemyPoint[h+a+b+k].position,Quaternion.identity);

}

for(int l=0;l<d;l++)

{

Instantiate(chuxian,EnemyPoint[h+a+b+c+l].position,Quaternion.identity);

}

for(int m=0;m<e;m++)

{

Instantiate(chuxian,EnemyPoint[h+a+b+c+d+m].position,Quaternion.identity);

}

for(int n=0;n<f;n++)

{

Instantiate(chuxian,EnemyPoint[h+a+b+c+d+e+n].position,Quaternion.identity);

}

for(int o=0;o<g;o++)

{

Instantiate(chuxian,EnemyPoint[h+a+b+c+d+e+f+o].position,Quaternion.identity);

}

yieldreturnnewWaitForSeconds(2);

 

 

if(NPC!=null)

{

//Debug.Log ("Third Step");

transform.rotation=Quaternion.Slerp (transform.rotation,

Quaternion.LookRotation(new Vector3(NPC.transform.position.x,transform.position.y,NPC.transform.position.z)-transform.position),

rotationSpeed*Time.deltaTime);

}

 

else

{

transform.rotation=Quaternion.Slerp (transform.rotation,

Quaternion.LookRotation(new Vector3(target.transform.position.x,transform.position.y,target.transform.position.z)-transform.position),

rotationSpeed*Time.deltaTime);

}

 

 

 

________________________________________________________________________________

点开始后,进入对应的地图场景,这个level值是怎么传的。

posted @ 2013-10-13 16:55  小薇林  阅读(359)  评论(0编辑  收藏  举报