// Start is called before the first frame update void Start() { // UIを更新 stageNoUI.text = StageNo.ToString(); var stageNames = GameController.Instance.StageNames; Debug.AssertFormat( StageNo >= 0 && StageNo < stageNames.Length, "不正なStageNo : {0}が指定されました", StageNo); if (StageNo >= 0 && StageNo < stageNames.Length) { // ステージ名の配列から表示 stageNameUI.GetComponentInChildren <Text>().text = stageNames[StageNo]; } // 範囲外のステージ番号が指定された場合 else { // 最終ステージを仮表示してエラーをださない stageNameUI.GetComponentInChildren <Text>().text = stageNames[0]; } clearTimeUI.GetComponentInChildren <Text>().text = ClearTime.ToString("00.00"); bestTimeUI.GetComponentInChildren <Text>().text = GameController.Instance.BestTime.ToString("00.00"); }
// ステージをロードします void LoadStage() { // Resoursesからのパス string path = "Prefabs/Stages/Stage"; path += StageNo.ToString(); Debug.Log(path); Instantiate(Resources.Load <GameObject>(path)); }