using UnityEngine; using System.Collections; public class nupuliikumine : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once per frame void Update () { } void OnGUI(){ if (GUI.Button (new Rect (310, 10, 80, 20), "Vajuta")) { transform.Translate (Vector3.right); } if (GUI.Button (new Rect (210, 10, 80, 20), "Uus")) { Instantiate(this,new Vector3(this.transform.position.x, 3, 0) , new Quaternion()); } //Lisage teine nupp vasakule liikumiseks if (GUI.Button (new Rect (10, 10, 80, 20), "Vajuta")) { transform.Translate (Vector3.left); } } }