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


C# ItemInfo.getItemName方法代码示例

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


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

示例1: Start


//.........这里部分代码省略.........
				slot.GetComponent<Saku>().sakuBusyoId =  busyoId;

				//Busyo Speed
				int sakuBusyoLv = PlayerPrefs.GetInt(busyoId.ToString());
				slot.GetComponent<Saku>().sakuBusyoSpeed = sts.getSpd(busyoId,sakuBusyoLv);
			}



		}

		//Kengou
		string kengouString = PlayerPrefs.GetString("kengouItem");
		List<string> kengouList = new List<string> ();
		char[] delimiterChars3 = {','};
		kengouList = new List<string> (kengouString.Split (delimiterChars3));

		for (int i=0; i<kengouList.Count; i++) {
			int qty = int.Parse(kengouList[i]);
			if(qty != 0){
				GameObject slot = Instantiate (Resources.Load (slotPath)) as GameObject;
				string kengouPath = "Prefabs/Saku/saku7";
				GameObject sakuIcon = Instantiate (Resources.Load (kengouPath)) as GameObject;
				sakuIcon.transform.SetParent (slot.transform);
				sakuIcon.transform.localScale = new Vector2 (0.45f, 0.45f);
				sakuIcon.GetComponent<Button>().enabled = false;

				slot.transform.SetParent (content.transform);
				slot.transform.localScale = new Vector2 (1, 1);

				ItemInfo item = new ItemInfo();
				int temp = i + 1;
				string itemCd = "kengou" + temp.ToString();
				string kengouName = item.getItemName(itemCd);
				sakuIcon.transform.FindChild("sakuIconText").GetComponent<Text>().text = kengouName;
				sakuIcon.transform.FindChild("sakuIconText").transform.localScale = new Vector2 (0.11f,0.15f);

				slot.GetComponent<Saku>().sakuId = 7;

				int effect = item.getItemEffect(itemCd);
				slot.GetComponent<Saku>().sakuEffect = effect;
				slot.GetComponent<Saku>().kengouCd = itemCd;
				slot.GetComponent<Saku>().kengouQty = qty;
				slot.GetComponent<Saku>().kengouName = kengouName;
			}
		}


		//Nanban
		string nanbanString = PlayerPrefs.GetString("nanbanItem");
		List<string> nanbanList = new List<string> ();
		nanbanList = new List<string> (nanbanString.Split (delimiterChars3));

		for (int i=0; i<nanbanList.Count; i++) {
			int qty = int.Parse(nanbanList[i]);
			if(qty != 0){
				GameObject slot = Instantiate (Resources.Load (slotPath)) as GameObject;

				string nanbanPath = "";
				if(i==0){
					nanbanPath = "Prefabs/Saku/saku8";
				}else if(i==1){
					nanbanPath = "Prefabs/Saku/saku9";
				}else if(i==2){
					nanbanPath = "Prefabs/Saku/saku10";
				}
开发者ID:zeimoter,项目名称:sengoku2d,代码行数:67,代码来源:GameScene.cs

示例2: OnClick


//.........这里部分代码省略.........
			highShinobi.name = "Shinobi3";
			highShinobi.GetComponent<Button>().enabled = true;
			highShinobi.GetComponent<ItemInfo>().posessQty = shinobiJyoQty;
		}


		//5. Kengou
		string kengouPath = "Prefabs/Item/kengou";

		string kengouString = PlayerPrefs.GetString("kengouItem");
		List<string> kengouList = new List<string> ();
		kengouList = new List<string> (kengouString.Split (delimiterChars));

		for(int i=0; i<kengouList.Count; i++){
			string qty = kengouList[i];

			if(qty != "0"){
				GameObject kengou = Instantiate (Resources.Load (kengouPath)) as GameObject;
				kengou.transform.SetParent(GameObject.Find ("Content").transform);
				kengou.transform.localScale = new Vector2 (1, 1);
				kengou.transform.localPosition = new Vector3 (0, 0, 0);
				kengou.transform.FindChild("Qty").GetComponent<Text>().text = qty.ToString();

				int temp = i + 1;
				kengou.name = "kengou" + temp.ToString();

				RectTransform kengouTransform = kengou.transform.FindChild("Image").GetComponent<RectTransform>();
				kengouTransform.sizeDelta = new Vector2(120,120);

				RectTransform rankTransform = kengou.transform.FindChild("Rank").GetComponent<RectTransform>();
				rankTransform.anchoredPosition3D = new Vector3(-70,20,0);
				rankTransform.localScale = new Vector2(0.13f,0.13f);
				ItemInfo item = new ItemInfo();
				kengou.transform.FindChild("Rank").GetComponent<Text>().text = item.getItemName(kengou.name);

				kengou.GetComponent<Button>().enabled = true;
				kengou.GetComponent<ItemInfo>().posessQty = int.Parse(qty);
			}
		}

		//6. Gokui
		string gokuiPath = "Prefabs/Item/gokui";
		
		string gokuiString = PlayerPrefs.GetString("gokuiItem");
		List<string> gokuiList = new List<string> ();
		gokuiList = new List<string> (gokuiString.Split (delimiterChars));
		
		for(int i=0; i<gokuiList.Count; i++){
			string qty = gokuiList[i];
			
			if(qty != "0"){
				GameObject gokui = Instantiate (Resources.Load (gokuiPath)) as GameObject;
				gokui.transform.SetParent(GameObject.Find ("Content").transform);
				gokui.transform.localScale = new Vector2 (1, 1);
				gokui.transform.localPosition = new Vector3 (0, 0, 0);
				gokui.transform.FindChild("Qty").GetComponent<Text>().text = qty.ToString();
				
				int temp = i + 1;
				gokui.name = "gokui" + temp.ToString();

				RectTransform rankTransform = gokui.transform.FindChild("Rank").GetComponent<RectTransform>();
				rankTransform.anchoredPosition3D = new Vector3(-70,20,0);
				rankTransform.localScale = new Vector2(0.09f,0.13f);
				ItemInfo item = new ItemInfo();
				gokui.transform.FindChild("Rank").GetComponent<Text>().text = item.getItemName(gokui.name);
				
开发者ID:zeimoter,项目名称:sengoku2d,代码行数:66,代码来源:DouguSoukoScene.cs


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