|
|
|
|
|
|
private Rigidbody ballRb; |
|
|
|
private float invertMult; |
|
|
|
|
|
|
|
// Looks for the scoreboard based on the name of the gameObjects.
|
|
|
|
// Do not modify the names of the Score GameObjects
|
|
|
|
private const string CanvasName = "Canvas"; |
|
|
|
private const string ScoreBoardAName = "ScoreA"; |
|
|
|
private const string ScoreBoardBName = "ScoreB"; |
|
|
|
|
|
|
|
var canvas = GameObject.Find("Canvas"); |
|
|
|
var canvas = GameObject.Find(CanvasName); |
|
|
|
scoreBoard = canvas.transform.Find("ScoreB").gameObject; |
|
|
|
scoreBoard = canvas.transform.Find(ScoreBoardBName).gameObject; |
|
|
|
scoreBoard = canvas.transform.Find("ScoreA").gameObject; |
|
|
|
scoreBoard = canvas.transform.Find(ScoreBoardAName).gameObject; |
|
|
|
} |
|
|
|
textComponent = scoreBoard.GetComponent<Text>(); |
|
|
|
} |
|
|
|