Пример #1
0
    public void StartAiming()
    {
        _input = _player.Input;

        _aimIndicator.gameObject.SetActive(true);
        IsAiming = true;
    }
Пример #2
0
 public void Initialize(GameplayInput gameplayInput)
 {
     //Debug.Log("Initialize input");
     //TODO currently Initialize gets called AFTER this object States are created. This causes
     // null references for input. Determine how to send input properly when this player is spawned
     _gameplayInput = gameplayInput;
 }
Пример #3
0
    public PlayerMoveState(PlayerFSM stateMachine, Player player) : base(stateMachine, player)
    {
        _stateMachine = stateMachine;

        _movement = player.Movement;
        _data     = player.Data;
        _input    = player.Input;
        _animator = player.PlayerAnimator;
    }
Пример #4
0
    public PlayerBounceAttackState(PlayerFSM stateMachine, Player player)
    {
        _stateMachine = stateMachine;
        _animator     = player.PlayerAnimator;

        _movement     = player.Movement;
        _data         = player.Data;
        _weaponSystem = player.WeaponSystem;
        _input        = player.Input;
    }
Пример #5
0
    public PlayerCrouchState(PlayerFSM stateMachine, Player player) : base(stateMachine, player)
    {
        _stateMachine = stateMachine;
        _player       = player;

        _movement        = player.Movement;
        _input           = player.Input;
        _data            = player.Data;
        _playerAnimator  = player.PlayerAnimator;
        _ceilingDetector = player.EnvironmentDetector.CeilingDetector;
    }
Пример #6
0
    public PlayerWallSlideState(PlayerFSM stateMachine, Player player) : base(stateMachine, player)
    {
        _stateMachine = stateMachine;
        _player       = player;
        _animator     = player.PlayerAnimator;

        _movement = player.Movement;
        _data     = player.Data;
        _input    = player.Input;
        _jumpDust = player.Visuals.JumpDust;
    }
Пример #7
0
    public PlayerWallClimbState(PlayerFSM stateMachine, Player player) : base(stateMachine, player)
    {
        _stateMachine = stateMachine;
        _player       = player;

        _movement          = player.Movement;
        _data              = player.Data;
        _input             = player.Input;
        _aboveWallDetector = player.EnvironmentDetector.AboveWallDetector;
        _wallDetector      = player.EnvironmentDetector.WallDetector;
    }
Пример #8
0
    public PlayerWallGrab(PlayerFSM stateMachine, Player player) : base(stateMachine, player)
    {
        _stateMachine = stateMachine;
        _player       = player;
        _animator     = player.PlayerAnimator;

        _movement = player.Movement;
        _input    = player.Input;
        _data     = player.Data;
        _sfx      = player.SFX;
    }
    public PlayerGroundedSuperState(PlayerFSM stateMachine, Player player)
    {
        _stateMachine = stateMachine;
        _player       = player;

        _input           = player.Input;
        _data            = player.Data;
        _groundDetector  = player.EnvironmentDetector.GroundDetector;
        _ceilingDetector = player.EnvironmentDetector.CeilingDetector;
        _dashSystem      = player.DashSystem;
    }
Пример #10
0
    public PlayerLandState(PlayerFSM stateMachine, Player player) : base(stateMachine, player)
    {
        _stateMachine = stateMachine;
        _player       = player;
        _animator     = player.PlayerAnimator;

        _input      = player.Input;
        _data       = player.Data;
        _sfx        = player.SFX;
        _dashSystem = player.DashSystem;
        _jumpDust   = player.Visuals.JumpDust;
    }
Пример #11
0
    public PlayerWallSuperState(PlayerFSM stateMachine, Player player)
    {
        _stateMachine = stateMachine;
        _player       = player;

        _data           = player.Data;
        _movement       = player.Movement;
        _input          = player.Input;
        _groundDetector = player.EnvironmentDetector.GroundDetector;
        _wallDetector   = player.EnvironmentDetector.WallDetector;
        _dashSystem     = player.DashSystem;
    }
