プレーヤーの視野角を変更できるようにする


右クリックでズームアップ
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ViewController : MonoBehaviour {
private Camera cam;
void Start ()
{
cam = GetComponent<Camera>();
}
void Update()
{
// マウスの右クリックを指定
if (Input.GetMouseButton(1))
{
// 数値は自由に調整してください。
cam.fieldOfView = 15;
}
else
{
cam.fieldOfView = 60;
}
}
}



EscapeCombat
他のコースを見る

右クリックでズームアップ
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ViewController : MonoBehaviour {
private Camera cam;
void Start ()
{
cam = GetComponent<Camera>();
}
void Update()
{
// マウスの右クリックを指定
if (Input.GetMouseButton(1))
{
// 数値は自由に調整してください。
cam.fieldOfView = 15;
}
else
{
cam.fieldOfView = 60;
}
}
}



プレーヤーの視野角を変更できるようにする