// Use this for initialization void Start() { AirConsole.instance.onConnect += OnConnect; AirConsole.instance.onDisconnect += OnDisconnect; image = GetComponent <Image>(); playerReady = false; receiver = gameObject.GetComponent <GamepadReceiver>(); receiver.playerNumber = playerNumber; }
protected override void Start() { upButtonPressed = false; tf = GetComponent <Transform>(); receiver = gameObject.AddComponent <GamepadReceiver>(); receiver.playerNumber = playerNumber; print("PlayerScript Number " + playerNumber); upButtonPressed = false; downButtonPressed = false; primaryButtonPressed = false; //Adds a listener to the gamepadreciever receiver.upButtonReleased.AddListener(UpButtonReleased); receiver.upButtonPressed.AddListener(UpButtonPressed); receiver.downButtonReleased.AddListener(DownButtonReleased); receiver.downButtonPressed.AddListener(DownButtonPressed); receiver.primaryButtonReleased.AddListener(PrimaryButtonReleased); receiver.primaryButtonPressed.AddListener(PrimaryButtonPressed); }