Пример #12
0
        public void Awake()
        {
            roundProcessController = new RoundProcessController();
            gamePlayInput          = new GameplayInput();
            bmbColliderManager     = new BMBColliderManager();
            buffManager            = new BuffManager();
            autoController         = new AI.AutoController();
            singleBattle           = new AI.BattleField();

            _phaseNameText       = GameObject.Find("phaseNameText").GetComponentInChildren <Text>();
            _phaseNameText.color = Color.red;
            _phaseNameText.text  = roundProcessController.State.ToString();
        }
Пример #13
0
    public PlayerGroundAttackState(PlayerFSM stateMachine, Player player)
    {
        _stateMachine = stateMachine;
        _animator     = player.PlayerAnimator;

        _movement       = player.Movement;
        _data           = player.Data;
        _input          = player.Input;
        _weaponSystem   = player.WeaponSystem;
        _dashSystem     = player.DashSystem;
        _weaponData     = player.WeaponSystem.EquippedWeapon;
        _groundDetector = player.EnvironmentDetector.GroundDetector;
    }
Пример #14
0
    public PlayerJumpState(PlayerFSM stateMachine, Player player)
    {
        _stateMachine = stateMachine;
        _player       = player;
        _animator     = player.PlayerAnimator;

        _movement       = player.Movement;
        _input          = player.Input;
        _data           = player.Data;
        _groundDetector = player.EnvironmentDetector.GroundDetector;
        _dashSystem     = player.DashSystem;
        _sfx            = player.SFX;
        _jumpDust       = player.Visuals.JumpDust;
    }
Пример #15
0
    public PlayerFallingState(PlayerFSM stateMachine, Player player)
    {
        _stateMachine = stateMachine;
        _player       = player;
        _animator     = player.PlayerAnimator;

        _movement          = player.Movement;
        _data              = player.Data;
        _input             = player.Input;
        _groundDetector    = player.EnvironmentDetector.GroundDetector;
        _wallDetector      = player.EnvironmentDetector.WallDetector;
        _aboveWallDetector = player.EnvironmentDetector.AboveWallDetector;

        _dashSystem = player.DashSystem;
    }
Пример #16
0
 public bool CarryOverSpecial(bool readyForCarryover, bool handHoldActive, GameplayInput input, ConvertNestCtrl convertNestCtrl)
 {
     /*
      * if (readyForCarryover) {
      *  bool hintShown = Show("showHintDragCarryover", false, Vector3.zero);
      *  if (hintShown) {
      *      input.EnableAllInput(false, GameplayInput.CONVERT_TO_TENS);
      *      input.EnableCountingAndPause(true);
      *      if (convertNestCtrl)
      *          convertNestCtrl.ToggleVisibility(true, handHoldActive);
      *      return true;
      *  }
      * } else {
      *  if (Session.instance.currentLevel.hasTutorial("showHintDragCarryover") && !seenMap["showHintDragCarryover"]) {
      *      Show((Session.instance.currentLevel.tensColumnEnabled) ? "showHintDragAddOne" : "showHintDragAdd", true);
      *      input.EnableAllInput(false, GameplayInput.ONES_QUEUE);
      *      input.EnableCountingAndPause(true);
      *      return true;
      *  }
      * }*/
     return(false);
 }
