예제 #1
0
 private void OnMouseDown()
 {
     if (OnEnemyClicked != null)
     {
         OnEnemyClicked.Invoke(this);
     }
 }
예제 #2
0
 void MouseControl()
 {
     if (Input.GetMouseButtonDown(0) && hitInfo.collider != null)
     {
         if (hitInfo.collider.gameObject.CompareTag("Ground"))
         {
             OnMouseClicked?.Invoke(hitInfo.point);
         }
         if (hitInfo.collider.gameObject.CompareTag("Enemy"))
         {
             OnEnemyClicked?.Invoke(hitInfo.collider.gameObject);
         }
         if (hitInfo.collider.gameObject.CompareTag("Attackable"))
         {
             OnEnemyClicked?.Invoke(hitInfo.collider.gameObject);
         }
         if (hitInfo.collider.gameObject.CompareTag("Portal"))
         {
             OnMouseClicked?.Invoke(hitInfo.point);
         }
         if (hitInfo.collider.gameObject.CompareTag("Item"))
         {
             OnMouseClicked?.Invoke(hitInfo.point);
         }
     }
 }