using System.Collections;
using UnityEngine;
public class SelectScript : MonoBehaviour {
public bool Selected;
public Camera cam;
void Awake() {
cam = Camera.main;
}
// Update is called once per frame
void Update () {
}
// when clicked on with left mouse broadcast unselect and set selected to
void OnMouseDown() {
if (Input.GetMouseButton (0)) {
// false
if (gameObject.tag == "Floor") {
SendMessage ("UnSelect");
Selected = false;
// true
}
else if (gameObject.tag == "T-A") {
Selected = true;
}
}
}
// UnSelect the unit
public void UnSelect()
{
Selected = false;
Debug.Log ("UnSelect");
}
}
Any help us apperciated