using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class suofang_control : MonoBehaviour { public Toggle toggle; public Camera camera; public FirstPersonController personController; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } public void suofang(bool change) { personController.enableZoom = !change; if (change == true) { camera.fieldOfView = 20; } } }