Пример #17
0
    public void BeginLevelTutorials(GameplayInput input, ConvertNestCtrl convertNestCtrl)
    {
        FGUnity.Utils.Logger.Log("Beginning level tutorials");
        bool hintShown = false;

        hintShown = Show(HINT_BORROW);
        if (hintShown)
        {
            input.EnableAllInput(false, GameplayInput.CONVERT_TO_ONES, GameplayInput.TENS_COLUMN);
            input.EnableCountingAndPause(true);
            if (convertNestCtrl)
            {
                convertNestCtrl.ShowEmptyTenFrame(true);
            }
        }

        hintShown = Show(HINT_SUB);
        if (hintShown)
        {
            input.EnableAllInput(false, GameplayInput.ONES_COLUMN, GameplayInput.ONES_SUB);
            input.EnableCountingAndPause(true);
        }

        hintShown = Show(HINT_SUB_ONE);
        if (hintShown)
        {
            input.EnableAllInput(false, GameplayInput.ONES_COLUMN, GameplayInput.ONES_SUB);
            input.EnableCountingAndPause(true);
        }

        hintShown = Show(HINT_SUB_TEN);
        if (hintShown)
        {
            input.EnableAllInput(false, GameplayInput.TENS_COLUMN, GameplayInput.TENS_SUB);
            input.EnableCountingAndPause(true);
        }
    }
 private bool buttonPressed(string button)
 {
     return(this.LongPress ? GameplayInput.ButtonLongHeld(button) : GameplayInput.ButtonPressed(button));
 }
Пример #19
0
 private bool gameplayCheck()
 {
     return(GameplayInput.AnyPlayerButtonPressed(this.ToggleInput));
 }
Пример #20
0
    public override void Update()
    {
        if (PauseController.IsPaused())
        {
            return;
        }

        if (!this.NoMove)
        {
            Vector2 movementAxis = GameplayInput.GetMovementAxis(this.PlayerIndex);

            float targetX = movementAxis.x * this.MaxSpeed;
            float targetY = movementAxis.y * this.MaxSpeed;

            float changeX = targetX - this.Velocity.x;
            float changeY = targetY - this.Velocity.y;

            if (changeX != 0 || changeY != 0)
            {
                float changeTotal = Mathf.Sqrt(Mathf.Pow(changeX, 2) + Mathf.Pow(changeY, 2));

                if (changeX != 0)
                {
                    float ax = Mathf.Abs(_acceleration * changeX / changeTotal);
                    this.Velocity.x = Mathf.Lerp(this.Velocity.x, targetX, ax * Time.deltaTime / Math.Abs(changeX));
                }

                if (changeY != 0)
                {
                    float ay = Mathf.Abs(_acceleration * changeY / changeTotal);
                    this.Velocity.y = Mathf.Lerp(this.Velocity.y, targetY, ay * Time.deltaTime / Math.Abs(changeY));
                }
            }
        }
        else
        {
            this.Velocity = Vector2.zero;
        }

        base.Update();

        // Shooting
        if (!this.NoFire && _weapon != null)
        {
            Vector2 rawAimAxis = GameplayInput.GetAimingAxis(this.PlayerIndex, this.transform.position, false);

            if (_usingController)
            {
                float aimSpeed = this.ControllerAimerSpeed;
                if (rawAimAxis.magnitude < 0.01f)
                {
                    rawAimAxis = _aimAxis.normalized * this.ControllerMinAimAmt;
                    aimSpeed   = this.ControllerAimerSpeed * this.ControllerReturnSpeedMult;
                }
                else if (rawAimAxis.magnitude < this.ControllerMinAimAmt)
                {
                    rawAimAxis = rawAimAxis.normalized * this.ControllerMinAimAmt;
                }

                _aimAxis = Vector2.MoveTowards(_aimAxis, rawAimAxis, aimSpeed * Time.deltaTime);
            }
            else
            {
                _aimAxis = rawAimAxis;
            }

            if (_aimAxis.x != 0 || _aimAxis.y != 0)
            {
                if (GameplayInput.GetFireButton(this.PlayerIndex))
                {
                    _weapon.Fire(_aimAxis.normalized, this.ShotStartDistance);
                }
            }
        }
    }
Пример #21
0
 private void Awake()
 {
     _gameplayInput = new GameplayInput();
     _gameplayInput.Enable();
 }
Пример #22
0
 public void Awake()
 {
     roundProcessController = new RoundProcessController();
     gamePlayInput          = new GameplayInput();
 }