/// <summary> /// Confirms the controller selection, and moves to the next level /// </summary> public void ConfirmControllerSelection() { PlayerInputs.CreateInputMappings(this); SceneManager.LoadScene(nextLevelName); }
// Use this for initialization void Start() { rb = GetComponent <Rigidbody>(); inputs = GetComponent <PlayerInputs>(); playerAnimator = GetComponent <Animator>(); }
public void GetPlayerGamepad(int index) { manette = PlayerInputs.GetPlayerController(index); }
private void Start() { m_playerInput = GetComponent <PlayerInputManager>().GetPlayerInput(); m_playerInput.ClassicPlayer.Shot.performed += ctx => Shot(); }
// Use this for initialization void Start() { anim = GetComponent <Animator>(); playerInputs = GetComponent <PlayerInputs>(); }
public void SetPlayerInputs(PlayerInputs inputs) { this.inputs = inputs; }
protected override void Initialise() { canShoot = true; playerInputs = GetComponent <PlayerInputs>(); playerInputs.SubscribeToOnPrimaryTouch(FireMissile); }
void Start() { inputs = ScriptableObject.CreateInstance <PlayerInputs> (); }
public IdleState(Character character, CharacterStateMachine characterStateMachine, CharacterData characterData, PlayerInputs playerInputs, string animBoolName) : base(character, characterStateMachine, characterData, playerInputs, animBoolName) { }
void InitializeLevelController() { input = new PlayerInputs(); }
public GameplayActions(PlayerInputs wrapper) { m_Wrapper = wrapper; }
// Start is called before the first frame update void Start() { m_playerInput = GetComponent <PlayerInputManager>().GetPlayerInput(); // m_rbComp = GetComponent<Rigidbody>(); }
public void SetPlayerInputs(PlayerInputs inputs) { // We dont expect this to ever be called from the client. throw new System.NotImplementedException(); }
private void Awake() { playerInputs = GetComponent <PlayerInputs>(); controller = GetComponent <CharacterController>(); cameraControls = GetComponent <CameraControls>(); }
public void FromPacket(DataReader dataReader) { byte data = dataReader.GetByte(); playerInputs = (PlayerInputs)data; }
void Start() { _inputs = GetComponent <PlayerInputs>(); }
// Update is called once per frame void Update() { if (PlayerInputs.GetKeyDown(Constants.PLAYER_1_TAG, Constants.ESCAPE) || PlayerInputs.GetKeyDown(Constants.PLAYER_1_TAG, Constants.SELECT) || PlayerInputs.GetKeyDown(Constants.PLAYER_1_TAG, Constants.ATTACK)) { audioSource.PlayOneShot(clipSelect); StartCoroutine(GenericFunctions.FadeOutSound(.75f, audioSource, 0f)); StartCoroutine(GenericFunctions.FadeInImage(.75f, fadeImage, "MainMenu")); buttonsEnabled = false; } }
private void SendInputToFSM(PlayerInputs inp) { _myFsm.SendInput(inp); }
void Awake() { rb = GetComponent <Rigidbody2D>(); playerInputs = GetComponent <PlayerInputs>(); }
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { player = PlayerInputs.GetPlayer(); }
void Start() { ch = GameObject.Find("CheckpointHandler").GetComponent <checkpointHandler>(); input = GameObject.Find("player").GetComponent <playerControl>().input; triggerEntered = false; }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { player = PlayerInputs.GetPlayer(); player.Rbody.AddForce(player.transform.forward * force); }
void Start() { playerInputs = GetComponent <PlayerInputs>(); cam = GetComponentInChildren <Camera>(); }
private void Awake() { inputs = new PlayerInputs(); StartCoroutine(GoMainMenu()); }
private void FixedUpdate() { if (PlayerInputs.GetAxisOrKey(playerID, Constants.LEFTH) || PlayerInputs.GetAxisOrKey(playerID, Constants.RIGHT)) { this.Animator.SetBool("Walk", false); } if (isGrounded && PlayerInputs.GetKeyDown(playerID, Constants.JUMP) && !bloking && !attacking) { if (playerID == Constants.PLAYER_1_TAG) { audioSource.PlayOneShot(clipJumpPlayerA); } else { audioSource.PlayOneShot(clipJumpPlayerB); } this.Animator.SetTrigger(Constants.JUMP); myRigidbody2D.velocity = new Vector3(0f, jumpForce, 0f); } if (PlayerInputs.GetAxisOrKey(playerID, Constants.LEFTH) && !bloking && !attacking) { if (isGrounded) { myRigidbody2D.velocity = new Vector3(-speed, myRigidbody2D.velocity.y, 0f); this.Animator.SetBool("Walk", true); } else { myRigidbody2D.velocity = new Vector3(-speed * 0.4f, myRigidbody2D.velocity.y, 0f); } this.transform.rotation = new Quaternion(0f, 180f, 0f, 1f); } else if (PlayerInputs.GetAxisOrKey(playerID, Constants.RIGHT) && !bloking && !attacking) { if (isGrounded) { this.Animator.SetBool("Walk", true); myRigidbody2D.velocity = new Vector3(speed, myRigidbody2D.velocity.y, 0f); } else { myRigidbody2D.velocity = new Vector3(speed * 0.4f, myRigidbody2D.velocity.y, 0f); } this.transform.rotation = new Quaternion(0f, 0f, 0f, 1f); } else { myRigidbody2D.velocity = new Vector3(0f, myRigidbody2D.velocity.y, 0f); this.Animator.SetBool("Walk", false); } if (PlayerInputs.GetKeyDown(playerID, Constants.ATTACK) && remainingAttackDelay <= 0) { //int randomNumber = Random.Range(0, 2); //if (playerID == Constants.PLAYER_1_TAG) //{ // if (randomNumber >= 1f) // { // audioSource.PlayOneShot(clipAttackPlayerA1); // } // else // { // audioSource.PlayOneShot(clipAttackPlayerA2); // } //} //else //{ // if (randomNumber >= 1f) // { // audioSource.PlayOneShot(clipAttackPlayerB1); // } // else // { // audioSource.PlayOneShot(clipAttackPlayerB2); // } //} this.Animator.SetTrigger("Attack"); this.remainingAttackDelay = this.attackDelay; this.attacking = true; } if (PlayerInputs.GetKeyDown(playerID, Constants.BLOCK) && remainingBlockDelay <= 0) { this.Animator.SetTrigger("Block"); this.bloking = true; this.remainingBlockDelay = this.blockDelay; } }
public void DecreasePlayerCount() { PlayerInputs.DecreasePlayers(); }
public void CmdUpdateInputs(PlayerInputs playerInputs) { syncedPlayerInputs = playerInputs; }
public void IncreasePlayerCount() { PlayerInputs.IncreasePlayers(); Debug.Log("inc players"); }
private void Start() { inputs = GetComponent <PlayerInputs>(); stats = GetComponent <Stats>(); }
// Use this for initialization void Start() { _inputs = GetComponent<PlayerInputs>(); }
private void Awake() { current = this; GlobalEvents.OnControlsChanged += OnControlsChanged; }