private void Update() { UpdateUI(); bool mouseClicked = Input.GetMouseButtonDown(0); if (!mouseClicked) { return; } Debug.Log("Clicked"); RaycastHit hit; Ray ray = cam.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out hit, 1000.0f) && hit.collider.gameObject.CompareTag("Entity")) { Debug.Log("Found!"); Entity ent = hit.collider.gameObject.GetComponent <Entity>(); target = ent; queue = ent.GetComponent <UniversalQueue>(); } }
private void Start() { queuer = GetComponent <UniversalQueue>(); entity = GetComponent <Entity>(); }