//類似2.5D遊戲畫面捲動方式
private var mouseH : float;
private var mouseW : float;
var rollSpeed : float ;
function Update () {
mouseW = Input.mousePosition.x;
mouseH = Input.mousePosition.y;
if(mouseW+10 > Screen.width){
Camera.mainCamera.transform.position.x += rollSpeed;
}
if(mouseW < 1){
Camera.mainCamera.transform.position.x -= rollSpeed;
}
if(mouseH+10 > Screen.height){
Camera.mainCamera.transform.position.z += rollSpeed;
}
if(mouseH < 1){
Camera.mainCamera.transform.position.z -= rollSpeed;
}
}
private var mouseH : float;
private var mouseW : float;
var rollSpeed : float ;
function Update () {
mouseW = Input.mousePosition.x;
mouseH = Input.mousePosition.y;
if(mouseW+10 > Screen.width){
Camera.mainCamera.transform.position.x += rollSpeed;
}
if(mouseW < 1){
Camera.mainCamera.transform.position.x -= rollSpeed;
}
if(mouseH+10 > Screen.height){
Camera.mainCamera.transform.position.z += rollSpeed;
}
if(mouseH < 1){
Camera.mainCamera.transform.position.z -= rollSpeed;
}
}
留言
張貼留言