// Start is called before the first frame update void Awake() { // player = new Player(); controls = new QinyangControls(); controls.Gameplay.Attack.performed += context => Attack(); controls.Gameplay.Move.performed += context => move = context.ReadValue <Vector2>(); controls.Gameplay.Move.canceled += context => move = Vector2.zero; }
void Awake() { // var player = null; playerInput = GetComponent <PlayerInput>(); player1 = FindObjectOfType <Player>(); player2 = FindObjectOfType <Player2>(); players.Add(player1); players.Add(player2); // player1.playerIndex; index = playerInput.playerIndex; print("inx:" + index); // print("first:"+((Player)players[0]). // print("first:"+(Player)players[0]); // var player = players(p => == index); controls = new QinyangControls(); // controls.Gameplay.Attack.performed += context => Attack(); // controls.Gameplay.Move.performed += context => move = context.ReadValue<Vector2>(); // controls.Gameplay.Move.canceled += context => move = Vector2.zero; //var player = player1.playerIndex; //for (int i = 0; i < players.Count; i++) //{ // // you could, of course, use any string variable to search for. // if (players[i].playerIndex == index) // lbl.Text = players.Items[i].ToString(); //} //if (player1.playerIndex == index) //{ // Player player = player1; //} else if (player2.playerIndex == index) //{ // var player = player2; //} //print(player); }