本文整理汇总了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";
}
示例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);