Свойство | Type | Description | |
---|---|---|---|
ball | |||
ballSpeed | float | ||
racketLeft | |||
racketRight | |||
uiText | Text |
Méthode | Description | |
---|---|---|
Awake ( ) : void | ||
FixedUpdate ( ) : void | ||
OnConnect ( int device_id ) : void |
We start the game if 2 players are connected and the game is not already running (activePlayers == null). NOTE: We store the controller device_ids of the active players. We do not hardcode player device_ids 1 and 2, because the two controllers that are connected can have other device_ids e.g. 3 and 7. For more information read: http://developers.airconsole.com/#/guides/device_ids_and_states
|
|
OnDestroy ( ) : void | ||
OnDisconnect ( int device_id ) : void |
If the game is running and one of the active players leaves, we reset the game.
|
|
OnMessage ( int device_id, JToken data ) : void |
We check which one of the active players has moved the paddle.
|
|
ResetBall ( bool move ) : void | ||
StartGame ( ) : void | ||
UpdateScoreUI ( ) : void |
public OnConnect ( int device_id ) : void | ||
device_id | int | The device_id that connected |
Résultat | void |
public OnDisconnect ( int device_id ) : void | ||
device_id | int | The device_id that has left. |
Résultat | void |
public OnMessage ( int device_id, JToken data ) : void | ||
device_id | int | |
data | JToken | Data. |
Résultat | void |
public Rigidbody2D,UnityEngine racketLeft | ||
Résultat |
public Rigidbody2D,UnityEngine racketRight | ||
Résultat |