private void Start()
 {
     _selectableCharacterController = GetComponent <SelectableCharacterController>();
     _movableController             = GetComponent <MovableController>();
     _animator     = GetComponent <Animator>();
     _timer        = AttackPeriod;
     _hpController = GetComponent <HPController>();
 }
 private void Start()
 {
     _animator = GetComponent <Animator>();
     _selectableCharacterController = GetComponent <SelectableCharacterController>();
     _agent = GetComponent <NavMeshAgent>();
     _agent.updateRotation = false;
     _agent.updateUpAxis   = false;
     _savedSpeed           = _agent.speed;
     _hpController         = GetComponent <HPController>();
 }
 public void OnPointerUp(PointerEventData eventData)
 {
     if (eventData.button == PointerEventData.InputButton.Left)
     {
         if (!(Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl) ||
               Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift)))
         {
             SelectableCharacterController.DeselectAll(new BaseEventData(EventSystem.current));
         }
     }
 }
        public void OnEndDrag(PointerEventData eventData)
        {
            if (_selectionRect.Area() > 1)
            {
                if (!(Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl) ||
                      Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift)))
                {
                    SelectableCharacterController.DeselectAll(new BaseEventData(EventSystem.current));
                }
                foreach (var selectable in SelectableCharacterController.AllSelectable)
                {
                    if (_selectionRect.Contains(Camera.main.WorldToScreenPoint(selectable.transform.position)))
                    {
                        selectable.OnSelect(eventData);
                    }
                }
            }

            SelectionBoxImage.gameObject.SetActive(false);
        }
 private void Start()
 {
     _selectableCharacterController = GetComponent <SelectableCharacterController>();
     _animator = GetComponent <Animator>();
     _timer    = 0;
 }