本文整理汇总了C#中ItemInfo.getItemInfo方法的典型用法代码示例。如果您正苦于以下问题:C# ItemInfo.getItemInfo方法的具体用法?C# ItemInfo.getItemInfo怎么用?C# ItemInfo.getItemInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ItemInfo
的用法示例。
在下文中一共展示了ItemInfo.getItemInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnClick
public void OnClick()
{
//SE
audio.PlayOneShot(touch);
/*Common Process*/
string pathOfBoard = "Prefabs/Map/Popup";
GameObject board = Instantiate(Resources.Load (pathOfBoard)) as GameObject;
board.transform.parent = GameObject.Find ("Map").transform;
board.transform.localScale = new Vector2 (1,0.8f);
board.transform.localPosition = new Vector2 (0,0);
/*Indivisual Process by Kuni*/
string pathOfKuniMap = "Prefabs/Map/stage/kuniMap" + kuniId;
GameObject kuniMap = Instantiate(Resources.Load (pathOfKuniMap)) as GameObject;
GameObject.Find ("kuniName").GetComponent<Text>().text = kuniName;
//kuni
kuniMap.transform.parent = GameObject.Find ("board").transform;
kuniMap.transform.localScale = new Vector2 (9, 6);
kuniMap.transform.localPosition = new Vector3 (-145,4,0);
kuniMap.name = "kuniMap" + kuniId;
//Clear Stage Setting
string clearedStage = "kuni" + kuniId;
string clearedStageString = PlayerPrefs.GetString (clearedStage);
List<string> clearedStageList = new List<string>();
if (clearedStageString != null && clearedStageString != "") {
char[] delimiterChars = {','};
clearedStageList = new List<string>(clearedStageString.Split (delimiterChars));
}
//Default Value
Entity_stage_mst stageMst = Resources.Load ("Data/stage_mst") as Entity_stage_mst;
int startline = 10 * kuniId - 10;
string stagePath = "Prefabs/Map/stage/stage";
string clearedPath = "Prefabs/Map/cleared";
int stageId = 1;
bool clearedFlg = false;
for(int i=startline; i<startline+10; i++){
GameObject stage = Instantiate (Resources.Load (stagePath)) as GameObject;
stage.transform.SetParent(kuniMap.transform);
stage.transform.localScale = new Vector2 (1, 1);
stage.name = "stage" + stageId.ToString();
//Cleared Check
if(clearedStageList.Contains(stageId.ToString()) == true){
GameObject cleared = Instantiate (Resources.Load (clearedPath)) as GameObject;
cleared.transform.SetParent(stage.transform);
cleared.transform.localScale = new Vector2(0.1f,0.15f);
cleared.transform.localPosition = new Vector2(0,0);
clearedFlg = true;
}
//Get Stage Info
string stageName = stageMst.param[i].stageName;
int Exp = stageMst.param[i].exp;
int Money = stageMst.param[i].money;
string itemGrp = stageMst.param[i].itemGrp;
string itemTyp = stageMst.param[i].itemTyp;
int itemId = stageMst.param[i].itemId;
int itemQty = stageMst.param[i].itemQty;
int locationX = stageMst.param[i].LocationX;
int locationY = stageMst.param[i].LocationY;
RectTransform stageTransform = stage.GetComponent<RectTransform> ();
stageTransform.anchoredPosition = new Vector3 (locationX, locationY, 0);
stage.GetComponent<ShowStageDtl>().kuniId = kuniId;
stage.GetComponent<ShowStageDtl>().stageId = stageId;
stage.GetComponent<ShowStageDtl>().stageName = stageName;
stage.GetComponent<ShowStageDtl>().exp = Exp;
stage.GetComponent<ShowStageDtl>().money = Money;
stage.GetComponent<ShowStageDtl>().itemGrp = itemGrp;
stage.GetComponent<ShowStageDtl>().itemTyp = itemTyp;
stage.GetComponent<ShowStageDtl>().itemId = itemId.ToString();
stage.GetComponent<ShowStageDtl>().itemQty = itemQty;
if(itemGrp=="kahou"){
KahouStatusGet kahouSts = new KahouStatusGet();
List<string> kahouInfoList =kahouSts.getKahouInfo(itemTyp, itemId);
stage.GetComponent<ShowStageDtl>().ratio = float.Parse(kahouInfoList[7]);
}else if(itemGrp=="item"){
ItemInfo itemSts = new ItemInfo();
string temp = itemTyp + itemId.ToString();
List<string> itemInfoList = itemSts.getItemInfo(temp);
stage.GetComponent<ShowStageDtl>().ratio = float.Parse(itemInfoList[6]);
}
stageId = stageId + 1;
}
/*Naisei Button*/
string naiseiPath = "Prefabs/Map/NaiseiButton";
GameObject naiseiBtn = Instantiate(Resources.Load (naiseiPath)) as GameObject;
naiseiBtn.transform.parent = GameObject.Find ("Popup(Clone)").transform;
naiseiBtn.GetComponent<StartNaisei> ().activeKuniId = kuniId;
//.........这里部分代码省略.........
示例2: showKouekiItem
public void showKouekiItem(int kuniQty, GameObject content, string itemPath, string itemCd, int yukoudo, GameObject slider, GameObject buyBtn, bool doumeiFlg){
Color lowColor = new Color (0f / 255f, 0f / 255f, 219f / 255f, 255f / 255f);
Color midColor = new Color (94f / 255f, 0f / 255f, 0f / 255f, 255f / 255f);
Color highColor = new Color (84f / 255f, 103f / 255f, 0f / 255f, 255f / 255f);
int rank = getItemRank(kuniQty);
for(int i=1;i<=rank;i++){
string slotPath = "Prefabs/Map/gaikou/KouekiSlot";
GameObject slot = Instantiate (Resources.Load (slotPath)) as GameObject;
slot.transform.SetParent (content.transform);
slot.transform.localScale = new Vector3 (1, 1, 1);
GameObject item = Instantiate (Resources.Load (itemPath)) as GameObject;
item.transform.SetParent (slot.transform);
item.transform.localScale = new Vector3 (1, 1, 1);
if(i==1){
item.GetComponent<Image>().color = lowColor;
}else if(i==2){
item.GetComponent<Image>().color = midColor;
if(itemCd == "CyouheiKB" || itemCd == "CyouheiTP"|| itemCd == "CyouheiYR" || itemCd =="CyouheiYM"){
item.transform.FindChild("CyouheiRank").GetComponent<Text>().text = "中";
}else if(itemCd == "Shinobi"){
item.transform.FindChild("ShinobiRank").GetComponent<Text>().text = "中";
}else if(itemCd == "Hidensyo"){
item.transform.FindChild("HidensyoRank").GetComponent<Text>().text = "中";
}
}else if(i==3){
item.GetComponent<Image>().color = highColor;
if(itemCd == "CyouheiKB" || itemCd == "CyouheiTP"|| itemCd == "CyouheiYR" || itemCd =="CyouheiYM"){
item.transform.FindChild("CyouheiRank").GetComponent<Text>().text = "上";
}else if(itemCd == "Shinobi"){
item.transform.FindChild("ShinobiRank").GetComponent<Text>().text = "上";
}else if(itemCd == "Hidensyo"){
item.transform.FindChild("HidensyoRank").GetComponent<Text>().text = "上";
}
}
//Common
slot.name = itemCd + i.ToString();
slot.GetComponent<ItemInfo>().yukoudo = yukoudo;
//Adjust Price by Yukoudo
List<string> itemInfoList = new List<string> ();
ItemInfo itemScript = new ItemInfo();
itemInfoList = itemScript.getItemInfo (slot.name);
float unitPrice = float.Parse(itemInfoList[4]);
float rate = 2 - (float)yukoudo/100;
if(doumeiFlg){
rate = rate - 0.2f;
}
int finalPrice = Mathf.CeilToInt(unitPrice * rate);
slot.GetComponent<ItemInfo>().buyUnitPirce = finalPrice;
slot.GetComponent<ItemInfo>().buySlider = slider;
slot.GetComponent<ItemInfo>().Content = content;
slot.GetComponent<ItemInfo>().buyBtn = buyBtn;
//Size Adjustment
if(itemCd == "Shinobi"){
RectTransform rect = item.transform.FindChild("Shinobi").GetComponent<RectTransform>();
rect.sizeDelta = new Vector2(100,120);
}
}
}