纳金网

标题: Unity3D 简单相机切换 [打印本页]

作者: yeu1233    时间: 2012-8-22 12:00
标题: Unity3D 简单相机切换
var camera0 : Camera; //定义一个名字为camera0的相机对象

var camera1 : Camera; //定义一个名字为camera1的相机对象
function Update ()

{

  if (Input.GetKey ("1")) //如果敲击键盘的"1"

  {

    camera1.enabled = ***e; //camera1激活

    camera0.enabled = false; //camera1停止

  }

  if (Input.GetKey ("0")) //如果敲击键盘的"0"

  {

    camera1.enabled = false; //camera1停止

    camera0.enabled = ***e; //camera1激活

  }

}





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