- 最后登录
- 2019-12-2
- 注册时间
- 2012-8-25
- 阅读权限
- 90
- 积分
- 34660
  
- 纳金币
- 38268
- 精华
- 111
|
我做了一个Zombie测试,主要是模拟Zombie触发灯光的颜色作用,代码是这样的:
function OnTriggerEnter (other : Collider) {
if(other.gameObject.name == "Zombie"){
light.color = Color.green
}
}
function OnTriggerExit (other : Collider) {
if(other.gameObject.name == "Zombie"){
light.color = Color.white
}
}
|
|