纳金网

标题: 触发改变灯光颜色的代码 [打印本页]

作者: 狂风大尉    时间: 2012-10-30 03:29
标题: 触发改变灯光颜色的代码
我做了一个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

       }

}

作者: may    时间: 2012-11-30 19:08
支持楼主的帖子




欢迎光临 纳金网 (http://go.narkii.com/club/) Powered by Discuz! X2.5