public int getExpbyCyadougu(int busyoId, int nowExp) { int resultExp = nowExp; string temp = "kahou" + busyoId; string busyoKahou = PlayerPrefs.GetString(temp); if (busyoKahou != null && busyoKahou != "") { char[] delimiterChars = { ',' }; string[] busyoKahouList = busyoKahou.Split(delimiterChars); for (int i = 0; i < busyoKahouList.Length; i++) { if (i == 4 || i == 5) { int kahouId = int.Parse(busyoKahouList [i]); Entity_kahou_cyadougu_mst Mst = Resources.Load("Data/kahou_cyadougu_mst") as Entity_kahou_cyadougu_mst; if (kahouId != 0) { //Cyadougu if (Mst.param [kahouId - 1].unit == "%") { resultExp = resultExp + (resultExp * Mst.param [kahouId - 1].kahouEffect) / 100; } else { resultExp = resultExp + (Mst.param [kahouId - 1].kahouEffect); } } } } } return(resultExp); }
public string getKahouRank(string kahouType, int kahouId) { string kahouRank = ""; if (kahouType == "cyadougu") { Entity_kahou_cyadougu_mst Mst = Resources.Load("Data/kahou_cyadougu_mst") as Entity_kahou_cyadougu_mst; kahouRank = Mst.param [kahouId - 1].kahouRank; } else if (kahouType == "heihousyo") { Entity_kahou_heihousyo_mst Mst = Resources.Load("Data/kahou_heihousyo_mst") as Entity_kahou_heihousyo_mst; kahouRank = Mst.param [kahouId - 1].kahouRank; } else if (kahouType == "chishikisyo") { Entity_kahou_chishikisyo_mst Mst = Resources.Load("Data/kahou_chishikisyo_mst") as Entity_kahou_chishikisyo_mst; kahouRank = Mst.param [kahouId - 1].kahouRank; } else if (kahouType == "bugu") { Entity_kahou_bugu_mst Mst = Resources.Load("Data/kahou_bugu_mst") as Entity_kahou_bugu_mst; kahouRank = Mst.param [kahouId - 1].kahouRank; } else if (kahouType == "meiba") { Entity_kahou_meiba_mst Mst = Resources.Load("Data/kahou_meiba_mst") as Entity_kahou_meiba_mst; kahouRank = Mst.param [kahouId - 1].kahouRank; } else if (kahouType == "gusoku") { Entity_kahou_gusoku_mst Mst = Resources.Load("Data/kahou_gusoku_mst") as Entity_kahou_gusoku_mst; kahouRank = Mst.param [kahouId - 1].kahouRank; } else if (kahouType == "kabuto") { Entity_kahou_kabuto_mst Mst = Resources.Load("Data/kahou_kabuto_mst") as Entity_kahou_kabuto_mst; kahouRank = Mst.param [kahouId - 1].kahouRank; } return(kahouRank); }
public void showKahouZukan(GameObject Content){ int NowQty = 0; Entity_kahou_bugu_mst tmpbuguMst = Resources.Load ("Data/kahou_bugu_mst") as Entity_kahou_bugu_mst; Entity_kahou_gusoku_mst tmpgusokuMst = Resources.Load ("Data/kahou_gusoku_mst") as Entity_kahou_gusoku_mst; Entity_kahou_kabuto_mst tmpkabutoMst = Resources.Load ("Data/kahou_kabuto_mst") as Entity_kahou_kabuto_mst; Entity_kahou_meiba_mst tmpmeibaMst = Resources.Load ("Data/kahou_meiba_mst") as Entity_kahou_meiba_mst; Entity_kahou_cyadougu_mst tmpcyadouguMst = Resources.Load ("Data/kahou_cyadougu_mst") as Entity_kahou_cyadougu_mst; Entity_kahou_chishikisyo_mst tmpchishikisyoMst = Resources.Load ("Data/kahou_chishikisyo_mst") as Entity_kahou_chishikisyo_mst; Entity_kahou_heihousyo_mst tmpheihousyoMst = Resources.Load ("Data/kahou_heihousyo_mst") as Entity_kahou_heihousyo_mst; Entity_kahou_bugu_mst buguMst = new Entity_kahou_bugu_mst(); Entity_kahou_gusoku_mst gusokuMst = new Entity_kahou_gusoku_mst(); Entity_kahou_kabuto_mst kabutoMst = new Entity_kahou_kabuto_mst(); Entity_kahou_meiba_mst meibaMst = new Entity_kahou_meiba_mst(); Entity_kahou_cyadougu_mst cyadouguMst = new Entity_kahou_cyadougu_mst(); Entity_kahou_chishikisyo_mst chishikisyoMst = new Entity_kahou_chishikisyo_mst(); Entity_kahou_heihousyo_mst heihousyoMst = new Entity_kahou_heihousyo_mst(); buguMst.param.AddRange (tmpbuguMst.param); gusokuMst.param.AddRange (tmpgusokuMst.param); kabutoMst.param.AddRange (tmpkabutoMst.param); meibaMst.param.AddRange (tmpmeibaMst.param); cyadouguMst.param.AddRange (tmpcyadouguMst.param); chishikisyoMst.param.AddRange (tmpchishikisyoMst.param); heihousyoMst.param.AddRange (tmpheihousyoMst.param); //Bugu //Prepare Master & History string zukanBuguHst = PlayerPrefs.GetString ("zukanBuguHst"); List<string> zukanBuguHstList = new List<string> (); char[] delimiterChars = {','}; if (zukanBuguHst != "" && zukanBuguHst != null) { if (zukanBuguHst.Contains (",")) { zukanBuguHstList = new List<string> (zukanBuguHst.Split (delimiterChars)); } else { zukanBuguHstList.Add (zukanBuguHst); } } //Sort Master by daimyo buguMst.param.Sort((x, y) => { return x.kahouRank.CompareTo(y.kahouRank); }); //Show Kahou string noBuguPath = "Prefabs/Item/Sprite/NoBugu"; for (int i=0; i<buguMst.param.Count; i++) { int kahouId = buguMst.param[i].id; //Get Status string kahouPath = "Prefabs/Item/Kahou/bugu" + kahouId; GameObject kahouIcon = Instantiate (Resources.Load (kahouPath)) as GameObject; kahouIcon.transform.SetParent(Content.transform); kahouIcon.transform.localScale = new Vector2 (1, 1); if(!zukanBuguHstList.Contains(kahouId.ToString())){ //Don't have kahouIcon.GetComponent<Image> ().sprite = Resources.Load (noBuguPath, typeof(Sprite)) as Sprite; kahouIcon.GetComponent<Button>().enabled = false; }else{ NowQty = NowQty + 1; kahouIcon.GetComponent<KahouInfo>().kahouType = "bugu"; kahouIcon.GetComponent<KahouInfo>().kahouId = kahouId; } } //Gusoku //Prepare Master & History string zukanGusokuHst = PlayerPrefs.GetString ("zukanGusokuHst"); List<string> zukanGusokuHstList = new List<string> (); if (zukanGusokuHst != "" && zukanGusokuHst != null) { if (zukanGusokuHst.Contains (",")) { zukanGusokuHstList = new List<string> (zukanGusokuHst.Split (delimiterChars)); } else { zukanGusokuHstList.Add (zukanGusokuHst); } } //Sort Master by daimyo gusokuMst.param.Sort((a, b) => { return a.kahouRank.CompareTo(b.kahouRank); }); //Show Kahou string noGusokuPath = "Prefabs/Item/Sprite/NoGusoku"; for (int i=0; i<gusokuMst.param.Count; i++) { int kahouId = gusokuMst.param[i].id; string kahouPath = "Prefabs/Item/Kahou/gusoku" + kahouId; GameObject kahouIcon = Instantiate (Resources.Load (kahouPath)) as GameObject; kahouIcon.transform.SetParent(Content.transform); kahouIcon.transform.localScale = new Vector2 (1, 1); if(!zukanGusokuHstList.Contains(kahouId.ToString())){ //Don't have kahouIcon.GetComponent<Image> ().sprite = Resources.Load (noGusokuPath, typeof(Sprite)) as Sprite; kahouIcon.GetComponent<Button>().enabled = false; }else{ NowQty = NowQty + 1; kahouIcon.GetComponent<KahouInfo>().kahouType = "gusoku"; kahouIcon.GetComponent<KahouInfo>().kahouId = kahouId; } } //Kabuto //Prepare Master & History string zukanKabutoHst = PlayerPrefs.GetString ("zukanKabutoHst"); List<string> zukanKabutoHstList = new List<string> (); if (zukanKabutoHst != "" && zukanKabutoHst != null) { if (zukanKabutoHst.Contains (",")) { zukanKabutoHstList = new List<string> (zukanKabutoHst.Split (delimiterChars)); } else { zukanKabutoHstList.Add (zukanKabutoHst); } } //Sort Master by daimyo kabutoMst.param.Sort((x, y) => { return x.kahouRank.CompareTo(y.kahouRank); }); //Show Kahou string noKabutoPath = "Prefabs/Item/Sprite/NoKabuto"; for (int i=0; i<kabutoMst.param.Count; i++) { int kahouId = kabutoMst.param[i].id; string kahouPath = "Prefabs/Item/Kahou/kabuto" + kahouId; GameObject kahouIcon = Instantiate (Resources.Load (kahouPath)) as GameObject; kahouIcon.transform.SetParent(Content.transform); kahouIcon.transform.localScale = new Vector2 (1, 1); if(!zukanKabutoHstList.Contains(kahouId.ToString())){ //Don't have kahouIcon.GetComponent<Image> ().sprite = Resources.Load (noKabutoPath , typeof(Sprite)) as Sprite; kahouIcon.GetComponent<Button>().enabled = false; }else{ NowQty = NowQty + 1; kahouIcon.GetComponent<KahouInfo>().kahouType = "kabuto"; kahouIcon.GetComponent<KahouInfo>().kahouId = kahouId; } } // Meiba //Prepare Master & History string zukanMeibaHst = PlayerPrefs.GetString ("zukanMeibaHst"); List<string> zukanMeibaHstList = new List<string> (); if (zukanMeibaHst != "" && zukanMeibaHst != null) { if (zukanMeibaHst.Contains (",")) { zukanMeibaHstList = new List<string> (zukanMeibaHst.Split (delimiterChars)); } else { zukanMeibaHstList.Add (zukanMeibaHst); } } //Sort Master by daimyo meibaMst.param.Sort((x, y) => { return x.kahouRank.CompareTo(y.kahouRank); }); //Show Kahou string noMeibaPath = "Prefabs/Item/Sprite/NoMeiba"; for (int i=0; i<meibaMst.param.Count; i++) { int kahouId = meibaMst.param[i].id; string kahouPath = "Prefabs/Item/Kahou/meiba" + kahouId; GameObject kahouIcon = Instantiate (Resources.Load (kahouPath)) as GameObject; kahouIcon.transform.SetParent(Content.transform); kahouIcon.transform.localScale = new Vector2 (1, 1); if(!zukanMeibaHstList.Contains(kahouId.ToString())){ //Don't have kahouIcon.GetComponent<Image> ().sprite = Resources.Load (noMeibaPath, typeof(Sprite)) as Sprite; kahouIcon.GetComponent<Button>().enabled = false; }else{ NowQty = NowQty + 1; kahouIcon.GetComponent<KahouInfo>().kahouType = "meiba"; kahouIcon.GetComponent<KahouInfo>().kahouId = kahouId; } } //Cyadougu //Prepare Master & History string zukanCyadouguHst = PlayerPrefs.GetString ("zukanCyadouguHst"); List<string> zukanCyadouguHstList = new List<string> (); if (zukanCyadouguHst != "" && zukanCyadouguHst != null) { if (zukanCyadouguHst.Contains (",")) { zukanCyadouguHstList = new List<string> (zukanCyadouguHst.Split (delimiterChars)); } else { zukanCyadouguHstList.Add (zukanCyadouguHst); } } //Sort Master by daimyo cyadouguMst.param.Sort((x, y) => { return x.kahouRank.CompareTo(y.kahouRank); }); //Show Kahou string noCyadouguPath = "Prefabs/Item/Sprite/NoCyadougu"; for (int i=0; i<cyadouguMst.param.Count; i++) { int kahouId = cyadouguMst.param[i].id; string kahouPath = "Prefabs/Item/Kahou/cyadougu" + kahouId; GameObject kahouIcon = Instantiate (Resources.Load (kahouPath)) as GameObject; kahouIcon.transform.SetParent(Content.transform); kahouIcon.transform.localScale = new Vector2 (1, 1); if(!zukanCyadouguHstList.Contains(kahouId.ToString())){ //Don't have kahouIcon.GetComponent<Image> ().sprite = Resources.Load (noCyadouguPath, typeof(Sprite)) as Sprite; kahouIcon.GetComponent<Button>().enabled = false; }else{ NowQty = NowQty + 1; kahouIcon.GetComponent<KahouInfo>().kahouType = "cyadougu"; kahouIcon.GetComponent<KahouInfo>().kahouId = kahouId; } } // Chishikisyo //Prepare Master & History string zukanChishikisyoHst = PlayerPrefs.GetString ("zukanChishikisyoHst"); List<string> zukanChishikisyoHstList = new List<string> (); if (zukanChishikisyoHst != "" && zukanChishikisyoHst != null) { if (zukanChishikisyoHst.Contains (",")) { zukanChishikisyoHstList = new List<string> (zukanChishikisyoHst.Split (delimiterChars)); } else { zukanChishikisyoHstList.Add (zukanChishikisyoHst); } } //Sort Master by daimyo chishikisyoMst.param.Sort((x, y) => { return x.kahouRank.CompareTo(y.kahouRank); }); //Show Kahou string noChishikisyoPath = "Prefabs/Item/Sprite/NoChishikisyo"; for (int i=0; i<chishikisyoMst.param.Count; i++) { int kahouId = chishikisyoMst.param[i].id; string kahouPath = "Prefabs/Item/Kahou/chishikisyo" + kahouId; GameObject kahouIcon = Instantiate (Resources.Load (kahouPath)) as GameObject; kahouIcon.transform.SetParent(Content.transform); kahouIcon.transform.localScale = new Vector2 (1, 1); if(!zukanChishikisyoHstList.Contains(kahouId.ToString())){ //Don't have kahouIcon.GetComponent<Image> ().sprite = Resources.Load (noChishikisyoPath, typeof(Sprite)) as Sprite; kahouIcon.GetComponent<Button>().enabled = false; }else{ NowQty = NowQty + 1; kahouIcon.GetComponent<KahouInfo>().kahouType = "chishikisyo"; kahouIcon.GetComponent<KahouInfo>().kahouId = kahouId; } } // Heihousyo //Prepare Master & History string zukanHeihousyoHst = PlayerPrefs.GetString ("zukanHeihousyoHst"); List<string> zukanHeihousyoHstList = new List<string> (); if (zukanHeihousyoHst != "" && zukanHeihousyoHst != null) { if (zukanHeihousyoHst.Contains (",")) { zukanHeihousyoHstList = new List<string> (zukanHeihousyoHst.Split (delimiterChars)); } else { zukanHeihousyoHstList.Add (zukanHeihousyoHst); } } //Sort Master by daimyo heihousyoMst.param.Sort((x, y) => { return x.kahouRank.CompareTo(y.kahouRank); }); //Show Kahou string noHeihousyoPath = "Prefabs/Item/Sprite/NoHeihousyo"; for (int i=0; i<heihousyoMst.param.Count; i++) { int kahouId = heihousyoMst.param[i].id; string kahouPath = "Prefabs/Item/Kahou/heihousyo" + kahouId; GameObject kahouIcon = Instantiate (Resources.Load (kahouPath)) as GameObject; kahouIcon.transform.SetParent(Content.transform); kahouIcon.transform.localScale = new Vector2 (1, 1); if(!zukanHeihousyoHstList.Contains(kahouId.ToString())){ //Don't have kahouIcon.GetComponent<Image> ().sprite = Resources.Load (noHeihousyoPath, typeof(Sprite)) as Sprite; kahouIcon.GetComponent<Button>().enabled = false; }else{ NowQty = NowQty + 1; kahouIcon.GetComponent<KahouInfo>().kahouType = "heihousyo"; kahouIcon.GetComponent<KahouInfo>().kahouId = kahouId; } } //Qty int AllQty = buguMst.param.Count + gusokuMst.param.Count + kabutoMst.param.Count + meibaMst.param.Count + cyadouguMst.param.Count + chishikisyoMst.param.Count + heihousyoMst.param.Count; GameObject.Find ("NowQty").GetComponent<Text> ().text = NowQty.ToString(); GameObject.Find ("AllQty").GetComponent<Text> ().text = AllQty.ToString(); }
public int getRamdomKahouId(string kahouType, string kahouRank) { //kahouType bugu,kabuto,gusoku,meiba,cyadougu,heihousyo,chishikisyo //kahouRank S,A,B,C int kahouId = 0; if (kahouType == "bugu") { Entity_kahou_bugu_mst Mst = Resources.Load("Data/kahou_bugu_mst") as Entity_kahou_bugu_mst; List <int> kahouList = new List <int> (); if (kahouRank == "S") { //S for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == "A") { //A for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == "B") { //B for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "B") { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == "C") { //C for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } if (kahouList.Count != 0) { int rdmId = UnityEngine.Random.Range(0, kahouList.Count); kahouId = kahouList[rdmId]; } } else if (kahouType == "kabuto") { Entity_kahou_kabuto_mst Mst = Resources.Load("Data/kahou_kabuto_mst") as Entity_kahou_kabuto_mst; List <int> kahouList = new List <int> (); if (kahouRank == "S") { //S for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == "A") { //A for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == "B") { //B for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == "C") { //C for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } if (kahouList.Count != 0) { int rdmId = UnityEngine.Random.Range(0, kahouList.Count); kahouId = kahouList[rdmId]; } } else if (kahouType == "gusoku") { Entity_kahou_gusoku_mst Mst = Resources.Load("Data/kahou_gusoku_mst") as Entity_kahou_gusoku_mst; List <int> kahouList = new List <int> (); if (kahouRank == "S") { //S for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == "A") { //A for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == "B") { //B for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == "C") { //C for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } if (kahouList.Count != 0) { int rdmId = UnityEngine.Random.Range(0, kahouList.Count); kahouId = kahouList[rdmId]; } } else if (kahouType == "meiba") { Entity_kahou_meiba_mst Mst = Resources.Load("Data/kahou_meiba_mst") as Entity_kahou_meiba_mst; List <int> kahouList = new List <int> (); if (kahouRank == "S") { //S for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == "A") { //A for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == "B") { //B for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == "C") { //C for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } if (kahouList.Count != 0) { int rdmId = UnityEngine.Random.Range(0, kahouList.Count); kahouId = kahouList[rdmId]; } } else if (kahouType == "cyadougu") { Entity_kahou_cyadougu_mst Mst = Resources.Load("Data/kahou_cyadougu_mst") as Entity_kahou_cyadougu_mst; List <int> kahouList = new List <int> (); if (kahouRank == "S") { //S for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == "A") { //A for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == "B") { //B for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == "C") { //C for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } if (kahouList.Count != 0) { int rdmId = UnityEngine.Random.Range(0, kahouList.Count); kahouId = kahouList[rdmId]; } } else if (kahouType == "heihousyo") { Entity_kahou_heihousyo_mst Mst = Resources.Load("Data/kahou_heihousyo_mst") as Entity_kahou_heihousyo_mst; List <int> kahouList = new List <int> (); if (kahouRank == "S") { //S for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == "A") { //A for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == "B") { //B for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == "C") { //C for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } if (kahouList.Count != 0) { int rdmId = UnityEngine.Random.Range(0, kahouList.Count); kahouId = kahouList[rdmId]; } } else if (kahouType == "chishikisyo") { Entity_kahou_chishikisyo_mst Mst = Resources.Load("Data/kahou_chishikisyo_mst") as Entity_kahou_chishikisyo_mst; List <int> kahouList = new List <int> (); if (kahouRank == "S") { //S for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == "A") { //A for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == "B") { //B for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == "C") { //C for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == kahouRank) { kahouList.Add(Mst.param[i].id); } } } if (kahouList.Count != 0) { int rdmId = UnityEngine.Random.Range(0, kahouList.Count); kahouId = kahouList[rdmId]; } } return(kahouId); }
public string getRamdomKahou(int kahouType, int kahouRank) { //kahouType Bugu,Kabuto,Gusoku,Meiba,Cyadougu,Heihousyo,Chishikisyo=1,2,3,4,5,6,7 //kahouRank S,A,B,C=1,2,3,4 int kahouId = 0; string kahouName = ""; if (kahouType == 1) { Entity_kahou_bugu_mst Mst = Resources.Load("Data/kahou_bugu_mst") as Entity_kahou_bugu_mst; List <int> kahouList = new List <int> (); if (kahouRank == 1) { //S for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "S") { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == 2) { //A for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "A") { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == 3) { //B for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "B") { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == 4) { //C for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "C") { kahouList.Add(Mst.param[i].id); } } } if (kahouList.Count != 0) { int rdmId = UnityEngine.Random.Range(0, kahouList.Count); kahouId = kahouList[rdmId]; registerBugu(kahouId); if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = Mst.param[kahouId - 1].kahouNameEng; } else { kahouName = Mst.param[kahouId - 1].kahouName; } } } else if (kahouType == 2) { Entity_kahou_kabuto_mst Mst = Resources.Load("Data/kahou_kabuto_mst") as Entity_kahou_kabuto_mst; List <int> kahouList = new List <int> (); if (kahouRank == 1) { //S for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "S") { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == 2) { //A for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "A") { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == 3) { //B for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "B") { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == 4) { //C for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "C") { kahouList.Add(Mst.param[i].id); } } } if (kahouList.Count != 0) { int rdmId = UnityEngine.Random.Range(0, kahouList.Count); kahouId = kahouList[rdmId]; registerKabuto(kahouId); if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = Mst.param[kahouId - 1].kahouNameEng; } else { kahouName = Mst.param[kahouId - 1].kahouName; } } } else if (kahouType == 3) { Entity_kahou_gusoku_mst Mst = Resources.Load("Data/kahou_gusoku_mst") as Entity_kahou_gusoku_mst; List <int> kahouList = new List <int> (); if (kahouRank == 1) { //S for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "S") { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == 2) { //A for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "A") { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == 3) { //B for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "B") { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == 4) { //C for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "C") { kahouList.Add(Mst.param[i].id); } } } if (kahouList.Count != 0) { int rdmId = UnityEngine.Random.Range(0, kahouList.Count); kahouId = kahouList[rdmId]; registerGusoku(kahouId); if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = Mst.param[kahouId - 1].kahouNameEng; } else { kahouName = Mst.param[kahouId - 1].kahouName; } } } else if (kahouType == 4) { Entity_kahou_meiba_mst Mst = Resources.Load("Data/kahou_meiba_mst") as Entity_kahou_meiba_mst; List <int> kahouList = new List <int> (); if (kahouRank == 1) { //S for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "S") { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == 2) { //A for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "A") { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == 3) { //B for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "B") { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == 4) { //C for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "C") { kahouList.Add(Mst.param[i].id); } } } if (kahouList.Count != 0) { int rdmId = UnityEngine.Random.Range(0, kahouList.Count); kahouId = kahouList[rdmId]; registerMeiba(kahouId); if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = Mst.param[kahouId - 1].kahouNameEng; } else { kahouName = Mst.param[kahouId - 1].kahouName; } } } else if (kahouType == 5) { Entity_kahou_cyadougu_mst Mst = Resources.Load("Data/kahou_cyadougu_mst") as Entity_kahou_cyadougu_mst; List <int> kahouList = new List <int> (); if (kahouRank == 1) { //S for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "S") { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == 2) { //A for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "A") { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == 3) { //B for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "B") { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == 4) { //C for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "C") { kahouList.Add(Mst.param[i].id); } } } if (kahouList.Count != 0) { int rdmId = UnityEngine.Random.Range(0, kahouList.Count); kahouId = kahouList[rdmId]; registerCyadougu(kahouId); if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = Mst.param[kahouId - 1].kahouNameEng; } else { kahouName = Mst.param[kahouId - 1].kahouName; } } } else if (kahouType == 6) { Entity_kahou_heihousyo_mst Mst = Resources.Load("Data/kahou_heihousyo_mst") as Entity_kahou_heihousyo_mst; List <int> kahouList = new List <int> (); if (kahouRank == 1) { //S for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "S") { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == 2) { //A for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "A") { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == 3) { //B for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "B") { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == 4) { //C for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "C") { kahouList.Add(Mst.param[i].id); } } } if (kahouList.Count != 0) { int rdmId = UnityEngine.Random.Range(0, kahouList.Count); kahouId = kahouList[rdmId]; registerHeihousyo(kahouId); if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = Mst.param[kahouId - 1].kahouNameEng; } else { kahouName = Mst.param[kahouId - 1].kahouName; } } } else if (kahouType == 7) { Entity_kahou_chishikisyo_mst Mst = Resources.Load("Data/kahou_chishikisyo_mst") as Entity_kahou_chishikisyo_mst; List <int> kahouList = new List <int> (); if (kahouRank == 1) { //S for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "S") { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == 2) { //A for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "A") { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == 3) { //B for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "B") { kahouList.Add(Mst.param[i].id); } } } else if (kahouRank == 4) { //C for (int i = 0; i < Mst.param.Count; i++) { string tempKahouRank = Mst.param[i].kahouRank; if (tempKahouRank == "C") { kahouList.Add(Mst.param[i].id); } } } if (kahouList.Count != 0) { int rdmId = UnityEngine.Random.Range(0, kahouList.Count); kahouId = kahouList[rdmId]; registerChishikisyo(kahouId); if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = Mst.param[kahouId - 1].kahouNameEng; } else { kahouName = Mst.param[kahouId - 1].kahouName; } } } return(kahouName); }
public string getKahouName(string kahouType, int kahouId) { string kahouName = ""; if (Application.systemLanguage != SystemLanguage.Japanese) { if (kahouType == "cyadougu") { Entity_kahou_cyadougu_mst Mst = Resources.Load("Data/kahou_cyadougu_mst") as Entity_kahou_cyadougu_mst; kahouName = Mst.param[kahouId - 1].kahouNameEng; } else if (kahouType == "heihousyo") { Entity_kahou_heihousyo_mst Mst = Resources.Load("Data/kahou_heihousyo_mst") as Entity_kahou_heihousyo_mst; kahouName = Mst.param[kahouId - 1].kahouNameEng; } else if (kahouType == "chishikisyo") { Entity_kahou_chishikisyo_mst Mst = Resources.Load("Data/kahou_chishikisyo_mst") as Entity_kahou_chishikisyo_mst; kahouName = Mst.param[kahouId - 1].kahouNameEng; } else if (kahouType == "bugu") { Entity_kahou_bugu_mst Mst = Resources.Load("Data/kahou_bugu_mst") as Entity_kahou_bugu_mst; kahouName = Mst.param[kahouId - 1].kahouNameEng; } else if (kahouType == "meiba") { Entity_kahou_meiba_mst Mst = Resources.Load("Data/kahou_meiba_mst") as Entity_kahou_meiba_mst; kahouName = Mst.param[kahouId - 1].kahouNameEng; } else if (kahouType == "gusoku") { Entity_kahou_gusoku_mst Mst = Resources.Load("Data/kahou_gusoku_mst") as Entity_kahou_gusoku_mst; kahouName = Mst.param[kahouId - 1].kahouNameEng; } else if (kahouType == "kabuto") { Entity_kahou_kabuto_mst Mst = Resources.Load("Data/kahou_kabuto_mst") as Entity_kahou_kabuto_mst; kahouName = Mst.param[kahouId - 1].kahouNameEng; } } else { if (kahouType == "cyadougu") { Entity_kahou_cyadougu_mst Mst = Resources.Load("Data/kahou_cyadougu_mst") as Entity_kahou_cyadougu_mst; kahouName = Mst.param[kahouId - 1].kahouName; } else if (kahouType == "heihousyo") { Entity_kahou_heihousyo_mst Mst = Resources.Load("Data/kahou_heihousyo_mst") as Entity_kahou_heihousyo_mst; kahouName = Mst.param[kahouId - 1].kahouName; } else if (kahouType == "chishikisyo") { Entity_kahou_chishikisyo_mst Mst = Resources.Load("Data/kahou_chishikisyo_mst") as Entity_kahou_chishikisyo_mst; kahouName = Mst.param[kahouId - 1].kahouName; } else if (kahouType == "bugu") { Entity_kahou_bugu_mst Mst = Resources.Load("Data/kahou_bugu_mst") as Entity_kahou_bugu_mst; kahouName = Mst.param[kahouId - 1].kahouName; } else if (kahouType == "meiba") { Entity_kahou_meiba_mst Mst = Resources.Load("Data/kahou_meiba_mst") as Entity_kahou_meiba_mst; kahouName = Mst.param[kahouId - 1].kahouName; } else if (kahouType == "gusoku") { Entity_kahou_gusoku_mst Mst = Resources.Load("Data/kahou_gusoku_mst") as Entity_kahou_gusoku_mst; kahouName = Mst.param[kahouId - 1].kahouName; } else if (kahouType == "kabuto") { Entity_kahou_kabuto_mst Mst = Resources.Load("Data/kahou_kabuto_mst") as Entity_kahou_kabuto_mst; kahouName = Mst.param[kahouId - 1].kahouName; } } return(kahouName); }
public void createScroll(string target, string availableKahou) { /*Common*/ //Set Scroll View string kahouScrollPath = "Prefabs/Busyo/KahouScrollView"; GameObject kahouScroll = Instantiate(Resources.Load(kahouScrollPath)) as GameObject; kahouScroll.transform.SetParent(GameObject.Find("board(Clone)").transform); kahouScroll.transform.localScale = new Vector2(1, 1); kahouScroll.name = "KahouScrollView"; RectTransform kahouScrollTransform = kahouScroll.GetComponent <RectTransform> (); kahouScrollTransform.anchoredPosition3D = new Vector3(0, 0, 0); //Text Modification string targetText = returnKahouName(target); if (Application.systemLanguage != SystemLanguage.Japanese) { GameObject.Find("ScrollText").GetComponent <Text> ().text = targetText + " List"; } else { GameObject.Find("ScrollText").GetComponent <Text>().text = targetText + "一覧"; } if (0 <= availableKahou.IndexOf(",")) { //more than 2 char[] delimiterChars = { ',' }; string[] available_list = availableKahou.Split(delimiterChars); for (int i = 0; i < available_list.Length; i++) { int kahouId = int.Parse(available_list[i]); string kahouTypId = target + kahouId.ToString(); string kahouPath = "Prefabs/Busyo/KahouSlot"; GameObject kahouSlot = Instantiate(Resources.Load(kahouPath)) as GameObject; kahouSlot.transform.SetParent(GameObject.Find("KahouContent").transform); kahouSlot.transform.localScale = new Vector2(1, 1); if (target == "Bugu") { Entity_kahou_bugu_mst buguKahouMst = Resources.Load("Data/kahou_bugu_mst") as Entity_kahou_bugu_mst; string kahouName = ""; string kahouTarget = ""; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = buguKahouMst.param [kahouId - 1].kahouNameEng; kahouTarget = buguKahouMst.param [kahouId - 1].kahouTargetEng; } else { kahouName = buguKahouMst.param[kahouId - 1].kahouName; kahouTarget = buguKahouMst.param[kahouId - 1].kahouTarget; } int kahouEffect = buguKahouMst.param [kahouId - 1].kahouEffect; string kahouUnit = buguKahouMst.param [kahouId - 1].unit; kahouSlot.transform.FindChild("KahouName").GetComponent <Text>().text = kahouName; kahouSlot.transform.FindChild("KahouName/KahouEffectLabel").GetComponent <Text>().text = kahouTarget; kahouSlot.transform.FindChild("KahouName/KahouEffectValue").GetComponent <Text>().text = "+" + kahouEffect.ToString() + kahouUnit; viewKahouIcon(kahouSlot, kahouTypId); setKahouInfo(kahouSlot, target, kahouId); } else if (target == "Kabuto") { Entity_kahou_kabuto_mst kabutoKahouMst = Resources.Load("Data/kahou_kabuto_mst") as Entity_kahou_kabuto_mst; string kahouName = ""; string kahouTarget = ""; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = kabutoKahouMst.param[kahouId - 1].kahouNameEng; kahouTarget = kabutoKahouMst.param[kahouId - 1].kahouTargetEng; } else { kahouName = kabutoKahouMst.param[kahouId - 1].kahouName; kahouTarget = kabutoKahouMst.param[kahouId - 1].kahouTarget; } int kahouEffect = kabutoKahouMst.param [kahouId - 1].kahouEffect; string kahouUnit = kabutoKahouMst.param [kahouId - 1].unit; kahouSlot.transform.FindChild("KahouName").GetComponent <Text>().text = kahouName; kahouSlot.transform.FindChild("KahouName/KahouEffectLabel").GetComponent <Text>().text = kahouTarget; kahouSlot.transform.FindChild("KahouName/KahouEffectValue").GetComponent <Text>().text = "+" + kahouEffect.ToString() + kahouUnit; viewKahouIcon(kahouSlot, kahouTypId); setKahouInfo(kahouSlot, target, kahouId); } else if (target == "Gusoku") { Entity_kahou_gusoku_mst gusokuKahouMst = Resources.Load("Data/kahou_gusoku_mst") as Entity_kahou_gusoku_mst; string kahouName = ""; string kahouTarget = ""; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = gusokuKahouMst.param[kahouId - 1].kahouNameEng; kahouTarget = gusokuKahouMst.param[kahouId - 1].kahouTargetEng; } else { kahouName = gusokuKahouMst.param[kahouId - 1].kahouName; kahouTarget = gusokuKahouMst.param[kahouId - 1].kahouTarget; } int kahouEffect = gusokuKahouMst.param [kahouId - 1].kahouEffect; string kahouUnit = gusokuKahouMst.param [kahouId - 1].unit; kahouSlot.transform.FindChild("KahouName").GetComponent <Text>().text = kahouName; kahouSlot.transform.FindChild("KahouName/KahouEffectLabel").GetComponent <Text>().text = kahouTarget; kahouSlot.transform.FindChild("KahouName/KahouEffectValue").GetComponent <Text>().text = "+" + kahouEffect.ToString() + kahouUnit; viewKahouIcon(kahouSlot, kahouTypId); setKahouInfo(kahouSlot, target, kahouId); } else if (target == "Meiba") { Entity_kahou_meiba_mst meibaKahouMst = Resources.Load("Data/kahou_meiba_mst") as Entity_kahou_meiba_mst; string kahouName = ""; string kahouTarget = ""; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = meibaKahouMst.param[kahouId - 1].kahouNameEng; kahouTarget = meibaKahouMst.param[kahouId - 1].kahouTargetEng; } else { kahouName = meibaKahouMst.param[kahouId - 1].kahouName; kahouTarget = meibaKahouMst.param[kahouId - 1].kahouTarget; } int kahouEffect = meibaKahouMst.param [kahouId - 1].kahouEffect; string kahouUnit = meibaKahouMst.param [kahouId - 1].unit; kahouSlot.transform.FindChild("KahouName").GetComponent <Text>().text = kahouName; kahouSlot.transform.FindChild("KahouName/KahouEffectLabel").GetComponent <Text>().text = kahouTarget; kahouSlot.transform.FindChild("KahouName/KahouEffectValue").GetComponent <Text>().text = "+" + kahouEffect.ToString() + kahouUnit; viewKahouIcon(kahouSlot, kahouTypId); setKahouInfo(kahouSlot, target, kahouId); } else if (target == "Cyadougu") { Entity_kahou_cyadougu_mst cyadouguKahouMst = Resources.Load("Data/kahou_cyadougu_mst") as Entity_kahou_cyadougu_mst; string kahouName = ""; string kahouTarget = ""; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = cyadouguKahouMst.param[kahouId - 1].kahouNameEng; kahouTarget = cyadouguKahouMst.param[kahouId - 1].kahouTargetEng; } else { kahouName = cyadouguKahouMst.param[kahouId - 1].kahouName; kahouTarget = cyadouguKahouMst.param[kahouId - 1].kahouTarget; } int kahouEffect = cyadouguKahouMst.param [kahouId - 1].kahouEffect; string kahouUnit = cyadouguKahouMst.param [kahouId - 1].unit; kahouSlot.transform.FindChild("KahouName").GetComponent <Text>().text = kahouName; kahouSlot.transform.FindChild("KahouName/KahouEffectLabel").GetComponent <Text>().text = kahouTarget; kahouSlot.transform.FindChild("KahouName/KahouEffectValue").GetComponent <Text>().text = "+" + kahouEffect.ToString() + kahouUnit; viewKahouIcon(kahouSlot, kahouTypId); setKahouInfo(kahouSlot, target, kahouId); } else if (target == "Heihousyo") { Entity_kahou_heihousyo_mst heihousyoKahouMst = Resources.Load("Data/kahou_heihousyo_mst") as Entity_kahou_heihousyo_mst; string kahouName = ""; string kahouTarget = ""; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = heihousyoKahouMst.param[kahouId - 1].kahouNameEng; kahouTarget = heihousyoKahouMst.param[kahouId - 1].kahouTargetEng; } else { kahouName = heihousyoKahouMst.param[kahouId - 1].kahouName; kahouTarget = heihousyoKahouMst.param[kahouId - 1].kahouTarget; } int kahouEffect = heihousyoKahouMst.param [kahouId - 1].kahouEffect; string kahouUnit = heihousyoKahouMst.param [kahouId - 1].unit; kahouSlot.transform.FindChild("KahouName").GetComponent <Text>().text = kahouName; kahouSlot.transform.FindChild("KahouName/KahouEffectLabel").GetComponent <Text>().text = kahouTarget; kahouSlot.transform.FindChild("KahouName/KahouEffectValue").GetComponent <Text>().text = "+" + kahouEffect.ToString() + kahouUnit; viewKahouIcon(kahouSlot, kahouTypId); setKahouInfo(kahouSlot, target, kahouId); } else if (target == "Chishikisyo") { Entity_kahou_chishikisyo_mst chishikisyoKahouMst = Resources.Load("Data/kahou_chishikisyo_mst") as Entity_kahou_chishikisyo_mst; string kahouName = ""; string kahouTarget = ""; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = chishikisyoKahouMst.param[kahouId - 1].kahouNameEng; kahouTarget = chishikisyoKahouMst.param[kahouId - 1].kahouTargetEng; } else { kahouName = chishikisyoKahouMst.param[kahouId - 1].kahouName; kahouTarget = chishikisyoKahouMst.param[kahouId - 1].kahouTarget; } int kahouEffect = chishikisyoKahouMst.param [kahouId - 1].kahouEffect; string kahouUnit = chishikisyoKahouMst.param [kahouId - 1].unit; kahouSlot.transform.FindChild("KahouName").GetComponent <Text>().text = kahouName; kahouSlot.transform.FindChild("KahouName/KahouEffectLabel").GetComponent <Text>().text = kahouTarget; kahouSlot.transform.FindChild("KahouName/KahouEffectValue").GetComponent <Text>().text = "+" + kahouEffect.ToString() + kahouUnit; viewKahouIcon(kahouSlot, kahouTypId); setKahouInfo(kahouSlot, target, kahouId); } } } else { //only 1 string kahouTypId = target + availableKahou; string kahouPath = "Prefabs/Busyo/KahouSlot"; GameObject kahouSlot = Instantiate(Resources.Load(kahouPath)) as GameObject; kahouSlot.transform.SetParent(GameObject.Find("KahouContent").transform); kahouSlot.transform.localScale = new Vector2(1, 1); if (target == "Bugu") { Entity_kahou_bugu_mst buguKahouMst = Resources.Load("Data/kahou_bugu_mst") as Entity_kahou_bugu_mst; string kahouName = ""; string kahouTarget = ""; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = buguKahouMst.param [int.Parse(availableKahou) - 1].kahouNameEng; kahouTarget = buguKahouMst.param [int.Parse(availableKahou) - 1].kahouTargetEng; } else { kahouName = buguKahouMst.param[int.Parse(availableKahou) - 1].kahouName; kahouTarget = buguKahouMst.param[int.Parse(availableKahou) - 1].kahouTarget; } int kahouEffect = buguKahouMst.param [int.Parse(availableKahou) - 1].kahouEffect; string kahouUnit = buguKahouMst.param [int.Parse(availableKahou) - 1].unit; kahouSlot.transform.FindChild("KahouName").GetComponent <Text>().text = kahouName; kahouSlot.transform.FindChild("KahouName/KahouEffectLabel").GetComponent <Text>().text = kahouTarget; kahouSlot.transform.FindChild("KahouName/KahouEffectValue").GetComponent <Text>().text = "+" + kahouEffect.ToString() + kahouUnit; viewKahouIcon(kahouSlot, kahouTypId); setKahouInfo(kahouSlot, target, int.Parse(availableKahou)); } else if (target == "Kabuto") { Entity_kahou_kabuto_mst kabutoKahouMst = Resources.Load("Data/kahou_kabuto_mst") as Entity_kahou_kabuto_mst; string kahouName = ""; string kahouTarget = ""; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = kabutoKahouMst.param[int.Parse(availableKahou) - 1].kahouNameEng; kahouTarget = kabutoKahouMst.param[int.Parse(availableKahou) - 1].kahouTargetEng; } else { kahouName = kabutoKahouMst.param[int.Parse(availableKahou) - 1].kahouName; kahouTarget = kabutoKahouMst.param[int.Parse(availableKahou) - 1].kahouTarget; } int kahouEffect = kabutoKahouMst.param [int.Parse(availableKahou) - 1].kahouEffect; string kahouUnit = kabutoKahouMst.param [int.Parse(availableKahou) - 1].unit; kahouSlot.transform.FindChild("KahouName").GetComponent <Text>().text = kahouName; kahouSlot.transform.FindChild("KahouName/KahouEffectLabel").GetComponent <Text>().text = kahouTarget; kahouSlot.transform.FindChild("KahouName/KahouEffectValue").GetComponent <Text>().text = "+" + kahouEffect.ToString() + kahouUnit; viewKahouIcon(kahouSlot, kahouTypId); setKahouInfo(kahouSlot, target, int.Parse(availableKahou)); } else if (target == "Gusoku") { Entity_kahou_gusoku_mst gusokuKahouMst = Resources.Load("Data/kahou_gusoku_mst") as Entity_kahou_gusoku_mst; string kahouName = ""; string kahouTarget = ""; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = gusokuKahouMst.param[int.Parse(availableKahou) - 1].kahouNameEng; kahouTarget = gusokuKahouMst.param[int.Parse(availableKahou) - 1].kahouTargetEng; } else { kahouName = gusokuKahouMst.param[int.Parse(availableKahou) - 1].kahouName; kahouTarget = gusokuKahouMst.param[int.Parse(availableKahou) - 1].kahouTarget; } int kahouEffect = gusokuKahouMst.param [int.Parse(availableKahou) - 1].kahouEffect; string kahouUnit = gusokuKahouMst.param [int.Parse(availableKahou) - 1].unit; kahouSlot.transform.FindChild("KahouName").GetComponent <Text>().text = kahouName; kahouSlot.transform.FindChild("KahouName/KahouEffectLabel").GetComponent <Text>().text = kahouTarget; kahouSlot.transform.FindChild("KahouName/KahouEffectValue").GetComponent <Text>().text = "+" + kahouEffect.ToString() + kahouUnit; viewKahouIcon(kahouSlot, kahouTypId); setKahouInfo(kahouSlot, target, int.Parse(availableKahou)); } else if (target == "Meiba") { Entity_kahou_meiba_mst meibaKahouMst = Resources.Load("Data/kahou_meiba_mst") as Entity_kahou_meiba_mst; string kahouName = ""; string kahouTarget = ""; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = meibaKahouMst.param[int.Parse(availableKahou) - 1].kahouNameEng; kahouTarget = meibaKahouMst.param[int.Parse(availableKahou) - 1].kahouTargetEng; } else { kahouName = meibaKahouMst.param[int.Parse(availableKahou) - 1].kahouName; kahouTarget = meibaKahouMst.param[int.Parse(availableKahou) - 1].kahouTarget; } int kahouEffect = meibaKahouMst.param [int.Parse(availableKahou) - 1].kahouEffect; string kahouUnit = meibaKahouMst.param [int.Parse(availableKahou) - 1].unit; kahouSlot.transform.FindChild("KahouName").GetComponent <Text>().text = kahouName; kahouSlot.transform.FindChild("KahouName/KahouEffectLabel").GetComponent <Text>().text = kahouTarget; kahouSlot.transform.FindChild("KahouName/KahouEffectValue").GetComponent <Text>().text = "+" + kahouEffect.ToString() + kahouUnit; viewKahouIcon(kahouSlot, kahouTypId); setKahouInfo(kahouSlot, target, int.Parse(availableKahou)); } else if (target == "Cyadougu") { Entity_kahou_cyadougu_mst cyadouguKahouMst = Resources.Load("Data/kahou_cyadougu_mst") as Entity_kahou_cyadougu_mst; string kahouName = ""; string kahouTarget = ""; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = cyadouguKahouMst.param[int.Parse(availableKahou) - 1].kahouNameEng; kahouTarget = cyadouguKahouMst.param[int.Parse(availableKahou) - 1].kahouTargetEng; } else { kahouName = cyadouguKahouMst.param[int.Parse(availableKahou) - 1].kahouName; kahouTarget = cyadouguKahouMst.param[int.Parse(availableKahou) - 1].kahouTarget; } int kahouEffect = cyadouguKahouMst.param [int.Parse(availableKahou) - 1].kahouEffect; string kahouUnit = cyadouguKahouMst.param [int.Parse(availableKahou) - 1].unit; kahouSlot.transform.FindChild("KahouName").GetComponent <Text>().text = kahouName; kahouSlot.transform.FindChild("KahouName/KahouEffectLabel").GetComponent <Text>().text = kahouTarget; kahouSlot.transform.FindChild("KahouName/KahouEffectValue").GetComponent <Text>().text = "+" + kahouEffect.ToString() + kahouUnit; viewKahouIcon(kahouSlot, kahouTypId); setKahouInfo(kahouSlot, target, int.Parse(availableKahou)); } else if (target == "Heihousyo") { Entity_kahou_heihousyo_mst heihousyoKahouMst = Resources.Load("Data/kahou_heihousyo_mst") as Entity_kahou_heihousyo_mst; string kahouName = ""; string kahouTarget = ""; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = heihousyoKahouMst.param[int.Parse(availableKahou) - 1].kahouNameEng; kahouTarget = heihousyoKahouMst.param[int.Parse(availableKahou) - 1].kahouTargetEng; } else { kahouName = heihousyoKahouMst.param[int.Parse(availableKahou) - 1].kahouName; kahouTarget = heihousyoKahouMst.param[int.Parse(availableKahou) - 1].kahouTarget; } int kahouEffect = heihousyoKahouMst.param [int.Parse(availableKahou) - 1].kahouEffect; string kahouUnit = heihousyoKahouMst.param [int.Parse(availableKahou) - 1].unit; kahouSlot.transform.FindChild("KahouName").GetComponent <Text>().text = kahouName; kahouSlot.transform.FindChild("KahouName/KahouEffectLabel").GetComponent <Text>().text = kahouTarget; kahouSlot.transform.FindChild("KahouName/KahouEffectValue").GetComponent <Text>().text = "+" + kahouEffect.ToString() + kahouUnit; viewKahouIcon(kahouSlot, kahouTypId); setKahouInfo(kahouSlot, target, int.Parse(availableKahou)); } else if (target == "Chishikisyo") { Entity_kahou_chishikisyo_mst chishikisyoKahouMst = Resources.Load("Data/kahou_chishikisyo_mst") as Entity_kahou_chishikisyo_mst; string kahouName = ""; string kahouTarget = ""; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = chishikisyoKahouMst.param[int.Parse(availableKahou) - 1].kahouNameEng; kahouTarget = chishikisyoKahouMst.param[int.Parse(availableKahou) - 1].kahouTargetEng; } else { kahouName = chishikisyoKahouMst.param[int.Parse(availableKahou) - 1].kahouName; kahouTarget = chishikisyoKahouMst.param[int.Parse(availableKahou) - 1].kahouTarget; } int kahouEffect = chishikisyoKahouMst.param [int.Parse(availableKahou) - 1].kahouEffect; string kahouUnit = chishikisyoKahouMst.param [int.Parse(availableKahou) - 1].unit; kahouSlot.transform.FindChild("KahouName").GetComponent <Text>().text = kahouName; kahouSlot.transform.FindChild("KahouName/KahouEffectLabel").GetComponent <Text>().text = kahouTarget; kahouSlot.transform.FindChild("KahouName/KahouEffectValue").GetComponent <Text>().text = "+" + kahouEffect.ToString() + kahouUnit; viewKahouIcon(kahouSlot, kahouTypId); setKahouInfo(kahouSlot, target, int.Parse(availableKahou)); } } }
public void showKahouZukan(GameObject Content) { int NowQty = 0; Entity_kahou_bugu_mst tmpbuguMst = Resources.Load("Data/kahou_bugu_mst") as Entity_kahou_bugu_mst; Entity_kahou_gusoku_mst tmpgusokuMst = Resources.Load("Data/kahou_gusoku_mst") as Entity_kahou_gusoku_mst; Entity_kahou_kabuto_mst tmpkabutoMst = Resources.Load("Data/kahou_kabuto_mst") as Entity_kahou_kabuto_mst; Entity_kahou_meiba_mst tmpmeibaMst = Resources.Load("Data/kahou_meiba_mst") as Entity_kahou_meiba_mst; Entity_kahou_cyadougu_mst tmpcyadouguMst = Resources.Load("Data/kahou_cyadougu_mst") as Entity_kahou_cyadougu_mst; Entity_kahou_chishikisyo_mst tmpchishikisyoMst = Resources.Load("Data/kahou_chishikisyo_mst") as Entity_kahou_chishikisyo_mst; Entity_kahou_heihousyo_mst tmpheihousyoMst = Resources.Load("Data/kahou_heihousyo_mst") as Entity_kahou_heihousyo_mst; Entity_kahou_bugu_mst buguMst = new Entity_kahou_bugu_mst(); Entity_kahou_gusoku_mst gusokuMst = new Entity_kahou_gusoku_mst(); Entity_kahou_kabuto_mst kabutoMst = new Entity_kahou_kabuto_mst(); Entity_kahou_meiba_mst meibaMst = new Entity_kahou_meiba_mst(); Entity_kahou_cyadougu_mst cyadouguMst = new Entity_kahou_cyadougu_mst(); Entity_kahou_chishikisyo_mst chishikisyoMst = new Entity_kahou_chishikisyo_mst(); Entity_kahou_heihousyo_mst heihousyoMst = new Entity_kahou_heihousyo_mst(); buguMst.param.AddRange(tmpbuguMst.param); gusokuMst.param.AddRange(tmpgusokuMst.param); kabutoMst.param.AddRange(tmpkabutoMst.param); meibaMst.param.AddRange(tmpmeibaMst.param); cyadouguMst.param.AddRange(tmpcyadouguMst.param); chishikisyoMst.param.AddRange(tmpchishikisyoMst.param); heihousyoMst.param.AddRange(tmpheihousyoMst.param); //Bugu //Prepare Master & History string zukanBuguHst = PlayerPrefs.GetString("zukanBuguHst"); List <string> zukanBuguHstList = new List <string> (); char[] delimiterChars = { ',' }; if (zukanBuguHst != "" && zukanBuguHst != null) { if (zukanBuguHst.Contains(",")) { zukanBuguHstList = new List <string> (zukanBuguHst.Split(delimiterChars)); } else { zukanBuguHstList.Add(zukanBuguHst); } } //Sort Master by daimyo buguMst.param.Sort((x, y) => { return(x.kahouRank.CompareTo(y.kahouRank)); }); //Show Kahou string noBuguPath = "Prefabs/Item/Sprite/NoBugu"; for (int i = 0; i < buguMst.param.Count; i++) { int kahouId = buguMst.param[i].id; //Get Status string kahouPath = "Prefabs/Item/Kahou/bugu" + kahouId; GameObject kahouIcon = Instantiate(Resources.Load(kahouPath)) as GameObject; kahouIcon.transform.SetParent(Content.transform); kahouIcon.transform.localScale = new Vector2(1, 1); kahouIcon.transform.localPosition = new Vector3(0, 0, 0); if (!zukanBuguHstList.Contains(kahouId.ToString())) { //Don't have kahouIcon.GetComponent <Image> ().sprite = Resources.Load(noBuguPath, typeof(Sprite)) as Sprite; kahouIcon.GetComponent <Button>().enabled = false; } else { NowQty = NowQty + 1; kahouIcon.GetComponent <KahouInfo>().kahouType = "bugu"; kahouIcon.GetComponent <KahouInfo>().kahouId = kahouId; } } //Gusoku //Prepare Master & History string zukanGusokuHst = PlayerPrefs.GetString("zukanGusokuHst"); List <string> zukanGusokuHstList = new List <string> (); if (zukanGusokuHst != "" && zukanGusokuHst != null) { if (zukanGusokuHst.Contains(",")) { zukanGusokuHstList = new List <string> (zukanGusokuHst.Split(delimiterChars)); } else { zukanGusokuHstList.Add(zukanGusokuHst); } } //Sort Master by daimyo gusokuMst.param.Sort((a, b) => { return(a.kahouRank.CompareTo(b.kahouRank)); }); //Show Kahou string noGusokuPath = "Prefabs/Item/Sprite/NoGusoku"; for (int i = 0; i < gusokuMst.param.Count; i++) { int kahouId = gusokuMst.param[i].id; string kahouPath = "Prefabs/Item/Kahou/gusoku" + kahouId; GameObject kahouIcon = Instantiate(Resources.Load(kahouPath)) as GameObject; kahouIcon.transform.SetParent(Content.transform); kahouIcon.transform.localScale = new Vector2(1, 1); kahouIcon.transform.localPosition = new Vector3(0, 0, 0); if (!zukanGusokuHstList.Contains(kahouId.ToString())) { //Don't have kahouIcon.GetComponent <Image> ().sprite = Resources.Load(noGusokuPath, typeof(Sprite)) as Sprite; kahouIcon.GetComponent <Button>().enabled = false; } else { NowQty = NowQty + 1; kahouIcon.GetComponent <KahouInfo>().kahouType = "gusoku"; kahouIcon.GetComponent <KahouInfo>().kahouId = kahouId; } } //Kabuto //Prepare Master & History string zukanKabutoHst = PlayerPrefs.GetString("zukanKabutoHst"); List <string> zukanKabutoHstList = new List <string> (); if (zukanKabutoHst != "" && zukanKabutoHst != null) { if (zukanKabutoHst.Contains(",")) { zukanKabutoHstList = new List <string> (zukanKabutoHst.Split(delimiterChars)); } else { zukanKabutoHstList.Add(zukanKabutoHst); } } //Sort Master by daimyo kabutoMst.param.Sort((x, y) => { return(x.kahouRank.CompareTo(y.kahouRank)); }); //Show Kahou string noKabutoPath = "Prefabs/Item/Sprite/NoKabuto"; for (int i = 0; i < kabutoMst.param.Count; i++) { int kahouId = kabutoMst.param[i].id; string kahouPath = "Prefabs/Item/Kahou/kabuto" + kahouId; GameObject kahouIcon = Instantiate(Resources.Load(kahouPath)) as GameObject; kahouIcon.transform.SetParent(Content.transform); kahouIcon.transform.localScale = new Vector2(1, 1); kahouIcon.transform.localPosition = new Vector3(0, 0, 0); if (!zukanKabutoHstList.Contains(kahouId.ToString())) { //Don't have kahouIcon.GetComponent <Image> ().sprite = Resources.Load(noKabutoPath, typeof(Sprite)) as Sprite; kahouIcon.GetComponent <Button>().enabled = false; } else { NowQty = NowQty + 1; kahouIcon.GetComponent <KahouInfo>().kahouType = "kabuto"; kahouIcon.GetComponent <KahouInfo>().kahouId = kahouId; } } // Meiba //Prepare Master & History string zukanMeibaHst = PlayerPrefs.GetString("zukanMeibaHst"); List <string> zukanMeibaHstList = new List <string> (); if (zukanMeibaHst != "" && zukanMeibaHst != null) { if (zukanMeibaHst.Contains(",")) { zukanMeibaHstList = new List <string> (zukanMeibaHst.Split(delimiterChars)); } else { zukanMeibaHstList.Add(zukanMeibaHst); } } //Sort Master by daimyo meibaMst.param.Sort((x, y) => { return(x.kahouRank.CompareTo(y.kahouRank)); }); //Show Kahou string noMeibaPath = "Prefabs/Item/Sprite/NoMeiba"; for (int i = 0; i < meibaMst.param.Count; i++) { int kahouId = meibaMst.param[i].id; string kahouPath = "Prefabs/Item/Kahou/meiba" + kahouId; GameObject kahouIcon = Instantiate(Resources.Load(kahouPath)) as GameObject; kahouIcon.transform.SetParent(Content.transform); kahouIcon.transform.localScale = new Vector2(1, 1); kahouIcon.transform.localPosition = new Vector3(0, 0, 0); if (!zukanMeibaHstList.Contains(kahouId.ToString())) { //Don't have kahouIcon.GetComponent <Image> ().sprite = Resources.Load(noMeibaPath, typeof(Sprite)) as Sprite; kahouIcon.GetComponent <Button>().enabled = false; } else { NowQty = NowQty + 1; kahouIcon.GetComponent <KahouInfo>().kahouType = "meiba"; kahouIcon.GetComponent <KahouInfo>().kahouId = kahouId; } } //Cyadougu //Prepare Master & History string zukanCyadouguHst = PlayerPrefs.GetString("zukanCyadouguHst"); List <string> zukanCyadouguHstList = new List <string> (); if (zukanCyadouguHst != "" && zukanCyadouguHst != null) { if (zukanCyadouguHst.Contains(",")) { zukanCyadouguHstList = new List <string> (zukanCyadouguHst.Split(delimiterChars)); } else { zukanCyadouguHstList.Add(zukanCyadouguHst); } } //Sort Master by daimyo cyadouguMst.param.Sort((x, y) => { return(x.kahouRank.CompareTo(y.kahouRank)); }); //Show Kahou string noCyadouguPath = "Prefabs/Item/Sprite/NoCyadougu"; for (int i = 0; i < cyadouguMst.param.Count; i++) { int kahouId = cyadouguMst.param[i].id; string kahouPath = "Prefabs/Item/Kahou/cyadougu" + kahouId; GameObject kahouIcon = Instantiate(Resources.Load(kahouPath)) as GameObject; kahouIcon.transform.SetParent(Content.transform); kahouIcon.transform.localScale = new Vector2(1, 1); kahouIcon.transform.localPosition = new Vector3(0, 0, 0); if (!zukanCyadouguHstList.Contains(kahouId.ToString())) { //Don't have kahouIcon.GetComponent <Image> ().sprite = Resources.Load(noCyadouguPath, typeof(Sprite)) as Sprite; kahouIcon.GetComponent <Button>().enabled = false; } else { NowQty = NowQty + 1; kahouIcon.GetComponent <KahouInfo>().kahouType = "cyadougu"; kahouIcon.GetComponent <KahouInfo>().kahouId = kahouId; } } // Chishikisyo //Prepare Master & History string zukanChishikisyoHst = PlayerPrefs.GetString("zukanChishikisyoHst"); List <string> zukanChishikisyoHstList = new List <string> (); if (zukanChishikisyoHst != "" && zukanChishikisyoHst != null) { if (zukanChishikisyoHst.Contains(",")) { zukanChishikisyoHstList = new List <string> (zukanChishikisyoHst.Split(delimiterChars)); } else { zukanChishikisyoHstList.Add(zukanChishikisyoHst); } } //Sort Master by daimyo chishikisyoMst.param.Sort((x, y) => { return(x.kahouRank.CompareTo(y.kahouRank)); }); //Show Kahou string noChishikisyoPath = "Prefabs/Item/Sprite/NoChishikisyo"; for (int i = 0; i < chishikisyoMst.param.Count; i++) { int kahouId = chishikisyoMst.param[i].id; string kahouPath = "Prefabs/Item/Kahou/chishikisyo" + kahouId; GameObject kahouIcon = Instantiate(Resources.Load(kahouPath)) as GameObject; kahouIcon.transform.SetParent(Content.transform); kahouIcon.transform.localScale = new Vector2(1, 1); kahouIcon.transform.localPosition = new Vector3(0, 0, 0); if (!zukanChishikisyoHstList.Contains(kahouId.ToString())) { //Don't have kahouIcon.GetComponent <Image> ().sprite = Resources.Load(noChishikisyoPath, typeof(Sprite)) as Sprite; kahouIcon.GetComponent <Button>().enabled = false; } else { NowQty = NowQty + 1; kahouIcon.GetComponent <KahouInfo>().kahouType = "chishikisyo"; kahouIcon.GetComponent <KahouInfo>().kahouId = kahouId; } } // Heihousyo //Prepare Master & History string zukanHeihousyoHst = PlayerPrefs.GetString("zukanHeihousyoHst"); List <string> zukanHeihousyoHstList = new List <string> (); if (zukanHeihousyoHst != "" && zukanHeihousyoHst != null) { if (zukanHeihousyoHst.Contains(",")) { zukanHeihousyoHstList = new List <string> (zukanHeihousyoHst.Split(delimiterChars)); } else { zukanHeihousyoHstList.Add(zukanHeihousyoHst); } } //Sort Master by daimyo heihousyoMst.param.Sort((x, y) => { return(x.kahouRank.CompareTo(y.kahouRank)); }); //Show Kahou string noHeihousyoPath = "Prefabs/Item/Sprite/NoHeihousyo"; for (int i = 0; i < heihousyoMst.param.Count; i++) { int kahouId = heihousyoMst.param[i].id; string kahouPath = "Prefabs/Item/Kahou/heihousyo" + kahouId; GameObject kahouIcon = Instantiate(Resources.Load(kahouPath)) as GameObject; kahouIcon.transform.SetParent(Content.transform); kahouIcon.transform.localScale = new Vector2(1, 1); kahouIcon.transform.localPosition = new Vector3(0, 0, 0); if (!zukanHeihousyoHstList.Contains(kahouId.ToString())) { //Don't have kahouIcon.GetComponent <Image> ().sprite = Resources.Load(noHeihousyoPath, typeof(Sprite)) as Sprite; kahouIcon.GetComponent <Button>().enabled = false; } else { NowQty = NowQty + 1; kahouIcon.GetComponent <KahouInfo>().kahouType = "heihousyo"; kahouIcon.GetComponent <KahouInfo>().kahouId = kahouId; } } //Qty int AllQty = buguMst.param.Count + gusokuMst.param.Count + kabutoMst.param.Count + meibaMst.param.Count + cyadouguMst.param.Count + chishikisyoMst.param.Count + heihousyoMst.param.Count; float percent = (float)NowQty / (float)AllQty * 100; GameObject.Find("NowQty").GetComponent <Text> ().text = NowQty.ToString(); GameObject.Find("AllQty").GetComponent <Text> ().text = AllQty.ToString() + "(" + percent.ToString("F1") + "%)"; }
public List <string> getKahouInfo(string kahouTyp, int kahouId) { List <string> kahouInfoList = new List <string> (); if (kahouTyp == "bugu") { Entity_kahou_bugu_mst buguKahouMst = Resources.Load("Data/kahou_bugu_mst") as Entity_kahou_bugu_mst; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouInfoList.Add(buguKahouMst.param [kahouId - 1].kahouNameEng); kahouInfoList.Add(buguKahouMst.param[kahouId - 1].kahouExpEng); kahouInfoList.Add(buguKahouMst.param[kahouId - 1].kahouTargetEng); } else { kahouInfoList.Add(buguKahouMst.param[kahouId - 1].kahouName); kahouInfoList.Add(buguKahouMst.param[kahouId - 1].kahouExp); kahouInfoList.Add(buguKahouMst.param[kahouId - 1].kahouTarget); } kahouInfoList.Add(buguKahouMst.param [kahouId - 1].kahouEffect.ToString()); kahouInfoList.Add(buguKahouMst.param [kahouId - 1].unit.ToString()); kahouInfoList.Add(buguKahouMst.param [kahouId - 1].kahouBuy.ToString()); kahouInfoList.Add(buguKahouMst.param [kahouId - 1].kahouSell.ToString()); kahouInfoList.Add(buguKahouMst.param [kahouId - 1].kahouRatio.ToString()); } else if (kahouTyp == "kabuto") { Entity_kahou_kabuto_mst kabutoKahouMst = Resources.Load("Data/kahou_kabuto_mst") as Entity_kahou_kabuto_mst; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouInfoList.Add(kabutoKahouMst.param[kahouId - 1].kahouNameEng); kahouInfoList.Add(kabutoKahouMst.param[kahouId - 1].kahouExpEng); kahouInfoList.Add(kabutoKahouMst.param[kahouId - 1].kahouTargetEng); } else { kahouInfoList.Add(kabutoKahouMst.param[kahouId - 1].kahouName); kahouInfoList.Add(kabutoKahouMst.param[kahouId - 1].kahouExp); kahouInfoList.Add(kabutoKahouMst.param[kahouId - 1].kahouTarget); } kahouInfoList.Add(kabutoKahouMst.param [kahouId - 1].kahouEffect.ToString()); kahouInfoList.Add(kabutoKahouMst.param [kahouId - 1].unit.ToString()); kahouInfoList.Add(kabutoKahouMst.param [kahouId - 1].kahouBuy.ToString()); kahouInfoList.Add(kabutoKahouMst.param [kahouId - 1].kahouSell.ToString()); kahouInfoList.Add(kabutoKahouMst.param [kahouId - 1].kahouRatio.ToString()); } else if (kahouTyp == "gusoku") { Entity_kahou_gusoku_mst gusokuKahouMst = Resources.Load("Data/kahou_gusoku_mst") as Entity_kahou_gusoku_mst; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouInfoList.Add(gusokuKahouMst.param[kahouId - 1].kahouNameEng); kahouInfoList.Add(gusokuKahouMst.param[kahouId - 1].kahouExpEng); kahouInfoList.Add(gusokuKahouMst.param[kahouId - 1].kahouTargetEng); } else { kahouInfoList.Add(gusokuKahouMst.param[kahouId - 1].kahouName); kahouInfoList.Add(gusokuKahouMst.param[kahouId - 1].kahouExp); kahouInfoList.Add(gusokuKahouMst.param[kahouId - 1].kahouTarget); } kahouInfoList.Add(gusokuKahouMst.param [kahouId - 1].kahouEffect.ToString()); kahouInfoList.Add(gusokuKahouMst.param [kahouId - 1].unit.ToString()); kahouInfoList.Add(gusokuKahouMst.param [kahouId - 1].kahouBuy.ToString()); kahouInfoList.Add(gusokuKahouMst.param [kahouId - 1].kahouSell.ToString()); kahouInfoList.Add(gusokuKahouMst.param [kahouId - 1].kahouRatio.ToString()); } else if (kahouTyp == "meiba") { Entity_kahou_meiba_mst meibaKahouMst = Resources.Load("Data/kahou_meiba_mst") as Entity_kahou_meiba_mst; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouInfoList.Add(meibaKahouMst.param[kahouId - 1].kahouNameEng); kahouInfoList.Add(meibaKahouMst.param[kahouId - 1].kahouExpEng); kahouInfoList.Add(meibaKahouMst.param[kahouId - 1].kahouTargetEng); } else { kahouInfoList.Add(meibaKahouMst.param[kahouId - 1].kahouName); kahouInfoList.Add(meibaKahouMst.param[kahouId - 1].kahouExp); kahouInfoList.Add(meibaKahouMst.param[kahouId - 1].kahouTarget); } kahouInfoList.Add(meibaKahouMst.param [kahouId - 1].kahouEffect.ToString()); kahouInfoList.Add(meibaKahouMst.param [kahouId - 1].unit.ToString()); kahouInfoList.Add(meibaKahouMst.param [kahouId - 1].kahouBuy.ToString()); kahouInfoList.Add(meibaKahouMst.param [kahouId - 1].kahouSell.ToString()); kahouInfoList.Add(meibaKahouMst.param [kahouId - 1].kahouRatio.ToString()); } else if (kahouTyp == "cyadougu") { Entity_kahou_cyadougu_mst cyadouguKahouMst = Resources.Load("Data/kahou_cyadougu_mst") as Entity_kahou_cyadougu_mst; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouInfoList.Add(cyadouguKahouMst.param[kahouId - 1].kahouNameEng); kahouInfoList.Add(cyadouguKahouMst.param[kahouId - 1].kahouExpEng); kahouInfoList.Add(cyadouguKahouMst.param[kahouId - 1].kahouTargetEng); } else { kahouInfoList.Add(cyadouguKahouMst.param[kahouId - 1].kahouName); kahouInfoList.Add(cyadouguKahouMst.param[kahouId - 1].kahouExp); kahouInfoList.Add(cyadouguKahouMst.param[kahouId - 1].kahouTarget); } kahouInfoList.Add(cyadouguKahouMst.param [kahouId - 1].kahouEffect.ToString()); kahouInfoList.Add(cyadouguKahouMst.param [kahouId - 1].unit.ToString()); kahouInfoList.Add(cyadouguKahouMst.param [kahouId - 1].kahouBuy.ToString()); kahouInfoList.Add(cyadouguKahouMst.param [kahouId - 1].kahouSell.ToString()); kahouInfoList.Add(cyadouguKahouMst.param [kahouId - 1].kahouRatio.ToString()); } else if (kahouTyp == "heihousyo") { Entity_kahou_heihousyo_mst heihousyoKahouMst = Resources.Load("Data/kahou_heihousyo_mst") as Entity_kahou_heihousyo_mst; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouInfoList.Add(heihousyoKahouMst.param[kahouId - 1].kahouNameEng); kahouInfoList.Add(heihousyoKahouMst.param[kahouId - 1].kahouExpEng); kahouInfoList.Add(heihousyoKahouMst.param[kahouId - 1].kahouTargetEng); } else { kahouInfoList.Add(heihousyoKahouMst.param[kahouId - 1].kahouName); kahouInfoList.Add(heihousyoKahouMst.param[kahouId - 1].kahouExp); kahouInfoList.Add(heihousyoKahouMst.param[kahouId - 1].kahouTarget); } kahouInfoList.Add(heihousyoKahouMst.param [kahouId - 1].kahouEffect.ToString()); kahouInfoList.Add(heihousyoKahouMst.param [kahouId - 1].unit.ToString()); kahouInfoList.Add(heihousyoKahouMst.param [kahouId - 1].kahouBuy.ToString()); kahouInfoList.Add(heihousyoKahouMst.param [kahouId - 1].kahouSell.ToString()); kahouInfoList.Add(heihousyoKahouMst.param [kahouId - 1].kahouRatio.ToString()); } else if (kahouTyp == "chishikisyo") { Entity_kahou_chishikisyo_mst chishikisyoKahouMst = Resources.Load("Data/kahou_chishikisyo_mst") as Entity_kahou_chishikisyo_mst; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouInfoList.Add(chishikisyoKahouMst.param[kahouId - 1].kahouNameEng); kahouInfoList.Add(chishikisyoKahouMst.param[kahouId - 1].kahouExpEng); kahouInfoList.Add(chishikisyoKahouMst.param[kahouId - 1].kahouTargetEng); } else { kahouInfoList.Add(chishikisyoKahouMst.param[kahouId - 1].kahouName); kahouInfoList.Add(chishikisyoKahouMst.param[kahouId - 1].kahouExp); kahouInfoList.Add(chishikisyoKahouMst.param[kahouId - 1].kahouTarget); } kahouInfoList.Add(chishikisyoKahouMst.param [kahouId - 1].kahouEffect.ToString()); kahouInfoList.Add(chishikisyoKahouMst.param [kahouId - 1].unit.ToString()); kahouInfoList.Add(chishikisyoKahouMst.param [kahouId - 1].kahouBuy.ToString()); kahouInfoList.Add(chishikisyoKahouMst.param [kahouId - 1].kahouSell.ToString()); kahouInfoList.Add(chishikisyoKahouMst.param [kahouId - 1].kahouRatio.ToString()); } return(kahouInfoList); }
public void OnClick() { AudioSource[] audioSources = GameObject.Find("SEController").GetComponents <AudioSource> (); audioSources [0].Play(); if (Application.loadedLevelName == "souko") { //Souko Scene GameObject.Find("GetMoney").GetComponent <Image> ().enabled = true; GameObject sellBtn = GameObject.Find("SellButton"); sellBtn.GetComponent <Image> ().enabled = true; sellBtn.GetComponent <Button> ().enabled = true; sellBtn.transform.FindChild("Text").GetComponent <Text> ().enabled = true; GameObject.Find("ItemNameValue").GetComponent <Text> ().text = kahouName; GameObject.Find("KahouEffectLabel").GetComponent <Text> ().text = kahouTarget; string effect = "+" + kahouEffect + kahouUnit; GameObject.Find("KahouEffectValue").GetComponent <Text> ().text = effect; string sell = "+" + kahouSell; GameObject.Find("GetMoneyValue").GetComponent <Text> ().text = sell; //Delete Previous Icon GameObject itemView = GameObject.Find("ItemView"); foreach (Transform n in itemView.transform) { if (n.tag == "Kahou") { GameObject.Destroy(n.gameObject); } } string kahouIconPath = "Prefabs/Item/Kahou/" + name; GameObject kahouIcon = Instantiate(Resources.Load(kahouIconPath)) as GameObject; kahouIcon.transform.SetParent(itemView.transform); kahouIcon.transform.localScale = new Vector2(1, 1); RectTransform kahouTransform = kahouIcon.GetComponent <RectTransform> (); kahouTransform.anchoredPosition3D = new Vector3(0, 120, 0); kahouIcon.GetComponent <Button> ().enabled = false; //Sell Button Set sellBtn.GetComponent <DoSell> ().kahouId = kahouId; sellBtn.GetComponent <DoSell> ().kahouName = kahouName; sellBtn.GetComponent <DoSell> ().kahouType = kahouType; sellBtn.GetComponent <DoSell> ().kahouSell = kahouSell; } else if (Application.loadedLevelName == "busyo") { //Busyo Kahou Scene GameObject mainController = GameObject.Find("GameScene"); mainController.GetComponent <NowOnButton> ().onKahouButton = this.transform.parent.gameObject.name; /*Board with Current Kahou Info*/ //Back Cover string backPath = "Prefabs/Busyo/back"; GameObject back = Instantiate(Resources.Load(backPath)) as GameObject; back.transform.SetParent(GameObject.Find("Panel").transform); back.transform.localScale = new Vector2(1, 1); RectTransform backTransform = back.GetComponent <RectTransform> (); backTransform.anchoredPosition3D = new Vector3(0, 0, 0); //Popup Screen string popupPath = "Prefabs/Busyo/equipedKahouBoard"; GameObject popup = Instantiate(Resources.Load(popupPath)) as GameObject; popup.transform.SetParent(GameObject.Find("Panel").transform); popup.transform.localScale = new Vector2(1, 1); RectTransform popupTransform = popup.GetComponent <RectTransform> (); popupTransform.anchoredPosition3D = new Vector3(0, 0, 0); //Get Kahou Data if (kahouType == "bugu") { Entity_kahou_bugu_mst Mst = Resources.Load("Data/kahou_bugu_mst") as Entity_kahou_bugu_mst; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = Mst.param[kahouId - 1].kahouNameEng; kahouTarget = Mst.param[kahouId - 1].kahouTargetEng; } else { kahouName = Mst.param[kahouId - 1].kahouName; kahouTarget = Mst.param[kahouId - 1].kahouTarget; } kahouEffect = Mst.param [kahouId - 1].kahouEffect; kahouUnit = Mst.param [kahouId - 1].unit; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouExp = Mst.param [kahouId - 1].kahouExpEng; } else { kahouExp = Mst.param[kahouId - 1].kahouExp; } } else if (kahouType == "kabuto") { Entity_kahou_kabuto_mst Mst = Resources.Load("Data/kahou_kabuto_mst") as Entity_kahou_kabuto_mst; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = Mst.param[kahouId - 1].kahouNameEng; kahouTarget = Mst.param[kahouId - 1].kahouTargetEng; } else { kahouName = Mst.param[kahouId - 1].kahouName; kahouTarget = Mst.param[kahouId - 1].kahouTarget; } kahouEffect = Mst.param [kahouId - 1].kahouEffect; kahouUnit = Mst.param [kahouId - 1].unit; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouExp = Mst.param[kahouId - 1].kahouExpEng; } else { kahouExp = Mst.param[kahouId - 1].kahouExp; } } else if (kahouType == "gusoku") { Entity_kahou_gusoku_mst Mst = Resources.Load("Data/kahou_gusoku_mst") as Entity_kahou_gusoku_mst; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = Mst.param[kahouId - 1].kahouNameEng; kahouTarget = Mst.param[kahouId - 1].kahouTargetEng; } else { kahouName = Mst.param[kahouId - 1].kahouName; kahouTarget = Mst.param[kahouId - 1].kahouTarget; } kahouEffect = Mst.param [kahouId - 1].kahouEffect; kahouUnit = Mst.param [kahouId - 1].unit; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouExp = Mst.param[kahouId - 1].kahouExpEng; } else { kahouExp = Mst.param[kahouId - 1].kahouExp; } } else if (kahouType == "meiba") { Entity_kahou_meiba_mst Mst = Resources.Load("Data/kahou_meiba_mst") as Entity_kahou_meiba_mst; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = Mst.param[kahouId - 1].kahouNameEng; kahouTarget = Mst.param[kahouId - 1].kahouTargetEng; } else { kahouName = Mst.param[kahouId - 1].kahouName; kahouTarget = Mst.param[kahouId - 1].kahouTarget; } kahouEffect = Mst.param [kahouId - 1].kahouEffect; kahouUnit = Mst.param [kahouId - 1].unit; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouExp = Mst.param[kahouId - 1].kahouExpEng; } else { kahouExp = Mst.param[kahouId - 1].kahouExp; } } else if (kahouType == "cyadougu") { Entity_kahou_cyadougu_mst Mst = Resources.Load("Data/kahou_cyadougu_mst") as Entity_kahou_cyadougu_mst; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = Mst.param[kahouId - 1].kahouNameEng; kahouTarget = Mst.param[kahouId - 1].kahouTargetEng; } else { kahouName = Mst.param[kahouId - 1].kahouName; kahouTarget = Mst.param[kahouId - 1].kahouTarget; } kahouEffect = Mst.param [kahouId - 1].kahouEffect; kahouUnit = Mst.param [kahouId - 1].unit; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouExp = Mst.param[kahouId - 1].kahouExpEng; } else { kahouExp = Mst.param[kahouId - 1].kahouExp; } } else if (kahouType == "heihousyo") { Entity_kahou_heihousyo_mst Mst = Resources.Load("Data/kahou_heihousyo_mst") as Entity_kahou_heihousyo_mst; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = Mst.param[kahouId - 1].kahouNameEng; kahouTarget = Mst.param[kahouId - 1].kahouTargetEng; } else { kahouName = Mst.param[kahouId - 1].kahouName; kahouTarget = Mst.param[kahouId - 1].kahouTarget; } kahouEffect = Mst.param [kahouId - 1].kahouEffect; kahouUnit = Mst.param [kahouId - 1].unit; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouExp = Mst.param[kahouId - 1].kahouExpEng; } else { kahouExp = Mst.param[kahouId - 1].kahouExp; } } else if (kahouType == "chishikisyo") { Entity_kahou_chishikisyo_mst Mst = Resources.Load("Data/kahou_chishikisyo_mst") as Entity_kahou_chishikisyo_mst; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouName = Mst.param[kahouId - 1].kahouNameEng; kahouTarget = Mst.param[kahouId - 1].kahouTargetEng; } else { kahouName = Mst.param[kahouId - 1].kahouName; kahouTarget = Mst.param[kahouId - 1].kahouTarget; } kahouEffect = Mst.param [kahouId - 1].kahouEffect; kahouUnit = Mst.param [kahouId - 1].unit; if (Application.systemLanguage != SystemLanguage.Japanese) { kahouExp = Mst.param[kahouId - 1].kahouExpEng; } else { kahouExp = Mst.param[kahouId - 1].kahouExp; } } //Refrect Kahou info. GameObject.Find("equipedKahouName").GetComponent <Text> ().text = kahouName; GameObject.Find("equipedKahouEffectLabel").GetComponent <Text> ().text = kahouTarget; GameObject.Find("equipedKahouEffectValue").GetComponent <Text> ().text = "+" + kahouEffect + kahouUnit; GameObject.Find("equipedKahouExpValue").GetComponent <Text> ().text = kahouExp; string kahouTypId = kahouType + kahouId; string kahouPath = "Prefabs/Item/Kahou/" + kahouTypId; GameObject kahou = Instantiate(Resources.Load(kahouPath)) as GameObject; kahou.transform.SetParent(GameObject.Find("equipedKahouBoard(Clone)").transform); kahou.transform.localScale = new Vector3(1.2f, 1.2f, 0); RectTransform kahouTransform = kahou.GetComponent <RectTransform> (); kahouTransform.anchoredPosition3D = new Vector3(-360, 0, 0); kahou.GetComponent <Button> ().enabled = false; //Send Param Delete Button GameObject.Find("DeleteButton").GetComponent <DeleteKahou> ().kahouType = kahouType; GameObject.Find("DeleteButton").GetComponent <DeleteKahou> ().kahouId = kahouId; } else if (Application.loadedLevelName == "zukan") { string pathOfBack = "Prefabs/Common/TouchBack"; GameObject back = Instantiate(Resources.Load(pathOfBack)) as GameObject; back.transform.parent = GameObject.Find("Panel").transform; back.transform.localScale = new Vector2(1, 1); back.transform.localPosition = new Vector2(0, 0); string pathOfPop = "Prefabs/Zukan/kahouPop"; GameObject pop = Instantiate(Resources.Load(pathOfPop)) as GameObject; pop.transform.parent = GameObject.Find("Panel").transform; pop.transform.localScale = new Vector2(1, 1); pop.transform.localPosition = new Vector2(0, 0); //Get Data string kahouTypId = kahouType + kahouId.ToString(); string kahouIconPath = "Prefabs/Item/Kahou/" + kahouTypId; GameObject kahouIcon = Instantiate(Resources.Load(kahouIconPath)) as GameObject; kahouIcon.transform.SetParent(pop.transform); kahouIcon.transform.localScale = new Vector2(1.5f, 1.5f); RectTransform rectIcon = kahouIcon.GetComponent <RectTransform>(); rectIcon.anchoredPosition3D = new Vector3(-130, 90, 0); kahouIcon.GetComponent <Button>().enabled = false; KahouStatusGet kahou = new KahouStatusGet(); List <string> kahouInfoList = new List <string> (); kahouInfoList = kahou.getKahouInfo(kahouType, kahouId); GameObject.Find("kahouNameValue").GetComponent <Text>().text = kahouInfoList[0]; string kahouTypeName = ""; if (Application.systemLanguage != SystemLanguage.Japanese) { if (kahouType == "bugu") { kahouTypeName = "Arms"; } else if (kahouType == "gusoku") { kahouTypeName = "Armor"; } else if (kahouType == "kabuto") { kahouTypeName = "Helmet"; } else if (kahouType == "meiba") { kahouTypeName = "Horse"; } else if (kahouType == "cyadougu") { kahouTypeName = "Tea Things"; } else if (kahouType == "chishikisyo") { kahouTypeName = "Book"; } else if (kahouType == "heihousyo") { kahouTypeName = "Tactics"; } } else { if (kahouType == "bugu") { kahouTypeName = "武具"; } else if (kahouType == "gusoku") { kahouTypeName = "具足"; } else if (kahouType == "kabuto") { kahouTypeName = "兜"; } else if (kahouType == "meiba") { kahouTypeName = "名馬"; } else if (kahouType == "cyadougu") { kahouTypeName = "茶道具"; } else if (kahouType == "chishikisyo") { kahouTypeName = "知識書"; } else if (kahouType == "heihousyo") { kahouTypeName = "兵法書"; } } GameObject.Find("kahouTypValue").GetComponent <Text>().text = kahouTypeName; GameObject.Find("EffectTitle").GetComponent <Text>().text = kahouInfoList[2]; string effect = "+" + kahouInfoList[3] + kahouInfoList[4]; GameObject.Find("EffectValue").GetComponent <Text>().text = effect; GameObject.Find("ExpValue").GetComponent <Text>().text = kahouInfoList[1]; } }