浏览代码

Addressed comment

/develop-generalizationTraining-TrainerController
vincentpierre 6 年前
当前提交
77d62622
共有 1 个文件被更改,包括 9 次插入3 次删除
  1. 12
      UnitySDK/Assets/ML-Agents/Examples/Tennis/Scripts/TennisAgent.cs

12
UnitySDK/Assets/ML-Agents/Examples/Tennis/Scripts/TennisAgent.cs


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>();
}

正在加载...
取消
保存