private void Awake()
 {
     _input    = GetComponent <IJetpackInput>();
     _rb2d     = GetComponent <Rigidbody2D>();
     _grounded = GetComponent <IGroundedController>();
     Fuel      = _config.InitFuel;
 }
Пример #2
0
    void Awake()
    {
        _anim = GetComponent <Animator>();
        _rb2d = GetComponent <Rigidbody2D>();

        _grounded = GetComponent <IGroundedController>();

        _jetpack          = GetComponent <PlayerJetpackController>();
        _input            = GetComponent <PlayerInputController>();
        _movement         = GetComponent <PlayerHorizontalMovementController>();
        _playerController = GetComponent <PlayerController>();

        _grounded.HitGround   += () => _anim.SetBool("grounded", true);
        _grounded.LeaveGround += () => _anim.SetBool("grounded", false);
    }