Exemplo n.º 1
0
        private void ManageTheStopCollision(Collider2D collision)
        {
            if (_instaceIdToCollider is null)
            {
                return;
            }

            MovementMouseCollider movementMouseCollider = collision.gameObject.GetComponent <MovementMouseCollider>();

            if (movementMouseCollider is null)
            {
                return;
            }
            if (movementMouseCollider.GetInstanceID() == _instaceIdToCollider.Value)
            {
                _instaceIdToCollider = null;
            }
        }
Exemplo n.º 2
0
        public bool StartCombat(DamageDealerComponent damageDealer)
        {
            if (!_readyToCombat)
            {
                return(false);
            }

            PlayerStructure playerStructure = _playerState.GetActivePlayerStructure();

            InteractableComponent interactableComponent = playerStructure.GetInteractableComponent();

            if (interactableComponent is null)
            {
                return(false);
            }
            if (!interactableComponent.CheckIfCanAtack())
            {
                return(false);
            }

            damageDealer.event_AlertAttack.Invoke();
            interactableComponent.SetInteractableState(EnumInteractableState.Atack, this.GetInstanceID());

            // Go to the correct position to attack
            playerStructure.GetMovementMouseComponent().ObjectGoTo(this.transform.position, _colliderToStopMovement.GetInstanceID());

            return(true);
        }