void Awake( ) { this.Camera = Camera.main; this.CharacterController = GetComponent <CharacterController> ( ); this.Animator = GetComponent <Animator> ( ); this.Input = new PlayerInputAction( ); }
private void Awake() { charControl = gameObject.GetComponent <CharacterControl>(); animator = gameObject.GetComponent <Animator>(); playerInputAction = new PlayerInputAction(); playerInputAction.PlayerContols.Move.performed += ctx => playerAxis = ctx.ReadValue <Vector2>(); playerInputAction.PlayerContols.Jump.performed += ctx => isJumping = true; playerInputAction.PlayerContols.Jump.canceled += ctx => isJumping = false; }
void Awake() { inputAction = new PlayerInputAction(); inputAction.Player.Move.performed += OnMove; animator = GetComponent <Animator>(); topWingAnimator = topWing.GetComponent <Animator>(); bottomWingAnimator = bottomWing.GetComponent <Animator>(); }
/// <summary> /// 指定したキー入力のイベントを削除する /// </summary> /// <param name="keyId">キーID</param> /// <param name="action">削除するイベント</param> public void RemoveEvent(int keyId, PlayerInputAction action) { if (!_events.ContainsKey(keyId)) { return; } _events[keyId].inputEvent -= action; }
public HumanoidAim(HumanoidAimAttribute attribute, Humanoid character) : base(character) { input = character.Input; freeCam = character.FreeCam; input.GamePlay.Aim.performed += OnAimPerformed; input.GamePlay.Aim.canceled += OnAimCanceled; attr = attribute; this.character = character; }
void Start() { _swordController = GetComponentInChildren <SwordController>(); _inputActions = new PlayerInputAction(); _inputActions.Enable(); // attack _inputActions.Player.Attack.performed += _ => _swordController.SwingSword(); }
private void Awake() { inputAction = new PlayerInputAction(); body = gameObject.GetComponent <Rigidbody>(); body.constraints = RigidbodyConstraints.FreezePositionZ | RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ; transform = gameObject.transform; //TODO put cursor stuff in some game manager! Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; }
protected virtual void Awake() { inputAction = new PlayerInputAction(); body = gameObject.GetComponent <Rigidbody>(); body.constraints = RigidbodyConstraints.FreezePositionZ | RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ | RigidbodyConstraints.FreezeRotationY; transform = gameObject.transform; anim = GetComponent <Animator>(); body.useGravity = false; }
public HumanoidMovement(HumanoidMovementAttribute attribute, Humanoid character) : base(character) { attr = attribute; cam = character.Camera; input = character.Input; characterController = character.CharacterController; anim = character.Animator; this.character = character; input.GamePlay.Move.performed += OnMovePerformed; input.GamePlay.Move.canceled += OnMoveCanceled; }
public SquidMovement(SquidMovementAttribute attr, Squid character) : base(character) { this.character = character; this.attr = attr; cam = character.Camera; input = character.Input; characterController = character.CharacterController; anim = character.Animator; input.GamePlay.Move.performed += HandleMovePerformed; input.GamePlay.Move.canceled += HandleMoveCanceled; }
/// <summary> /// 指定したキーIDにイベントを登録 /// </summary> /// <param name="keyId">キーID</param> /// <param name="action">キー入力のイベント</param> public void RegistEvent(int keyId, PlayerInputAction action) { EventSender sender; if (_events.ContainsKey(keyId)) { sender = _events[keyId]; } else { sender = new EventSender(keyId); _events[keyId] = sender; } sender.inputEvent -= action; sender.inputEvent += action; }
// Start is called before the first frame update private void Awake() { playerTransform = GetComponent <Transform>(); playerRB = GetComponent <Rigidbody2D>(); playerAnim = GetComponent <Animator>(); playerRenderer = GetComponent <SpriteRenderer>(); playerAudio = GetComponent <AudioSource>(); energy = maxEnergy; inputActions = new PlayerInputAction(); inputActions.Player.Move.performed += ctx => moveInput = ctx.ReadValue <Vector2>(); inputActions.Player.ActivateShield.started += ctx => OnMouseClick(); inputActions.Player.ActivateShield.canceled += ctx => OnMouseReleased(); inputActions.Player.Jump.performed += ctx => Jump(); StartCoroutine(EnergyRecharge()); }
private void Start() { PlayerInputAction actions = GameManager.Manager.InputActions; InputAction inputAction = null; if (keyActionText != null) { keyActionText.text = currControl.ToString(); } switch (currControl) { case GameControls.Interact: inputAction = actions.PlayerControls.Pickup; break; case GameControls.Repair: inputAction = actions.PlayerControls.Repair; break; case GameControls.Switch: inputAction = actions.PlayerControls.Switch; break; } if (keyRebindText == null) { return; } if (isComposite) { keyRebindText.text = inputAction.GetBindingDisplayString(bindingIndex: compositeId + 1); } else { keyRebindText.text = inputAction.GetBindingDisplayString(); } }
private void Start() { playerAction = GameManager.Manager.InputActions; compositeId++; switch (keyToChange) { case GameControls.Repair: selectedAction = playerAction.PlayerControls.Repair; break; case GameControls.Interact: selectedAction = playerAction.PlayerControls.Pickup; break; case GameControls.Switch: selectedAction = playerAction.PlayerControls.Switch; break; } UpdateText(); }
virtual protected void Awake( ) { input = new PlayerInputAction( ); Timer = new ScaledTimer(fireRate); Cam = Camera.main; }
private void Awake() => input = new PlayerInputAction();
public OnGroundActions(PlayerInputAction wrapper) { m_Wrapper = wrapper; }
private void Awake() { _playerInput = new PlayerInputAction(); _stateManager = GetComponent <PlayerStateManager>(); }
public PlayerActionMapActions(PlayerInputAction wrapper) { m_Wrapper = wrapper; }
public DebugActions(PlayerInputAction wrapper) { m_Wrapper = wrapper; }
private void Awake() { inputAction = GameManager.Manager.InputActions; inputAction.PlayerControls.Move.performed += ctx => moveInput = ctx.ReadValue <Vector2>(); }
private void Awake() { inputAction = GameManager.Manager.InputActions; inputAction.PlayerControls.Repair.performed += StartRepair; }
public InAirActions(PlayerInputAction wrapper) { m_Wrapper = wrapper; }
private void Awake() { _input = new PlayerInputAction(); _movement = GetComponent <InputMoveStrategy>(); }
void Awake( ) { humanoid?.Init(this); // squid?.Init (this); Input = new PlayerInputAction( ); }
private void Start() { inputActions = new PlayerInputAction(); LoadPlayerBindings(); //AudioManager.Manager.PlayAudio("BGM"); }