My goal currently is to make a tile in my game that when you click on it, it opens up a GUI that allows you to click on a unit type and it spawns on the tile. I’m not too experienced at writing my own code so I am currently strugling with this. This is the code I have so far
using UnityEngine;
using System.Collections;
public class FactorySpawner : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if(Input.GetKeyDown(KeyCode.Mouse1){
OnGUI();
}
}
void OnGUI(){
Rect rect = new Rect (10, Screen.height - 875, 130, 120);
}
}