当前位置: 首页>>代码示例>>C#>>正文


C# Manager.getCurrentLevel方法代码示例

本文整理汇总了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);
    }
开发者ID:Shane-E,项目名称:MiniGolfWorld,代码行数:28,代码来源:Golfball.cs

示例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());
		}
	}
开发者ID:Shane-E,项目名称:MiniGolfWorld,代码行数:21,代码来源:Leaderboard.cs


注:本文中的Manager.getCurrentLevel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。