Ejemplo n.º 1
0
        private void InteractionMenu_OnClickAction(object p_source, OnClickActionEventArgs p_args)
        {
            switch (p_args.ObjectAction)
            {
            case ItemAction.Interact:
                if (_isRightClickMoving)
                {
                    _commandQuery.ClearQuery();
                    _isRightClickMoving = false;
                }

                AudioController.Instance.Play(Tags.SFX_Interact_Player);
                _animator.SetBool("isWalking", true);
                _commandQuery.AddCommand(new MoveCommand(_unit, p_args.MapItem.transform.position, (object p_commandSource, CommandCallbackEventArgs p_commandArgs) =>
                {
                    _animator.SetBool("isWalking", false);
                    p_args.MapItem.Interact();
                }));
                break;

            case ItemAction.Cancel:
                break;
            }
        }