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


C# Stage.getStageMap方法代码示例

本文整理汇总了C#中Stage.getStageMap方法的典型用法代码示例。如果您正苦于以下问题:C# Stage.getStageMap方法的具体用法?C# Stage.getStageMap怎么用?C# Stage.getStageMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Stage的用法示例。


在下文中一共展示了Stage.getStageMap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Start

	// Use this for initialization
	void Start () {


		//Dinamic Map
		activeKuniId  = PlayerPrefs.GetInt("activeKuniId");
		activeStageId = PlayerPrefs.GetInt("activeStageId");
		Stage stage = new Stage ();

		if (activeStageId != 0) {
			//Active

			int stageMapId = stage.getStageMap (activeKuniId, activeStageId); 

			string mapPath = "";
			string mapFrontPath = "";
			Instantiate (wallPrefab);

			if (stageMapId != 1) {
				if (stageMapId == 2) {
					//mountain
					mapPath = "Prefabs/PreKassen/map2";
					GameObject map = Instantiate (Resources.Load (mapPath)) as GameObject;

					mapFrontPath = "Prefabs/PreKassen/mapFront2";
					GameObject mapFront = Instantiate (Resources.Load (mapFrontPath)) as GameObject;

					weatherHandling(stageMapId, map, mapFront);

				} else if (stageMapId == 3) {
					//sea
					mapPath = "Prefabs/PreKassen/map3";
					GameObject map = Instantiate (Resources.Load (mapPath)) as GameObject;

					mapFrontPath = "Prefabs/PreKassen/mapFront3";
					GameObject mapFront = Instantiate (Resources.Load (mapFrontPath)) as GameObject;

					weatherHandling(stageMapId, map, mapFront);
				}
			} else {
				
				Instantiate (treePrefab);

				mapPath = "Prefabs/PreKassen/map1";
				GameObject map = Instantiate (Resources.Load (mapPath)) as GameObject;

				weatherHandling(stageMapId, map, null);
			}

		} else {
			//Passive
			int stageMapId = stage.getStageMap (activeKuniId, 10); 

			string mapPath = "";
			string mapFrontPath = "";
			Instantiate (wallPrefab);

			if (stageMapId != 1) {
				if (stageMapId == 2) {
					//mountain
					mapPath = "Prefabs/PreKassen/map2";
					GameObject map = Instantiate (Resources.Load (mapPath)) as GameObject;

					mapFrontPath = "Prefabs/PreKassen/mapFront2";
					GameObject mapFront = Instantiate (Resources.Load (mapFrontPath)) as GameObject;

					weatherHandling(stageMapId, map, mapFront);

				} else if (stageMapId == 3) {
					//sea
					mapPath = "Prefabs/PreKassen/map3";
					GameObject map = Instantiate (Resources.Load (mapPath)) as GameObject;

					mapFrontPath = "Prefabs/PreKassen/mapFront3";
					GameObject mapFront = Instantiate (Resources.Load (mapFrontPath)) as GameObject;

					weatherHandling(stageMapId, map, mapFront);
				}
			} else {
				Instantiate (mapPrefab);
				Instantiate (treePrefab);

				weatherHandling(stageMapId, mapPrefab, null);
			}
		}

		/*Get Minus Status*/
		float mntMinusRatio = PlayerPrefs.GetFloat("mntMinusStatus",0);
		float seaMinusRatio = PlayerPrefs.GetFloat("seaMinusStatus",0);
		float rainMinusRatio = PlayerPrefs.GetFloat("rainMinusStatus",0);
		float snowMinusRatio = PlayerPrefs.GetFloat("snowMinusStatus",0);
	
		/*プレイヤー配置*/
		//ユーザ陣形データのロード
		int jinkei =PlayerPrefs.GetInt("jinkei",0);
		List<int> myBusyoList = new List<int> (); 

		//1.魚麟
		if (jinkei == 1) {
			soudaisyo = PlayerPrefs.GetInt("soudaisyo1");
//.........这里部分代码省略.........
开发者ID:zeimoter,项目名称:sengoku2d,代码行数:101,代码来源:GameScene.cs

示例2: Start

	void Start () {

		//Stage Name
		string stageName = PlayerPrefs.GetString("activeStageName");
		GameObject.Find ("KassenNameValue").GetComponent<Text> ().text = stageName + "の戦い";


		//Wether Handling
		int weatherId = getWeatherId();
		Color rainSnowColor = new Color (140f / 255f, 140f / 255f, 140f / 255f, 255f / 255f);

		//if passive kassen
		isAttackedFlg = PlayerPrefs.GetBool ("isAttackedFlg");
		Stage stage = new Stage ();
		int stageMapId = 0;

		GameObject panel = GameObject.Find ("Panel").gameObject;
		if (isAttackedFlg) {
			//Passive
			GameObject tettaiBtn = GameObject.Find ("TettaiBtn").gameObject;
			GameObject hyourouIcon = GameObject.Find ("StartBtn").transform.FindChild ("hyourouIcon").gameObject;
			Destroy (tettaiBtn.gameObject);
			Destroy (hyourouIcon.gameObject);

			int activeKuniId  = PlayerPrefs.GetInt("activeKuniId");
			stageMapId = stage.getStageMap (activeKuniId, 10); 

			string mapPath = "";
			string mapFrontPath = "";

			if (stageMapId != 1) {

				GameObject frontImage = panel.transform.FindChild ("FrontImage").gameObject;
				frontImage.GetComponent<Image> ().enabled = true;

				if (stageMapId == 2) {
					//mountain
					mapPath = "Prefabs/PreKassen/map/map2";
					panel.GetComponent<Image> ().sprite = 
						Resources.Load (mapPath, typeof(Sprite)) as Sprite;

					mapFrontPath = "Prefabs/PreKassen/frontMap/mapFront2";
					frontImage.GetComponent<Image> ().sprite = 
						Resources.Load (mapFrontPath, typeof(Sprite)) as Sprite;

					if (weatherId == 2 || weatherId == 3) {
						panel.GetComponent<Image> ().color = rainSnowColor;
						frontImage.GetComponent<Image> ().color = rainSnowColor;
					}


				} else if (stageMapId == 3) {
					//sea
					mapPath = "Prefabs/PreKassen/map/map3";
					panel.GetComponent<Image> ().sprite = 
						Resources.Load (mapPath, typeof(Sprite)) as Sprite;

					mapFrontPath = "Prefabs/PreKassen/frontMap/mapFront3";
					frontImage.GetComponent<Image> ().sprite = 
						Resources.Load (mapFrontPath, typeof(Sprite)) as Sprite;

					if (weatherId == 2 || weatherId == 3) {
						panel.GetComponent<Image> ().color = rainSnowColor;
						frontImage.GetComponent<Image> ().color = rainSnowColor;
					}
				}
			} else {
				if (weatherId == 2 || weatherId == 3) {
					panel.GetComponent<Image> ().color = rainSnowColor;
				}
			}
		} else {
			//Active
			int activeKuniId  = PlayerPrefs.GetInt("activeKuniId");
			int activeStageId = PlayerPrefs.GetInt("activeStageId");


			stageMapId = stage.getStageMap (activeKuniId, activeStageId); 

			string mapPath = "";
			string mapFrontPath = "";
			if (stageMapId != 1) {
				
				GameObject frontImage = panel.transform.FindChild("FrontImage").gameObject;
				frontImage.GetComponent<Image> ().enabled = true;

				if (stageMapId == 2) {
					//mountain
					mapPath = "Prefabs/PreKassen/map/map2";
					panel.GetComponent<Image> ().sprite = 
						Resources.Load (mapPath, typeof(Sprite)) as Sprite;

					mapFrontPath = "Prefabs/PreKassen/frontMap/mapFront2";
					frontImage.GetComponent<Image> ().sprite = 
						Resources.Load (mapFrontPath, typeof(Sprite)) as Sprite;

					if (weatherId == 2 || weatherId == 3) {
						panel.GetComponent<Image> ().color = rainSnowColor;
						frontImage.GetComponent<Image> ().color = rainSnowColor;
					}
//.........这里部分代码省略.........
开发者ID:zeimoter,项目名称:sengoku2d,代码行数:101,代码来源:preKassen.cs


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