Esempio n. 1
0
 /// <summary>
 /// Confirms the controller selection, and moves to the next level
 /// </summary>
 public void ConfirmControllerSelection()
 {
     PlayerInputs.CreateInputMappings(this);
     SceneManager.LoadScene(nextLevelName);
 }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     rb             = GetComponent <Rigidbody>();
     inputs         = GetComponent <PlayerInputs>();
     playerAnimator = GetComponent <Animator>();
 }
Esempio n. 3
0
 public void GetPlayerGamepad(int index)
 {
     manette = PlayerInputs.GetPlayerController(index);
 }
Esempio n. 4
0
 private void Start()
 {
     m_playerInput = GetComponent <PlayerInputManager>().GetPlayerInput();
     m_playerInput.ClassicPlayer.Shot.performed += ctx => Shot();
 }
Esempio n. 5
0
 // Use this for initialization
 void Start()
 {
     anim         = GetComponent <Animator>();
     playerInputs = GetComponent <PlayerInputs>();
 }
Esempio n. 6
0
 public void SetPlayerInputs(PlayerInputs inputs)
 {
     this.inputs = inputs;
 }
Esempio n. 7
0
 protected override void Initialise()
 {
     canShoot     = true;
     playerInputs = GetComponent <PlayerInputs>();
     playerInputs.SubscribeToOnPrimaryTouch(FireMissile);
 }
Esempio n. 8
0
 void Start()
 {
     inputs = ScriptableObject.CreateInstance <PlayerInputs> ();
 }
Esempio n. 9
0
 public IdleState(Character character, CharacterStateMachine characterStateMachine, CharacterData characterData, PlayerInputs playerInputs, string animBoolName) : base(character, characterStateMachine, characterData, playerInputs, animBoolName)
 {
 }
Esempio n. 10
0
 void InitializeLevelController()
 {
     input = new PlayerInputs();
 }
Esempio n. 11
0
 public GameplayActions(PlayerInputs wrapper)
 {
     m_Wrapper = wrapper;
 }
Esempio n. 12
0
 // Start is called before the first frame update
 void Start()
 {
     m_playerInput = GetComponent <PlayerInputManager>().GetPlayerInput();
     // m_rbComp = GetComponent<Rigidbody>();
 }
Esempio n. 13
0
 public void SetPlayerInputs(PlayerInputs inputs)
 {
     // We dont expect this to ever be called from the client.
     throw new System.NotImplementedException();
 }
Esempio n. 14
0
 private void Awake()
 {
     playerInputs   = GetComponent <PlayerInputs>();
     controller     = GetComponent <CharacterController>();
     cameraControls = GetComponent <CameraControls>();
 }
Esempio n. 15
0
        public void FromPacket(DataReader dataReader)
        {
            byte data = dataReader.GetByte();

            playerInputs = (PlayerInputs)data;
        }
Esempio n. 16
0
 void Start()
 {
     _inputs = GetComponent <PlayerInputs>();
 }
Esempio n. 17
0
 // 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;
     }
 }
Esempio n. 18
0
 private void SendInputToFSM(PlayerInputs inp)
 {
     _myFsm.SendInput(inp);
 }
Esempio n. 19
0
    void Awake()
    {
        rb = GetComponent <Rigidbody2D>();

        playerInputs = GetComponent <PlayerInputs>();
    }
Esempio n. 20
0
 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     player = PlayerInputs.GetPlayer();
 }
Esempio n. 21
0
 void Start()
 {
     ch             = GameObject.Find("CheckpointHandler").GetComponent <checkpointHandler>();
     input          = GameObject.Find("player").GetComponent <playerControl>().input;
     triggerEntered = false;
 }
Esempio n. 22
0
 // 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);
 }
Esempio n. 23
0
 void Start()
 {
     playerInputs = GetComponent <PlayerInputs>();
     cam          = GetComponentInChildren <Camera>();
 }
Esempio n. 24
0
 private void Awake()
 {
     inputs = new PlayerInputs();
     StartCoroutine(GoMainMenu());
 }
Esempio n. 25
0
    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;
        }
    }
Esempio n. 26
0
 public void DecreasePlayerCount()
 {
     PlayerInputs.DecreasePlayers();
 }
Esempio n. 27
0
 public void CmdUpdateInputs(PlayerInputs playerInputs)
 {
     syncedPlayerInputs = playerInputs;
 }
Esempio n. 28
0
 public void IncreasePlayerCount()
 {
     PlayerInputs.IncreasePlayers();
     Debug.Log("inc players");
 }
Esempio n. 29
0
 private void Start()
 {
     inputs = GetComponent <PlayerInputs>();
     stats  = GetComponent <Stats>();
 }
Esempio n. 30
0
 // Use this for initialization
 void Start()
 {
     _inputs = GetComponent<PlayerInputs>();
 }
Esempio n. 31
0
    private void Awake()
    {
        current = this;

        GlobalEvents.OnControlsChanged += OnControlsChanged;
    }