- 最后登录
- 2017-5-15
- 注册时间
- 2012-3-1
- 阅读权限
- 90
- 积分
- 32973
- 纳金币
- 32806
- 精华
- 12
|
請高手解答~我要讓敵人enemy碰到物件Player,當敵人enemy碰撞物件Player達到三次時,物件Player會轉換成物件thing請問程式如何寫? 以下是我試寫的 var thing ;
function OnCollisionEnter(theCollision : Collision){ if(theCollision.gameObject.name == "enemy"){ Destroy(gameObject); Instantiate(thing,transform.position,transform.rotation); } else if(theCollision.gameObject.name == "C"){ Debug.Log("Nothing"); }} |
|