using System; using UnityEngine; using System.Collections; public class ButtonZoomCap : MonoBehaviour { public Texture zoominpic; public Texture zoomoutpic; public Texture capturepic; public float sW; public float sH; public bool mCap,mZoom; private int screenshotCount = 0; public GameObject teapot; private Vector3 tempScale; void Start () { } // Update is called once per frame void Update () { if (Input.GetKeyDown(KeyCode.Escape)) { Application.Quit(); } } void OnGUI() { if (GUI.Button (new Rect (Screen.width - 100,Screen.height - 70,100,100), zoominpic)) { scaleup(); } if (GUI.Button (new Rect (Screen.width - 200,Screen.height - 70,100,100), zoomoutpic)) { scaledown(); } } private void scaleup(){ teapot.transform.localScale += new Vector3(0.3F, .3F, .3F); } private void scaledown(){ teapot.transform.localScale -= new Vector3(0.3F, .3F, .3F); } }
you're welcome