本文整理汇总了C#中Manager.getCurrentLevel方法的典型用法代码示例。如果您正苦于以下问题:C# Manager.getCurrentLevel方法的具体用法?C# Manager.getCurrentLevel怎么用?C# Manager.getCurrentLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Manager
的用法示例。
在下文中一共展示了Manager.getCurrentLevel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
// Use this for initialization
void Start() {
gameManager = GameObject.Find ("GameManager").GetComponent<Manager> ();
distance = GameObject.Find ("DistanceToHole").GetComponent<Text> ();
score = GameObject.Find ("Score").GetComponent<Text> ();
name = GameObject.Find ("Name").GetComponent<Text> ();
powerbar = GameObject.Find ("PowerSlider").GetComponent<Slider> ();
gameManager.scoreboard = GameObject.Find ("Leaderboard").GetComponent<Leaderboard> ();
distance.GetComponent<Text>().text = "Distance To Hole:" + distanceToHole;
score.GetComponent<Text>().text = "Strokes:" + strokes;
name.GetComponent<Text> ().text = PlayerPrefs.GetString("playerName");
//Setup powerbar values
powerbar.minValue = minHitPower;
powerbar.maxValue = maxHitPower;
//Ball pointer display
ballPointer.SetActive (true);
scoreTotal = PlayerPrefs.GetInt("totalScore");
gameManager.scoreboard.updateLeaderboard (gameManager.getCurrentLevel(), strokes, scoreTotal);
Debug.Log ("Beginning of level total: " + scoreTotal);
//Debug.Log ("Hole Y Position: " + hole.transform.position.y);
//Debug.Log ("Hole X Position: " + hole.transform.position.x);
}
示例2: Start
// Use this for initialization
void Start () {
DontDestroyOnLoad (GameObject.FindGameObjectWithTag("IngameCanvas"));
gameManager = GameObject.Find ("GameManager").GetComponent<Manager> ();
//Setup leaderboard and set it to be invisible and disabled
cg = GetComponent<CanvasGroup>();
cg.alpha = 0;
cg.interactable = false;
//Setup texts to enable manipulating of fields.
name.GetComponent<Text>().text = PlayerPrefs.GetString("playerName");
lastLevelIndex = gameManager.getTotalLevels () - 2;
//Add restart button logic after game is over
if (gameManager.getCurrentLevel () == lastLevelIndex) {
gameManager.restart = GameObject.Find ("ReturnToMainMenu").GetComponent<Button>();
gameManager.restart.onClick.AddListener(() => gameManager.restartGame());
}
}