예제 #1
0
    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>();
        }
    }
예제 #2
0
 private void Start()
 {
     queuer = GetComponent <UniversalQueue>();
     entity = GetComponent <Entity>();
 }