|
|
|
|
|
|
public GameObject ball; |
|
|
|
public bool invertX; |
|
|
|
public int score; |
|
|
|
public GameObject scoreText; |
|
|
|
public GameObject opponent; |
|
|
|
|
|
|
|
private Text textComponent; |
|
|
|
private Rigidbody agentRb; |
|
|
|
|
|
|
{ |
|
|
|
agentRb = GetComponent<Rigidbody>(); |
|
|
|
ballRb = GetComponent<Rigidbody>(); |
|
|
|
textComponent = scoreText.GetComponent<Text>(); |
|
|
|
var canvas = GameObject.Find("Canvas"); |
|
|
|
GameObject scoreBoard; |
|
|
|
if (invertX) |
|
|
|
{ |
|
|
|
scoreBoard = canvas.transform.Find("ScoreB").gameObject; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
scoreBoard = canvas.transform.Find("ScoreA").gameObject; |
|
|
|
} |
|
|
|
textComponent = scoreBoard.GetComponent<Text>(); |
|
|
|
} |
|
|
|
|
|
|
|
public override void CollectObservations() |
|
|
|