Пример #1
0
    private void Awake()
    {
        //Initialize variables
        playerMovementActionMap = new PlayerMovementAction();
        thisBody      = GetComponent <Rigidbody2D>();
        boxCollider   = GetComponent <BoxCollider2D>();
        roundCollider = GetComponent <CapsuleCollider2D>();

        //Bind Functions with the input action map
        playerMovementActionMap.General.Jump.started  += ctx => Jump();
        playerMovementActionMap.General.Jump.canceled += ctx => JumpCancel();
        playerMovementActionMap.General.Dash.started  += ctx => Dash();
        playerMovementActionMap.General.Grab.started  += ctx => Grab(ctx);
        playerMovementActionMap.General.Grab.canceled += ctx => Grab(ctx);
    }
Пример #2
0
        public void InitializeWrestler(Match matchManager, WrestlerData wrestlerData, InMatchWrestlingTargetDeterminator targetDeterminator, Ring ring, RingPosition startingPosition)
        {
            matchManager.UpdateSpeed += HandleSpeedUpdated;

            _baseWrestlerData   = wrestlerData;
            _targetDeterminator = targetDeterminator;
            //actions need to be handled by an action handler that gets init here.
            _playerMovementAction = new PlayerMovementAction(transform, ring);
            _agilityHandler       = new MatchWrestlerAgilityHandler(wrestlerData.Agility);
            _speedPoolHandler     = new MatchWrestlerSpeedPoolHandler(_agilityHandler, this);


            WrestlerInitialized?.Invoke(this, new MatchWresterGenericEventArgs()
            {
                wrestler = this
            });
        }