C# 클래스 ExamplePongLogic, airconsole-unity-plugin

상속: MonoBehaviour
파일 보기 프로젝트 열기: AirConsole/airconsole-unity-plugin

공개 프로퍼티들

프로퍼티 타입 설명
ball UnityEngine.Rigidbody2D
ballSpeed float
racketLeft UnityEngine.Rigidbody2D
racketRight UnityEngine.Rigidbody2D
uiText Text

공개 메소드들

메소드 설명
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

메소드 상세

Awake() 공개 메소드

public Awake ( ) : void
리턴 void

FixedUpdate() 공개 메소드

public FixedUpdate ( ) : void
리턴 void

OnConnect() 공개 메소드

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
public OnConnect ( int device_id ) : void
device_id int The device_id that connected
리턴 void

OnDestroy() 공개 메소드

public OnDestroy ( ) : void
리턴 void

OnDisconnect() 공개 메소드

If the game is running and one of the active players leaves, we reset the game.
public OnDisconnect ( int device_id ) : void
device_id int The device_id that has left.
리턴 void

OnMessage() 공개 메소드

We check which one of the active players has moved the paddle.
public OnMessage ( int device_id, JToken data ) : void
device_id int
data JToken Data.
리턴 void

ResetBall() 공개 메소드

public ResetBall ( bool move ) : void
move bool
리턴 void

StartGame() 공개 메소드

public StartGame ( ) : void
리턴 void

UpdateScoreUI() 공개 메소드

public UpdateScoreUI ( ) : void
리턴 void

프로퍼티 상세

ball 공개적으로 프로퍼티

public Rigidbody2D,UnityEngine ball
리턴 UnityEngine.Rigidbody2D

ballSpeed 공개적으로 프로퍼티

public float ballSpeed
리턴 float

racketLeft 공개적으로 프로퍼티

public Rigidbody2D,UnityEngine racketLeft
리턴 UnityEngine.Rigidbody2D

racketRight 공개적으로 프로퍼티

public Rigidbody2D,UnityEngine racketRight
리턴 UnityEngine.Rigidbody2D

uiText 공개적으로 프로퍼티

public Text uiText
리턴 Text