private void Start() { movementController = FindObjectOfType <PlayerMovementController>(); combatController = FindObjectOfType <PlayerCombatController>(); swordScanner = FindObjectOfType <PlayerSwordScanner>(); enemyBlackboard = GetComponentInParent <EnemyBlackboard>(); throwHandsEnemy = GetComponentInParent <ThrowHandsEnemyAggressiveFSM>(); }
private void Awake() { var children = transform.root.GetComponentsInChildren <Transform>(); _playerSwordScanner = FindObjectOfType <PlayerSwordScanner>(); foreach (var c in children) { if (c.gameObject.layer == LayerMask.NameToLayer("Player")) { _playerGameObjects.Add(c.gameObject); } } }
private void Awake() { _input = new InputActions(); _input.Enable(); _input.PlayerControls.Attack.started += ctx => SimpleAttack(false); //_input.PlayerControls.Attack.canceled += ctx => InputRelease(); _input.PlayerControls.SpinAttack.started += ctx => SpinAttack(); _input.PlayerControls.SpinAttack.canceled += ctx => InputRelease(); SetState(new IdleState(this)); swordTrigger.OnHit += StateInteract; sword = FindObjectOfType <PlayerSwordScanner>(); _movementController = GetComponent <PlayerMovementController>(); playerSounds = GetComponent <PlayerSounds>(); }
private void Awake() { characterController = GetComponent <CharacterController>(); combatController = GetComponent <PlayerCombatController>(); playerSounds = GetComponent <PlayerSounds>(); cameraTransform = Camera.main.gameObject.transform; _input = new InputActions(); scannerSword = FindObjectOfType <PlayerSwordScanner>(); scannerCollider = scannerSword.GetComponent <SphereCollider>(); scannerIntersect = FindObjectOfType <ScannerIntersectionManager>(); _input.PlayerControls.Move.performed += callbackContext => movementVector = callbackContext.ReadValue <Vector2>(); _input.PlayerControls.Jump.started += callbackContext => JumpInput(); _input.PlayerControls.MoveObject.started += callbackContext => inputMoveObject = true; _input.PlayerControls.MoveObject.canceled += callbackContext => inputMoveObject = false; }
public EdgeState(PlayerMovementController controller) { _controller = controller; _scannerSword = controller.scannerSword; }
private void Awake() { _controller = GetComponent <PlayerMovementController>(); _sword = FindObjectOfType <PlayerSwordScanner>(); }
public static Collider[] GetResidualColliders(PlayerMovementController _controller, Vector3 position, PlayerSwordScanner sword) { if (Vector3.Distance(position, sword.transform.position) <= 4 && sword.activeScanner) { return(Physics.OverlapSphere(position, 0.2f, _controller.layersToCheckFloorInsideScanner)); } return(Physics.OverlapSphere(position, 0.2f, _controller.layersToCheckFloorOutsideScanner)); }