Пример #1
0
 public Glider(Player player)
 {
     _rigidbody         = player.GetComponent <Rigidbody2D>();
     _grounder          = player.Grounder;
     _playerAnimator    = player.AnimatorController;
     _glideFallVelocity = player.PlayerParameters.GlideFallVelocity;
 }
Пример #2
0
 public BasicAttacker(Player player)
 {
     _player             = player;
     _animatorController = player.AnimatorController;
     _attackDamage       = _player.PlayerParameters.BasicAttackDamage;
     _attackLayers       = _player.PlayerParameters.AttackLayers;
     _attackParameters   = new Dictionary <Directions, AttackParameter>
     {
         { Directions.Right, _player.PlayerParameters.BasicRightAttackParameter },
         { Directions.Left, _player.PlayerParameters.BasicLeftAttackParameter },
         { Directions.Up, _player.PlayerParameters.BasicUpAttackParameter },
         { Directions.Down, _player.PlayerParameters.BasicDownAttackParameter }
     };
 }
Пример #3
0
 public WallJumper(Player player)
 {
     _player          = player;
     _moverTimeOff    = player.PlayerParameters.WallJumpMoverTimeOff;
     _boxOffsetRight  = player.PlayerParameters.WallJumpBoxOffsetRight;
     _boxOffsetLeft   = player.PlayerParameters.WallJumpBoxOffsetLeft;
     _boxSizes        = player.PlayerParameters.WallJumpBoxSizes;
     _layers          = player.PlayerParameters.WallJumpLayers;
     _boxAngle        = player.PlayerParameters.WallJumpBoxAngle;
     _fallingVelocity = player.PlayerParameters.WallPressFallingVelocity;
     _jumpForce       = player.PlayerParameters.WallJumpForce;
     _rigidbody       = player.GetComponent <Rigidbody2D>();
     _playerAnimator  = player.AnimatorController;
 }
Пример #4
0
        private void OnValidate()
        {
            if (_playerParameters == null)
            {
                _playerParameters = Resources.Load <PlayerParameters>("ScriptableObjects/DefaultPlayerParameters");
            }

            if (AnimatorController == null)
            {
                _playerAnimatorController = GetComponent <PlayerAnimatorController>();
            }

            if (_ghostSpawner == null)
            {
                _ghostSpawner = GetComponent <PlayerGhostSpawner>();
            }
        }
Пример #5
0
 public StrongAttacker(Player player)
 {
     _player             = player;
     _animatorController = player.AnimatorController;
 }