public void Construct(PlayerStateFactory stateFactory, SignalBus signalBus) { Debug.Log("Player Contruct"); _stateFactory = stateFactory; _signalBus = signalBus; }
public void Construct(PlayerStateFactory stateFactory, Settings settings, SignalBus signalBus, MenuSettings menuSettings) { _stateFactory = stateFactory; _settings = settings; _signalBus = signalBus; _menuSettings = menuSettings; }
private void Construct(Rope rope, FollowCamera2D followCamera2D, PlayerStateFactory stateFactory, UiManager uiManager) { _rope = rope; _followCamera = followCamera2D; _stateFactory = stateFactory; _uiManager = uiManager; }
//public bool IsFalling { get { return _isFalling; } } #endregion void Awake() { _playerControls = new PlayerControls(); _rb = GetComponent <Rigidbody2D>(); _anim = GetComponent <Animator>(); ledgeInfo = GetComponent <LedgeInformation>(); audioManager = FindObjectOfType <AudioManager>(); ragdoll = FindObjectOfType <RagdollController>(); interact = GetComponent <Interact>(); //camera test camManager = FindObjectOfType <CameraManager>(); //Controls calling OnMovement Input Function _playerControls.Gameplay.Move.started += OnMovementInput; _playerControls.Gameplay.Move.canceled += OnMovementInput; _playerControls.Gameplay.Move.performed += OnMovementInput; //_playerControls.Gameplay.Jump.started += OnJump; //Default //_playerControls.Gameplay.Jump.canceled += OnJump; //Default _playerControls.Gameplay.Jump.started += ctx => OnJump(); _playerControls.Gameplay.Jump.canceled += ctx => OnJumpReleased(); _playerControls.Gameplay.Jetpack.performed += ctx => Thrust(); _playerControls.Gameplay.Jetpack.canceled += ctx => ThrustReleased(); //Converting strings to hash is more performant _isGroundedHash = Animator.StringToHash("isGrounded"); _isRunningHash = Animator.StringToHash("isRunning"); _isFallingHash = Animator.StringToHash("isFalling"); _jumpHash = Animator.StringToHash("Jump"); //speedXHash = Animator.StringToHash("SpeedX"); // setup state _states = new PlayerStateFactory(this); // passes this PlayerStateMachine instance. PlayerStateFactory is expecting a PlayerStateMachine _currentState = _states.Idle(); _currentState.EnterState(); }
public void Construct(PlayerStateFactory stateFactory) { _stateFactory = stateFactory; currentDirection = Direction.UP; }
public PlayerHealingState(PlayerStateMachine currentContext, PlayerStateFactory playerstateFactory) : base(currentContext, playerstateFactory) { }
public void Construct(PlayerStateFactory stateFactory, Settings settings) { _stateFactory = stateFactory; _settings = settings; }
public PlayerBaseState(PlayerStateMachine currentContext, PlayerStateFactory playerStateFactory) { context = currentContext; factory = playerStateFactory; }
public PlayerGroundedState(PlayerStateMachine currentContext, PlayerStateFactory playerstateFactory) : base(currentContext, playerstateFactory) { }
public void PlayerFactoryResolved() { PlayerStateFactory stateFactory = Container.Resolve <PlayerStateFactory>(); Assert.NotNull(stateFactory); }
public PlayerInteractingState(PlayerStateMachine currentContext, PlayerStateFactory playerstateFactory, IInteractable interactable) : base(currentContext, playerstateFactory) { context.InteractingWith = interactable; isRootState = true; }
public PlayerAliveState(PlayerStateMachine currentContext, PlayerStateFactory playerstateFactory) : base(currentContext, playerstateFactory) { isRootState = true; }
public PlayerContext(BasicInput input, Thruster thruster, Cannon cannon, Transform transform, Rigidbody rigidbody) { _factory = new PlayerStateFactory(this, input, thruster, cannon, transform, rigidbody); }
//constructor functions // passes cocnrete state arguments directly to the base state constructor public PlayerGrabbingBoxState(PlayerStateMachine currentContext, PlayerStateFactory playerStateFactory) : base(currentContext, playerStateFactory) { }
public PlayerInfiniteSworGlitchState(PlayerStateMachine currentContext, PlayerStateFactory playerstateFactory) : base(currentContext, playerstateFactory) { isRootState = true; }
public PlayerJetpackState(PlayerStateMachine currentContext, PlayerStateFactory playerStateFactory) : base(currentContext, playerStateFactory) { }
public PlayerLedgeHangState(PlayerStateMachine currentContext, PlayerStateFactory playerStateFactory) : base(currentContext, playerStateFactory) { }
public PlayerInCinematicState(PlayerStateMachine currentContext, PlayerStateFactory playerStateFactory) : base(currentContext, playerStateFactory) { }