using UnityEngine; public class Zoombtn : MonoBehaviour { public new Camera camera; public float smooth = 0.005f; // The rate of change of the field of view in perspective mode. public float zoom = 0.005f; string zz="o"; public void OnPressDown() { if (this.name== "btnZOOMM") zz = "IN"; if (this.name == "btnZOOMP") zz = "OUT"; } public void OnButtonRelease() { zz = "o"; // DASH.HDsetBTNcolor(false); //DASH.HDsetBTNcolor(true); } public void WhileHolding() { if (zz == "IN") { camera.fieldOfView += smooth; if (camera.fieldOfView > 70) camera.fieldOfView = 70; } if (zz == "OUT") { camera.fieldOfView -= smooth; if (camera.fieldOfView < 30) camera.fieldOfView = 30; } } }