Example #1
0
	public void OnClick () {
		/*Scene Change*/
		GameObject.Find ("GameScene").GetComponent<SoukoScene> ().currentTab = "DouguScene";

		//button color change
		Color pushedTabColor = new Color (118f / 255f, 103f / 255f, 16f / 255f, 255f / 255f);
		Color pushedTextColor = new Color (219f / 255f, 219f / 255f, 212f / 255f, 255f / 255f);
		Color normalTabColor = new Color (255f / 255f, 255f / 255f, 255f / 255f, 255f / 255f);
		Color normalTextColor = new Color (255f / 255f, 255f / 255f, 0f / 255f, 255f / 255f);
		
		//Clear Color
		GameObject kahou = GameObject.Find ("Kahou");
		GameObject dougu = GameObject.Find ("Dougu");
		
		kahou.GetComponent<Image> ().color = normalTabColor;
		dougu.GetComponent<Image> ().color = pushedTabColor;

		kahou.transform.FindChild ("Text").GetComponent<Text> ().color = normalTextColor;
		dougu.transform.FindChild ("Text").GetComponent<Text> ().color = pushedTextColor;

		/*Initialize Kahou View*/
		GameObject itemView = GameObject.Find ("ItemView");
		itemView.transform.FindChild ("GetMoney").GetComponent<Image>().enabled = false;
		GameObject sellBtn = GameObject.Find ("SellButton");
		sellBtn.GetComponent<Image>().enabled = false;
		sellBtn.GetComponent<Button>().enabled = false;
		sellBtn.transform.FindChild("Text").GetComponent<Text>().enabled = false;
		itemView.transform.FindChild ("KahouEffectValue").GetComponent<Text> ().text = "";
		itemView.transform.FindChild ("KahouEffectLabel").GetComponent<Text> ().text = "";
		GameObject.Find ("GetMoneyValue").GetComponent<Text> ().text = "";
		itemView.transform.FindChild ("ItemNameValue").GetComponent<Text> ().text = "道具選択";

		GameObject.Find ("Background").GetComponent<Image>().enabled = false;
		GameObject.Find ("Fill").GetComponent<Image>().enabled = false;
		GameObject.Find ("Handle").GetComponent<Image>().enabled = false;
		GameObject.Find ("SellQty").GetComponent<Image>().enabled = false;
		GameObject.Find ("SellQtyValue").GetComponent<Text>().text = "";
		GameObject.Find ("DouguExpValue").GetComponent<Text>().text = "";

		foreach ( Transform n in itemView.transform ){
			if(n.tag == "Kahou"){
				GameObject.Destroy(n.gameObject);
			}
		}
		string defaultIconPath = "Prefabs/Item/Kahou/NoKabuto";
		GameObject defIcon = Instantiate (Resources.Load (defaultIconPath)) as GameObject;
		defIcon.transform.SetParent(itemView.transform);
		defIcon.transform.localScale = new Vector2 (1, 1);
		RectTransform defTransform = defIcon.GetComponent<RectTransform> ();
		defTransform.anchoredPosition3D = new Vector3 (0, 120, 0);
		defIcon.GetComponent<Button> ().enabled = false;

		/*avairable Dougu*/
		//Clear Previous Data
		GameObject content = GameObject.Find ("Content");
		foreach ( Transform n in content.transform ){
			GameObject.Destroy(n.gameObject);
		}

		//Common
		char[] delimiterChars = {','};
		string kanjyoItemPath = "Prefabs/Item/Kanjyo/Kanjyo";
		string cyouheiItemPath = "Prefabs/Item/Cyouhei/";
		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);

		//1. Kanjyo
		//Ge
		string kanjyoString = PlayerPrefs.GetString("kanjyo");
		string[] kanjyo_list = kanjyoString.Split (delimiterChars);
		int kanjyoGeQty = int.Parse(kanjyo_list[0]);
		if(kanjyoGeQty != 0){
			GameObject lowKanjyoItem = Instantiate (Resources.Load (kanjyoItemPath)) as GameObject;
			lowKanjyoItem.transform.SetParent(GameObject.Find ("Content").transform);
			lowKanjyoItem.transform.localScale = new Vector2 (1, 1);
			lowKanjyoItem.transform.localPosition = new Vector3 (0, 0, 0);
			lowKanjyoItem.GetComponent<Image>().color = lowColor;
			lowKanjyoItem.transform.FindChild("KanjyoRank").GetComponent<Text>().text = "下";
			lowKanjyoItem.transform.FindChild("Qty").GetComponent<Text>().text = kanjyoGeQty.ToString();
			lowKanjyoItem.name = "Kanjyo1";
			lowKanjyoItem.GetComponent<Button>().enabled = true;
			lowKanjyoItem.GetComponent<ItemInfo>().posessQty = kanjyoGeQty;
			RectTransform kanjyoImage = lowKanjyoItem.transform.FindChild("Kanjyo").GetComponent<RectTransform> ();
			kanjyoImage.sizeDelta = new Vector2 (140, 140);
		}

		//Cyu
		int kanjyoCyuQty = int.Parse(kanjyo_list[1]);
		if(kanjyoCyuQty != 0){
			GameObject midKanjyoItem = Instantiate (Resources.Load (kanjyoItemPath)) as GameObject;
			midKanjyoItem.transform.SetParent(GameObject.Find ("Content").transform);
			midKanjyoItem.transform.localScale = new Vector2 (1, 1);
			midKanjyoItem.transform.localPosition = new Vector3 (0, 0, 0);
			midKanjyoItem.GetComponent<Image>().color = midColor;
			midKanjyoItem.transform.FindChild("KanjyoRank").GetComponent<Text>().text = "中";
			midKanjyoItem.transform.FindChild("Qty").GetComponent<Text>().text = kanjyoCyuQty.ToString();
			midKanjyoItem.name = "Kanjyo2";
			midKanjyoItem.GetComponent<Button>().enabled = true;
			midKanjyoItem.GetComponent<ItemInfo>().posessQty = kanjyoCyuQty;
			RectTransform kanjyoImage = midKanjyoItem.transform.FindChild("Kanjyo").GetComponent<RectTransform> ();
			kanjyoImage.sizeDelta = new Vector2 (140, 140);

		}

		//Jyo
		int kanjyoJyoQty = int.Parse(kanjyo_list[2]);
		if(kanjyoJyoQty != 0){
			GameObject jyoKanjyoItem = Instantiate (Resources.Load (kanjyoItemPath)) as GameObject;
			jyoKanjyoItem.transform.SetParent(GameObject.Find ("Content").transform);
			jyoKanjyoItem.transform.localScale = new Vector2 (1, 1);
			jyoKanjyoItem.transform.localPosition = new Vector3 (0, 0, 0);
			jyoKanjyoItem.GetComponent<Image>().color = highColor;
			jyoKanjyoItem.transform.FindChild("KanjyoRank").GetComponent<Text>().text = "上";
			jyoKanjyoItem.transform.FindChild("Qty").GetComponent<Text>().text = kanjyoJyoQty.ToString();
			jyoKanjyoItem.name = "Kanjyo3";
			jyoKanjyoItem.GetComponent<Button>().enabled = true;
			jyoKanjyoItem.GetComponent<ItemInfo>().posessQty = kanjyoJyoQty;
			RectTransform kanjyoImage = jyoKanjyoItem.transform.FindChild("Kanjyo").GetComponent<RectTransform> ();
			kanjyoImage.sizeDelta = new Vector2 (140, 140);
		}

		//2. Cyouhei
		//cyouheiYR
		//Ge
		string cyouheiYRTmp = "cyouheiYR";
		string cyouheiYRPath = cyouheiItemPath + "CyouheiYR";
		string cyouheiYRString = PlayerPrefs.GetString(cyouheiYRTmp);
		string[] cyouheiYR_list = cyouheiYRString.Split (delimiterChars);
		int cyouheiYRGeQty = int.Parse(cyouheiYR_list[0]);
		if(cyouheiYRGeQty != 0){
			GameObject lowCyouheiYR = Instantiate (Resources.Load (cyouheiYRPath)) as GameObject;
			lowCyouheiYR.transform.SetParent(GameObject.Find ("Content").transform);
			lowCyouheiYR.transform.localScale = new Vector2 (1, 1);
			lowCyouheiYR.transform.localPosition = new Vector3 (0, 0, 0);
			lowCyouheiYR.GetComponent<Image>().color = lowColor;
			lowCyouheiYR.transform.FindChild("CyouheiRank").GetComponent<Text>().text = "下";
			lowCyouheiYR.transform.FindChild("Qty").GetComponent<Text>().text = cyouheiYRGeQty.ToString();
			lowCyouheiYR.name = "CyouheiYR1";
			lowCyouheiYR.GetComponent<Button>().enabled = true;
			lowCyouheiYR.GetComponent<ItemInfo>().posessQty = cyouheiYRGeQty;
		}

		//Cyu
		int cyouheiYRCyuQty = int.Parse(cyouheiYR_list[1]);
		if(cyouheiYRCyuQty != 0){
			GameObject midCyouheiYR = Instantiate (Resources.Load (cyouheiYRPath)) as GameObject;
			midCyouheiYR.transform.SetParent(GameObject.Find ("Content").transform);
			midCyouheiYR.transform.localScale = new Vector2 (1, 1);
			midCyouheiYR.transform.localPosition = new Vector3 (0, 0, 0);
			midCyouheiYR.GetComponent<Image>().color = midColor;
			midCyouheiYR.transform.FindChild("CyouheiRank").GetComponent<Text>().text = "中";
			midCyouheiYR.transform.FindChild("Qty").GetComponent<Text>().text = cyouheiYRCyuQty.ToString();
			midCyouheiYR.name = "CyouheiYR2";
			midCyouheiYR.GetComponent<Button>().enabled = true;
			midCyouheiYR.GetComponent<ItemInfo>().posessQty = cyouheiYRCyuQty;
		}

		//Jyo
		int cyouheiYRJyoQty = int.Parse(cyouheiYR_list[2]);
		if(cyouheiYRJyoQty != 0){
			GameObject highCyouheiYR = Instantiate (Resources.Load (cyouheiYRPath)) as GameObject;
			highCyouheiYR.transform.SetParent(GameObject.Find ("Content").transform);
			highCyouheiYR.transform.localScale = new Vector2 (1, 1);
			highCyouheiYR.transform.localPosition = new Vector3 (0, 0, 0);
			highCyouheiYR.GetComponent<Image>().color = highColor;
			highCyouheiYR.transform.FindChild("CyouheiRank").GetComponent<Text>().text = "上";
			highCyouheiYR.transform.FindChild("Qty").GetComponent<Text>().text = cyouheiYRJyoQty.ToString();
			highCyouheiYR.name = "CyouheiYR3";
			highCyouheiYR.GetComponent<Button>().enabled = true;
			highCyouheiYR.GetComponent<ItemInfo>().posessQty = cyouheiYRJyoQty;
		}

		//cyouheiKB
		//Ge
		string cyouheiKBTmp = "cyouheiKB";
		string cyouheiKBPath = cyouheiItemPath + "CyouheiKB";
		string cyouheiKBString = PlayerPrefs.GetString(cyouheiKBTmp);
		string[] cyouheiKB_list = cyouheiKBString.Split (delimiterChars);
		int cyouheiKBGeQty = int.Parse(cyouheiKB_list[0]);
		if(cyouheiKBGeQty != 0){
			GameObject lowCyouheiKB = Instantiate (Resources.Load (cyouheiKBPath)) as GameObject;
			lowCyouheiKB.transform.SetParent(GameObject.Find ("Content").transform);
			lowCyouheiKB.transform.localScale = new Vector2 (1, 1);
			lowCyouheiKB.transform.localPosition = new Vector3 (0, 0, 0);
			lowCyouheiKB.GetComponent<Image>().color = lowColor;
			lowCyouheiKB.transform.FindChild("CyouheiRank").GetComponent<Text>().text = "下";
			lowCyouheiKB.transform.FindChild("Qty").GetComponent<Text>().text = cyouheiKBGeQty.ToString();
			lowCyouheiKB.name = "CyouheiKB1";
			lowCyouheiKB.GetComponent<Button>().enabled = true;
			lowCyouheiKB.GetComponent<ItemInfo>().posessQty = cyouheiKBGeQty;
		}
		
		//Cyu
		int cyouheiKBCyuQty = int.Parse(cyouheiKB_list[1]);
		if(cyouheiKBCyuQty != 0){
			GameObject midCyouheiKB = Instantiate (Resources.Load (cyouheiKBPath)) as GameObject;
			midCyouheiKB.transform.SetParent(GameObject.Find ("Content").transform);
			midCyouheiKB.transform.localScale = new Vector2 (1, 1);
			midCyouheiKB.transform.localPosition = new Vector3 (0, 0, 0);
			midCyouheiKB.GetComponent<Image>().color = midColor;
			midCyouheiKB.transform.FindChild("CyouheiRank").GetComponent<Text>().text = "中";
			midCyouheiKB.transform.FindChild("Qty").GetComponent<Text>().text = cyouheiKBCyuQty.ToString();
			midCyouheiKB.name = "CyouheiKB2";
			midCyouheiKB.GetComponent<Button>().enabled = true;
			midCyouheiKB.GetComponent<ItemInfo>().posessQty = cyouheiKBCyuQty;
		}
		
		//Jyo
		int cyouheiKBJyoQty = int.Parse(cyouheiKB_list[2]);
		if(cyouheiKBJyoQty != 0){
			GameObject highCyouheiKB = Instantiate (Resources.Load (cyouheiKBPath)) as GameObject;
			highCyouheiKB.transform.SetParent(GameObject.Find ("Content").transform);
			highCyouheiKB.transform.localScale = new Vector2 (1, 1);
			highCyouheiKB.transform.localPosition = new Vector3 (0, 0, 0);
			highCyouheiKB.GetComponent<Image>().color = highColor;
			highCyouheiKB.transform.FindChild("CyouheiRank").GetComponent<Text>().text = "上";
			highCyouheiKB.transform.FindChild("Qty").GetComponent<Text>().text = cyouheiKBJyoQty.ToString();
			highCyouheiKB.name = "CyouheiKB3";
			highCyouheiKB.GetComponent<Button>().enabled = true;
			highCyouheiKB.GetComponent<ItemInfo>().posessQty = cyouheiKBJyoQty;
		}

		//cyouheiTP
		//Ge
		string cyouheiTPTmp = "cyouheiTP";
		string cyouheiTPPath = cyouheiItemPath + "CyouheiTP";
		string cyouheiTPString = PlayerPrefs.GetString(cyouheiTPTmp);
		string[] cyouheiTP_list = cyouheiTPString.Split (delimiterChars);
		int cyouheiTPGeQty = int.Parse(cyouheiTP_list[0]);
		if(cyouheiTPGeQty != 0){
			GameObject lowCyouheiTP = Instantiate (Resources.Load (cyouheiTPPath)) as GameObject;
			lowCyouheiTP.transform.SetParent(GameObject.Find ("Content").transform);
			lowCyouheiTP.transform.localScale = new Vector2 (1, 1);
			lowCyouheiTP.transform.localPosition = new Vector3 (0, 0, 0);
			lowCyouheiTP.GetComponent<Image>().color = lowColor;
			lowCyouheiTP.transform.FindChild("CyouheiRank").GetComponent<Text>().text = "下";
			lowCyouheiTP.transform.FindChild("Qty").GetComponent<Text>().text = cyouheiTPGeQty.ToString();
			lowCyouheiTP.name =  "CyouheiTP1";
			lowCyouheiTP.GetComponent<Button>().enabled = true;
			lowCyouheiTP.GetComponent<ItemInfo>().posessQty = cyouheiTPGeQty;
		}
		
		//Cyu
		int cyouheiTPCyuQty = int.Parse(cyouheiTP_list[1]);
		if(cyouheiTPCyuQty != 0){
			GameObject midCyouheiTP = Instantiate (Resources.Load (cyouheiTPPath)) as GameObject;
			midCyouheiTP.transform.SetParent(GameObject.Find ("Content").transform);
			midCyouheiTP.transform.localScale = new Vector2 (1, 1);
			midCyouheiTP.transform.localPosition = new Vector3 (0, 0, 0);
			midCyouheiTP.GetComponent<Image>().color = midColor;
			midCyouheiTP.transform.FindChild("CyouheiRank").GetComponent<Text>().text = "中";
			midCyouheiTP.transform.FindChild("Qty").GetComponent<Text>().text = cyouheiTPCyuQty.ToString();
			midCyouheiTP.name = "CyouheiTP2";
			midCyouheiTP.GetComponent<Button>().enabled = true;
			midCyouheiTP.GetComponent<ItemInfo>().posessQty = cyouheiTPCyuQty;
		}
		
		//Jyo
		int cyouheiTPJyoQty = int.Parse(cyouheiTP_list[2]);
		if(cyouheiTPJyoQty != 0){
			GameObject highCyouheiTP = Instantiate (Resources.Load (cyouheiTPPath)) as GameObject;
			highCyouheiTP.transform.SetParent(GameObject.Find ("Content").transform);
			highCyouheiTP.transform.localScale = new Vector2 (1, 1);
			highCyouheiTP.transform.localPosition = new Vector3 (0, 0, 0);
			highCyouheiTP.GetComponent<Image>().color = highColor;
			highCyouheiTP.transform.FindChild("CyouheiRank").GetComponent<Text>().text = "上";
			highCyouheiTP.transform.FindChild("Qty").GetComponent<Text>().text = cyouheiTPJyoQty.ToString();
			highCyouheiTP.name = "CyouheiTP3";
			highCyouheiTP.GetComponent<Button>().enabled = true;
			highCyouheiTP.GetComponent<ItemInfo>().posessQty = cyouheiTPJyoQty;
		}

		//cyouheiYM
		//Ge
		string cyouheiYMTmp = "cyouheiYM";
		string cyouheiYMPath = cyouheiItemPath + "CyouheiYM";
		string cyouheiYMString = PlayerPrefs.GetString(cyouheiYMTmp);
		string[] cyouheiYM_list = cyouheiYMString.Split (delimiterChars);
		int cyouheiYMGeQty = int.Parse(cyouheiYM_list[0]);
		if(cyouheiYMGeQty != 0){
			GameObject lowCyouheiYM = Instantiate (Resources.Load (cyouheiYMPath)) as GameObject;
			lowCyouheiYM.transform.SetParent(GameObject.Find ("Content").transform);
			lowCyouheiYM.transform.localScale = new Vector2 (1, 1);
			lowCyouheiYM.transform.localPosition = new Vector3 (0, 0, 0);
			lowCyouheiYM.GetComponent<Image>().color = lowColor;
			lowCyouheiYM.transform.FindChild("CyouheiRank").GetComponent<Text>().text = "下";
			lowCyouheiYM.transform.FindChild("Qty").GetComponent<Text>().text = cyouheiYMGeQty.ToString();
			lowCyouheiYM.name = "CyouheiYM1";
			lowCyouheiYM.GetComponent<Button>().enabled = true;
			lowCyouheiYM.GetComponent<ItemInfo>().posessQty = cyouheiYMGeQty;
		}
		
		//Cyu
		int cyouheiYMCyuQty = int.Parse(cyouheiYM_list[1]);
		if(cyouheiYMCyuQty != 0){
			GameObject midCyouheiYM = Instantiate (Resources.Load (cyouheiYMPath)) as GameObject;
			midCyouheiYM.transform.SetParent(GameObject.Find ("Content").transform);
			midCyouheiYM.transform.localScale = new Vector2 (1, 1);
			midCyouheiYM.transform.localPosition = new Vector3 (0, 0, 0);
			midCyouheiYM.GetComponent<Image>().color = midColor;
			midCyouheiYM.transform.FindChild("CyouheiRank").GetComponent<Text>().text = "中";
			midCyouheiYM.transform.FindChild("Qty").GetComponent<Text>().text = cyouheiYMCyuQty.ToString();
			midCyouheiYM.name =  "CyouheiYM2";
			midCyouheiYM.GetComponent<Button>().enabled = true;
			midCyouheiYM.GetComponent<ItemInfo>().posessQty = cyouheiYMCyuQty;
		}
		
		//Jyo
		int cyouheiYMJyoQty = int.Parse(cyouheiYM_list[2]);
		if(cyouheiYMJyoQty != 0){
			GameObject highCyouheiYM = Instantiate (Resources.Load (cyouheiYMPath)) as GameObject;
			highCyouheiYM.transform.SetParent(GameObject.Find ("Content").transform);
			highCyouheiYM.transform.localScale = new Vector2 (1, 1);
			highCyouheiYM.transform.localPosition = new Vector3 (0, 0, 0);
			highCyouheiYM.GetComponent<Image>().color = highColor;
			highCyouheiYM.transform.FindChild("CyouheiRank").GetComponent<Text>().text = "上";
			highCyouheiYM.transform.FindChild("Qty").GetComponent<Text>().text = cyouheiYMJyoQty.ToString();
			highCyouheiYM.name = "CyouheiYM3";
			highCyouheiYM.GetComponent<Button>().enabled = true;
			highCyouheiYM.GetComponent<ItemInfo>().posessQty = cyouheiYMJyoQty;
		}

		//3. Hidensyo
		string hidensyoItemPath = "Prefabs/Item/Hidensyo/Hidensyo";
		//Ge
		int hidensyoGeQty = PlayerPrefs.GetInt("hidensyoGe");
		if(hidensyoGeQty != 0){
			GameObject lowHidensyo = Instantiate (Resources.Load (hidensyoItemPath)) as GameObject;
			lowHidensyo.transform.SetParent(GameObject.Find ("Content").transform);
			lowHidensyo.transform.localScale = new Vector2 (1, 1);
			lowHidensyo.transform.localPosition = new Vector3 (0, 0, 0);
			lowHidensyo.GetComponent<Image>().color = lowColor;
			lowHidensyo.transform.FindChild("HidensyoRank").GetComponent<Text>().text = "下";
			lowHidensyo.transform.FindChild("Qty").GetComponent<Text>().text = hidensyoGeQty.ToString();
			lowHidensyo.name = "Hidensyo1";
			lowHidensyo.GetComponent<Button>().enabled = true;
			lowHidensyo.GetComponent<ItemInfo>().posessQty = hidensyoGeQty;
			
		}

		//Cyu
		int hidensyoCyuQty = PlayerPrefs.GetInt("hidensyoCyu");
		if(hidensyoCyuQty != 0){
			GameObject midHidensyo = Instantiate (Resources.Load (hidensyoItemPath)) as GameObject;
			midHidensyo.transform.SetParent(GameObject.Find ("Content").transform);
			midHidensyo.transform.localScale = new Vector2 (1, 1);
			midHidensyo.transform.localPosition = new Vector3 (0, 0, 0);
			midHidensyo.GetComponent<Image>().color = midColor;
			midHidensyo.transform.FindChild("HidensyoRank").GetComponent<Text>().text = "中";
			midHidensyo.transform.FindChild("Qty").GetComponent<Text>().text = hidensyoCyuQty.ToString();
			midHidensyo.name = "Hidensyo2";
			midHidensyo.GetComponent<Button>().enabled = true;
			midHidensyo.GetComponent<ItemInfo>().posessQty = hidensyoCyuQty;
		}

		//Jyo
		int hidensyoJyoQty = PlayerPrefs.GetInt("hidensyoJyo");
		if(hidensyoJyoQty != 0){
			GameObject highHidensyo = Instantiate (Resources.Load (hidensyoItemPath)) as GameObject;
			highHidensyo.transform.SetParent(GameObject.Find ("Content").transform);
			highHidensyo.transform.localScale = new Vector2 (1, 1);
			highHidensyo.transform.localPosition = new Vector3 (0, 0, 0);
			highHidensyo.GetComponent<Image>().color = highColor;
			highHidensyo.transform.FindChild("HidensyoRank").GetComponent<Text>().text = "上";
			highHidensyo.transform.FindChild("Qty").GetComponent<Text>().text = hidensyoJyoQty.ToString();
			highHidensyo.name = "Hidensyo3";
			highHidensyo.GetComponent<Button>().enabled = true;
			highHidensyo.GetComponent<ItemInfo>().posessQty = hidensyoJyoQty;
		}

		//4. Shinobi
		string shinobiItemPath = "Prefabs/Item/Shinobi/Shinobi";
		//Ge
		int shinobiGeQty = PlayerPrefs.GetInt("shinobiGe");
		if(shinobiGeQty != 0){
			GameObject lowShinobi = Instantiate (Resources.Load (shinobiItemPath)) as GameObject;
			lowShinobi.transform.SetParent(GameObject.Find ("Content").transform);
			lowShinobi.transform.localScale = new Vector2 (1, 1);
			lowShinobi.transform.localPosition = new Vector3 (0, 0, 0);
			lowShinobi.GetComponent<Image>().color = lowColor;
			lowShinobi.transform.FindChild("ShinobiRank").GetComponent<Text>().text = "下";
			lowShinobi.transform.FindChild("Qty").GetComponent<Text>().text = shinobiGeQty.ToString();
			lowShinobi.name = "Shinobi1";
			lowShinobi.GetComponent<Button>().enabled = true;
			lowShinobi.GetComponent<ItemInfo>().posessQty = shinobiGeQty;
			
		}
		
		//Cyu
		int shinobiCyuQty = PlayerPrefs.GetInt("shinobiCyu");
		if(shinobiCyuQty != 0){
			GameObject midShinobi = Instantiate (Resources.Load (shinobiItemPath)) as GameObject;
			midShinobi.transform.SetParent(GameObject.Find ("Content").transform);
			midShinobi.transform.localScale = new Vector2 (1, 1);
			midShinobi.transform.localPosition = new Vector3 (0, 0, 0);
			midShinobi.GetComponent<Image>().color = midColor;
			midShinobi.transform.FindChild("ShinobiRank").GetComponent<Text>().text = "中";
			midShinobi.transform.FindChild("Qty").GetComponent<Text>().text = shinobiCyuQty.ToString();
			midShinobi.name = "Shinobi2";
			midShinobi.GetComponent<Button>().enabled = true;
			midShinobi.GetComponent<ItemInfo>().posessQty = shinobiCyuQty;
		}
		
		//Jyo
		int shinobiJyoQty = PlayerPrefs.GetInt("shinobiJyo");
		if(shinobiJyoQty != 0){
			GameObject highShinobi = Instantiate (Resources.Load (shinobiItemPath)) as GameObject;
			highShinobi.transform.SetParent(GameObject.Find ("Content").transform);
			highShinobi.transform.localScale = new Vector2 (1, 1);
			highShinobi.transform.localPosition = new Vector3 (0, 0, 0);
			highShinobi.GetComponent<Image>().color = highColor;
			highShinobi.transform.FindChild("ShinobiRank").GetComponent<Text>().text = "上";
			highShinobi.transform.FindChild("Qty").GetComponent<Text>().text = shinobiJyoQty.ToString();
			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);
				
				gokui.GetComponent<Button>().enabled = true;
				gokui.GetComponent<ItemInfo>().posessQty = int.Parse(qty);
			}
		}

		//7. Nanban

		string nanbanString = PlayerPrefs.GetString("nanbanItem");
		List<string> nanbanList = new List<string> ();
		nanbanList = new List<string> (nanbanString.Split (delimiterChars));
		
		for(int i=0; i<nanbanList.Count; i++){
			string qty = nanbanList[i];
			
			if(qty != "0"){
				int tempNanbanId = i + 1;
				string nanbanPath = "Prefabs/Item/nanban";
				nanbanPath = nanbanPath + tempNanbanId;
				GameObject nanban = Instantiate (Resources.Load (nanbanPath)) as GameObject;
				nanban.transform.SetParent(GameObject.Find ("Content").transform);
				nanban.transform.localScale = new Vector2 (1, 1);
				nanban.transform.localPosition = new Vector3 (0, 0, 0);
				nanban.transform.FindChild("Qty").GetComponent<Text>().text = qty.ToString();

				nanban.name = "nanban" + tempNanbanId.ToString();

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

				RectTransform rankTransform = nanban.transform.FindChild("Rank").GetComponent<RectTransform>();
				rankTransform.anchoredPosition3D = new Vector3(-70,20,0);
				rankTransform.localScale = new Vector2(0.13f,0.13f);
				ItemInfo item = new ItemInfo();
				nanban.transform.FindChild("Rank").GetComponent<Text>().text = item.getItemName(nanban.name);
				
				nanban.GetComponent<Button>().enabled = true;
				nanban.GetComponent<ItemInfo>().posessQty = int.Parse(qty);
			}
		}

		//8. Koueki
		showThreeItem("koueki");


		//9. Cyoutei
		showThreeItem("cyoutei");


		//10. Tech
		//TP
		int tpTechQty = PlayerPrefs.GetInt("transferTP");
		if(tpTechQty !=0){
			string path = "Prefabs/Item/Tech/Tech";
			GameObject tech = Instantiate (Resources.Load (path)) as GameObject;
			tech.transform.SetParent(GameObject.Find ("Content").transform);
			tech.transform.localScale = new Vector2 (1, 1);
			tech.transform.localPosition = new Vector3 (0, 0, 0);
			tech.name = "tech1";

			//Image
			string spritePath = "Prefabs/Item/Tech/Sprite/tp";
			tech.GetComponent<Image> ().sprite = 
				Resources.Load (spritePath, typeof(Sprite)) as Sprite;

			//Qty
			tech.transform.FindChild("Qty").GetComponent<Text>().text = tpTechQty.ToString();
		}

		//KB
		int kbTechQty = PlayerPrefs.GetInt("transferKB");
		if(kbTechQty !=0){
			string path = "Prefabs/Item/Tech/Tech";
			GameObject tech = Instantiate (Resources.Load (path)) as GameObject;
			tech.transform.SetParent(GameObject.Find ("Content").transform);
			tech.transform.localScale = new Vector2 (1, 1);
			tech.transform.localPosition = new Vector3 (0, 0, 0);
			tech.name = "tech2";

			//Image
			string spritePath = "Prefabs/Item/Tech/Sprite/kb";
			tech.GetComponent<Image> ().sprite = 
				Resources.Load (spritePath, typeof(Sprite)) as Sprite;
			
			//Qty
			tech.transform.FindChild("Qty").GetComponent<Text>().text = kbTechQty.ToString();
		}

		//SNB
		int snbTechQty = PlayerPrefs.GetInt("transferSNB");
		if(snbTechQty !=0){
			string path = "Prefabs/Item/Tech/Tech";
			GameObject tech = Instantiate (Resources.Load (path)) as GameObject;
			tech.transform.SetParent(GameObject.Find ("Content").transform);
			tech.transform.localScale = new Vector2 (1, 1);
			tech.transform.localPosition = new Vector3 (0, 0, 0);
			tech.name = "tech3";

			//Image
			string spritePath = "Prefabs/Item/Tech/Sprite/snb";
			tech.GetComponent<Image> ().sprite = 
				Resources.Load (spritePath, typeof(Sprite)) as Sprite;
			
			//Qty
			tech.transform.FindChild("Qty").GetComponent<Text>().text = snbTechQty.ToString();
		}

	}
Example #2
0
	// Use this for initialization
	void Start () {


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

		if (activeStageId != 0) {
			//Active

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

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

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

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

					weatherHandling(stageMapId, map, mapFront);

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

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

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

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

				weatherHandling(stageMapId, map, null);
			}

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

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

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

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

					weatherHandling(stageMapId, map, mapFront);

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

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

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

				weatherHandling(stageMapId, mapPrefab, null);
			}
		}

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

		//1.魚麟
		if (jinkei == 1) {
			soudaisyo = PlayerPrefs.GetInt("soudaisyo1");
			if(PlayerPrefs.HasKey("1map1")){
				int mapId = 1;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("1map2")){
				int mapId = 2;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("1map7")){
				int mapId = 7;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("1map8")){
				int mapId = 8;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("1map11")){
				int mapId = 11;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("1map12")){
				int mapId = 12;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("1map13")){
				int mapId = 13;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("1map14")){
				int mapId = 14;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("1map17")){
				int mapId = 17;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("1map18")){
				int mapId = 18;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("1map21")){
				int mapId = 21;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("1map22")){
				int mapId = 22;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}



		//2.鶴翼
		}else if(jinkei == 2){
			soudaisyo = PlayerPrefs.GetInt("soudaisyo2");

			if(PlayerPrefs.HasKey("2map3")){
				int mapId = 3;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("2map4")){
				int mapId = 4;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("2map5")){
				int mapId = 5;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("2map7")){
				int mapId = 7;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("2map8")){
				int mapId = 8;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("2map11")){
				int mapId = 11;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("2map12")){
				int mapId = 12;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("2map17")){
				int mapId = 17;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("2map18")){
				int mapId = 18;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("2map23")){
				int mapId = 23;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("2map24")){
				int mapId = 24;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("2map25")){
				int mapId = 25;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}

		}
		//3.偃月
		else if(jinkei == 3){
			soudaisyo = PlayerPrefs.GetInt("soudaisyo3");

			if(PlayerPrefs.HasKey("3map3")){
				int mapId = 3;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("3map7")){
				int mapId = 7;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("3map8")){
				int mapId = 8;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("3map9")){
				int mapId = 9;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("3map11")){
				int mapId = 11;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("3map12")){
				int mapId = 12;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("3map14")){
				int mapId = 14;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("3map15")){
				int mapId = 15;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("3map16")){
				int mapId = 16;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("3map20")){
				int mapId = 20;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("3map21")){
				int mapId = 21;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("3map25")){
				int mapId = 25;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
		}

		//4.雁行
		else if(jinkei == 4){
			soudaisyo = PlayerPrefs.GetInt("soudaisyo4");

			if(PlayerPrefs.HasKey("4map1")){
				int mapId = 1;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("4map2")){
				int mapId = 2;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("4map7")){
				int mapId = 7;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("4map8")){
				int mapId = 8;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("4map12")){
				int mapId = 12;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("4map13")){
				int mapId = 13;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("4map14")){
				int mapId = 14;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("4map18")){
				int mapId = 18;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("4map19")){
				int mapId = 19;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("4map20")){
				int mapId = 20;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("4map24")){
				int mapId = 24;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
			if(PlayerPrefs.HasKey("4map25")){
				int mapId = 25;
				myBusyoList.Add(getStsAndMakeInstance(jinkei,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio));
			}
		}

		//Saku
		BusyoInfoGet info = new BusyoInfoGet();
		StatusGet sts = new StatusGet();
		GameObject content = GameObject.Find ("Content").gameObject;
		string slotPath = "Prefabs/Saku/Slot";
		Saku saku = new Saku ();

		foreach ( Transform n in content.transform ){
			GameObject.Destroy(n.gameObject);
		}

		foreach(int busyoId in myBusyoList){
			GameObject slot = Instantiate (Resources.Load (slotPath)) as GameObject;

			List<string> sakuList = new List<string>();
			sakuList = saku.getSakuInfo (busyoId);
			string sakuPath = "Prefabs/Saku/saku" + sakuList[0];
			GameObject sakuIcon = Instantiate (Resources.Load (sakuPath)) 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);

			slot.GetComponent<Saku>().sakuId = int.Parse(sakuList[0]);
			slot.GetComponent<Saku>().sakuEffect = int.Parse(sakuList[4]);

			if(sakuList[0] == "3"){
				//hukuhei
				//Heisyu
				slot.GetComponent<Saku>().sakuHeisyu = info.getHeisyu(busyoId);
				//Hei Status
				string heiId = "hei" + busyoId.ToString();
				string chParam = PlayerPrefs.GetString(heiId,"0");
				
				char[] delimiterChars = {':'};
				string[] ch_list = chParam.Split(delimiterChars);
				slot.GetComponent<Saku>().sakuHeiSts =  float.Parse (ch_list[3]);
				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";
				}

				GameObject sakuIcon = Instantiate (Resources.Load (nanbanPath)) 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);

				if(i==0){
					slot.GetComponent<Saku>().sakuId = 8;
				}else if(i==1){
					slot.GetComponent<Saku>().sakuId = 9;
				}else if(i==2){
					slot.GetComponent<Saku>().sakuId = 10;
				}

				int temp = i + 1;
				ItemInfo item = new ItemInfo();
				string itemCd = "nanban" + temp.ToString();
				int effect = item.getItemEffect(itemCd);
				slot.GetComponent<Saku>().sakuEffect = effect;


				if(i == 2){
					//teppou youhei
					slot.GetComponent<Saku>().sakuHeisyu = "TP";
					//Hei Status
					string heiId = "hei" + soudaisyo.ToString();
					string chParam = PlayerPrefs.GetString(heiId,"0");
					
					char[] delimiterChars = {':'};
					string[] ch_list = chParam.Split(delimiterChars);
					slot.GetComponent<Saku>().sakuHeiSts =  float.Parse (ch_list[3]);
					slot.GetComponent<Saku>().sakuBusyoId =  soudaisyo;
					
					//Busyo Speed
					int sakuBusyoLv = PlayerPrefs.GetInt(soudaisyo.ToString());
					slot.GetComponent<Saku>().sakuBusyoSpeed = sts.getSpd(soudaisyo,sakuBusyoLv);
				}

			}
		}



		/*エネミー配置*/
		int linkNo = PlayerPrefs.GetInt("activeLink",0);
		enemySoudaisyo = PlayerPrefs.GetInt("enemySoudaisyo");


		if(PlayerPrefs.HasKey("emap1")){
			int mapId = 1;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}
		if(PlayerPrefs.HasKey("emap2")){
			int mapId = 2;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}
		if(PlayerPrefs.HasKey("emap3")){
			int mapId = 3;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}
		if(PlayerPrefs.HasKey("emap4")){
			int mapId = 4;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}
		if(PlayerPrefs.HasKey("emap5")){
			int mapId = 5;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}
		if(PlayerPrefs.HasKey("emap6")){
			int mapId = 6;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}
		if(PlayerPrefs.HasKey("emap7")){
			int mapId = 7;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}
		if(PlayerPrefs.HasKey("emap8")){
			int mapId = 8;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}
		if(PlayerPrefs.HasKey("emap9")){
			int mapId = 9;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}
		if(PlayerPrefs.HasKey("emap10")){
			int mapId = 10;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}
		if(PlayerPrefs.HasKey("emap11")){
			int mapId = 11;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}
		if(PlayerPrefs.HasKey("emap12")){
			int mapId = 12;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}
		if(PlayerPrefs.HasKey("emap13")){
			int mapId = 13;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}
		if(PlayerPrefs.HasKey("emap14")){
			int mapId = 14;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}
		if(PlayerPrefs.HasKey("emap15")){
			int mapId = 15;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}
		if(PlayerPrefs.HasKey("emap16")){
			int mapId = 16;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}
		if(PlayerPrefs.HasKey("emap17")){
			int mapId = 17;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}
		if(PlayerPrefs.HasKey("emap18")){
			int mapId = 18;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}
		if(PlayerPrefs.HasKey("emap19")){
			int mapId = 19;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}
		if(PlayerPrefs.HasKey("emap20")){
			int mapId = 20;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}
		if(PlayerPrefs.HasKey("emap21")){
			int mapId = 21;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}
		if(PlayerPrefs.HasKey("emap22")){
			int mapId = 22;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}
		if(PlayerPrefs.HasKey("emap23")){
			int mapId = 23;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}
		if(PlayerPrefs.HasKey("emap24")){
			int mapId = 24;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}
		if(PlayerPrefs.HasKey("emap25")){
			int mapId = 25;
			getEnemyStsAndMakeInstance(linkNo,mapId, mntMinusRatio, seaMinusRatio, rainMinusRatio, snowMinusRatio);
		}


		/*Dynamic Enemy Setting Finish*/
		//合戦開始エフェクト
		string pathBack = "Prefabs/PreKassen/backGround";
		GameObject back = Instantiate(Resources.Load (pathBack)) as GameObject;
		back.transform.localScale = new Vector2 (30, 15);

		string pathLight = "Prefabs/PreKassen/lightning";
		GameObject light = Instantiate(Resources.Load (pathLight)) as GameObject;
		light.transform.localScale = new Vector2 (10, 10);



	}
Example #3
0
    public void OnClick()
    {
        AudioSource[] audioSources = GameObject.Find("SEController").GetComponents <AudioSource> ();
        audioSources [0].Play();

        /*Scene Change*/
        GameObject.Find("GameScene").GetComponent <SoukoScene> ().currentTab = "DouguScene";

        //button color change
        Color pushedTabColor  = new Color(118f / 255f, 103f / 255f, 16f / 255f, 255f / 255f);
        Color pushedTextColor = new Color(219f / 255f, 219f / 255f, 212f / 255f, 255f / 255f);
        Color normalTabColor  = new Color(255f / 255f, 255f / 255f, 255f / 255f, 255f / 255f);
        Color normalTextColor = new Color(255f / 255f, 255f / 255f, 0f / 255f, 255f / 255f);

        //Clear Color
        GameObject kahou = GameObject.Find("Kahou");
        GameObject dougu = GameObject.Find("Dougu");

        kahou.GetComponent <Image> ().color = normalTabColor;
        dougu.GetComponent <Image> ().color = pushedTabColor;

        kahou.transform.FindChild("Text").GetComponent <Text> ().color = normalTextColor;
        dougu.transform.FindChild("Text").GetComponent <Text> ().color = pushedTextColor;

        /*Initialize Kahou View*/
        GameObject itemView = GameObject.Find("ItemView");

        itemView.transform.FindChild("GetMoney").GetComponent <Image>().enabled = false;
        GameObject sellBtn = GameObject.Find("SellButton");

        sellBtn.GetComponent <Image>().enabled  = false;
        sellBtn.GetComponent <Button>().enabled = false;
        sellBtn.transform.FindChild("Text").GetComponent <Text>().enabled            = false;
        itemView.transform.FindChild("KahouEffectValue").GetComponent <Text> ().text = "";
        itemView.transform.FindChild("KahouEffectLabel").GetComponent <Text> ().text = "";
        GameObject.Find("GetMoneyValue").GetComponent <Text> ().text = "";
        if (Application.systemLanguage != SystemLanguage.Japanese)
        {
            itemView.transform.FindChild("ItemNameValue").GetComponent <Text> ().text = "Select Item";
        }
        else
        {
            itemView.transform.FindChild("ItemNameValue").GetComponent <Text>().text = "道具選択";
        }
        GameObject.Find("Background").GetComponent <Image>().enabled = false;
        GameObject.Find("Fill").GetComponent <Image>().enabled       = false;
        GameObject.Find("Handle").GetComponent <Image>().enabled     = false;
        GameObject.Find("SellQty").GetComponent <Image>().enabled    = false;
        GameObject.Find("SellQtyValue").GetComponent <Text>().text   = "";
        GameObject.Find("DouguExpValue").GetComponent <Text>().text  = "";

        foreach (Transform n in itemView.transform)
        {
            if (n.tag == "Kahou")
            {
                GameObject.Destroy(n.gameObject);
            }
        }
        string     defaultIconPath = "Prefabs/Item/Kahou/NoKabuto";
        GameObject defIcon         = Instantiate(Resources.Load(defaultIconPath)) as GameObject;

        defIcon.transform.SetParent(itemView.transform);
        defIcon.transform.localScale = new Vector2(1, 1);
        RectTransform defTransform = defIcon.GetComponent <RectTransform> ();

        defTransform.anchoredPosition3D          = new Vector3(0, 120, 0);
        defIcon.GetComponent <Button> ().enabled = false;
        defIcon.name = "NoKabuto";

        /*avairable Dougu*/
        //Clear Previous Data
        GameObject content = GameObject.Find("Content");

        foreach (Transform n in content.transform)
        {
            GameObject.Destroy(n.gameObject);
        }

        //Common
        char[] delimiterChars  = { ',' };
        string kanjyoItemPath  = "Prefabs/Item/Kanjyo/Kanjyo";
        string cyouheiItemPath = "Prefabs/Item/Cyouhei/";
        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);

        //1. Kanjyo
        //Ge
        string kanjyoString = PlayerPrefs.GetString("kanjyo");

        string[] kanjyo_list = kanjyoString.Split(delimiterChars);
        int      kanjyoGeQty = int.Parse(kanjyo_list[0]);

        if (kanjyoGeQty != 0)
        {
            GameObject lowKanjyoItem = Instantiate(Resources.Load(kanjyoItemPath)) as GameObject;
            lowKanjyoItem.transform.SetParent(GameObject.Find("Content").transform);
            lowKanjyoItem.transform.localScale         = new Vector2(1, 1);
            lowKanjyoItem.transform.localPosition      = new Vector3(0, 0, 0);
            lowKanjyoItem.GetComponent <Image>().color = lowColor;
            if (Application.systemLanguage != SystemLanguage.Japanese)
            {
                lowKanjyoItem.transform.FindChild("KanjyoRank").GetComponent <Text>().text = "Low";
            }
            else
            {
                lowKanjyoItem.transform.FindChild("KanjyoRank").GetComponent <Text>().text = "下";
            }
            lowKanjyoItem.transform.FindChild("Qty").GetComponent <Text>().text = kanjyoGeQty.ToString();
            lowKanjyoItem.name = "Kanjyo1";
            lowKanjyoItem.GetComponent <Button>().enabled     = true;
            lowKanjyoItem.GetComponent <ItemInfo>().posessQty = kanjyoGeQty;
            RectTransform kanjyoImage = lowKanjyoItem.transform.FindChild("Kanjyo").GetComponent <RectTransform> ();
            kanjyoImage.sizeDelta = new Vector2(140, 140);
        }

        //Cyu
        int kanjyoCyuQty = int.Parse(kanjyo_list[1]);

        if (kanjyoCyuQty != 0)
        {
            GameObject midKanjyoItem = Instantiate(Resources.Load(kanjyoItemPath)) as GameObject;
            midKanjyoItem.transform.SetParent(GameObject.Find("Content").transform);
            midKanjyoItem.transform.localScale         = new Vector2(1, 1);
            midKanjyoItem.transform.localPosition      = new Vector3(0, 0, 0);
            midKanjyoItem.GetComponent <Image>().color = midColor;
            if (Application.systemLanguage != SystemLanguage.Japanese)
            {
                midKanjyoItem.transform.FindChild("KanjyoRank").GetComponent <Text>().text = "Mid";
            }
            else
            {
                midKanjyoItem.transform.FindChild("KanjyoRank").GetComponent <Text>().text = "中";
            }
            midKanjyoItem.transform.FindChild("Qty").GetComponent <Text>().text = kanjyoCyuQty.ToString();
            midKanjyoItem.name = "Kanjyo2";
            midKanjyoItem.GetComponent <Button>().enabled     = true;
            midKanjyoItem.GetComponent <ItemInfo>().posessQty = kanjyoCyuQty;
            RectTransform kanjyoImage = midKanjyoItem.transform.FindChild("Kanjyo").GetComponent <RectTransform> ();
            kanjyoImage.sizeDelta = new Vector2(140, 140);
        }

        //Jyo
        int kanjyoJyoQty = int.Parse(kanjyo_list[2]);

        if (kanjyoJyoQty != 0)
        {
            GameObject jyoKanjyoItem = Instantiate(Resources.Load(kanjyoItemPath)) as GameObject;
            jyoKanjyoItem.transform.SetParent(GameObject.Find("Content").transform);
            jyoKanjyoItem.transform.localScale         = new Vector2(1, 1);
            jyoKanjyoItem.transform.localPosition      = new Vector3(0, 0, 0);
            jyoKanjyoItem.GetComponent <Image>().color = highColor;
            if (Application.systemLanguage != SystemLanguage.Japanese)
            {
                jyoKanjyoItem.transform.FindChild("KanjyoRank").GetComponent <Text>().text = "High";
            }
            else
            {
                jyoKanjyoItem.transform.FindChild("KanjyoRank").GetComponent <Text>().text = "上";
            }
            jyoKanjyoItem.transform.FindChild("Qty").GetComponent <Text>().text = kanjyoJyoQty.ToString();
            jyoKanjyoItem.name = "Kanjyo3";
            jyoKanjyoItem.GetComponent <Button>().enabled     = true;
            jyoKanjyoItem.GetComponent <ItemInfo>().posessQty = kanjyoJyoQty;
            RectTransform kanjyoImage = jyoKanjyoItem.transform.FindChild("Kanjyo").GetComponent <RectTransform> ();
            kanjyoImage.sizeDelta = new Vector2(140, 140);
        }

        //2. Cyouhei
        //cyouheiYR
        //Ge
        string cyouheiYRTmp    = "cyouheiYR";
        string cyouheiYRPath   = cyouheiItemPath + "CyouheiYR";
        string cyouheiYRString = PlayerPrefs.GetString(cyouheiYRTmp);

        string[] cyouheiYR_list = cyouheiYRString.Split(delimiterChars);
        int      cyouheiYRGeQty = int.Parse(cyouheiYR_list[0]);

        if (cyouheiYRGeQty != 0)
        {
            GameObject lowCyouheiYR = Instantiate(Resources.Load(cyouheiYRPath)) as GameObject;
            lowCyouheiYR.transform.SetParent(GameObject.Find("Content").transform);
            lowCyouheiYR.transform.localScale         = new Vector2(1, 1);
            lowCyouheiYR.transform.localPosition      = new Vector3(0, 0, 0);
            lowCyouheiYR.GetComponent <Image>().color = lowColor;
            if (Application.systemLanguage != SystemLanguage.Japanese)
            {
                lowCyouheiYR.transform.FindChild("CyouheiRank").GetComponent <Text>().text = "Low";
            }
            else
            {
                lowCyouheiYR.transform.FindChild("CyouheiRank").GetComponent <Text>().text = "下";
            }
            lowCyouheiYR.transform.FindChild("Qty").GetComponent <Text>().text = cyouheiYRGeQty.ToString();
            lowCyouheiYR.name = "CyouheiYR1";
            lowCyouheiYR.GetComponent <Button>().enabled     = true;
            lowCyouheiYR.GetComponent <ItemInfo>().posessQty = cyouheiYRGeQty;
        }

        //Cyu
        int cyouheiYRCyuQty = int.Parse(cyouheiYR_list[1]);

        if (cyouheiYRCyuQty != 0)
        {
            GameObject midCyouheiYR = Instantiate(Resources.Load(cyouheiYRPath)) as GameObject;
            midCyouheiYR.transform.SetParent(GameObject.Find("Content").transform);
            midCyouheiYR.transform.localScale         = new Vector2(1, 1);
            midCyouheiYR.transform.localPosition      = new Vector3(0, 0, 0);
            midCyouheiYR.GetComponent <Image>().color = midColor;
            if (Application.systemLanguage != SystemLanguage.Japanese)
            {
                midCyouheiYR.transform.FindChild("CyouheiRank").GetComponent <Text>().text = "Mid";
            }
            else
            {
                midCyouheiYR.transform.FindChild("CyouheiRank").GetComponent <Text>().text = "中";
            }
            midCyouheiYR.transform.FindChild("Qty").GetComponent <Text>().text = cyouheiYRCyuQty.ToString();
            midCyouheiYR.name = "CyouheiYR2";
            midCyouheiYR.GetComponent <Button>().enabled     = true;
            midCyouheiYR.GetComponent <ItemInfo>().posessQty = cyouheiYRCyuQty;
        }

        //Jyo
        int cyouheiYRJyoQty = int.Parse(cyouheiYR_list[2]);

        if (cyouheiYRJyoQty != 0)
        {
            GameObject highCyouheiYR = Instantiate(Resources.Load(cyouheiYRPath)) as GameObject;
            highCyouheiYR.transform.SetParent(GameObject.Find("Content").transform);
            highCyouheiYR.transform.localScale         = new Vector2(1, 1);
            highCyouheiYR.transform.localPosition      = new Vector3(0, 0, 0);
            highCyouheiYR.GetComponent <Image>().color = highColor;
            if (Application.systemLanguage != SystemLanguage.Japanese)
            {
                highCyouheiYR.transform.FindChild("CyouheiRank").GetComponent <Text>().text = "High";
            }
            else
            {
                highCyouheiYR.transform.FindChild("CyouheiRank").GetComponent <Text>().text = "上";
            }
            highCyouheiYR.transform.FindChild("Qty").GetComponent <Text>().text = cyouheiYRJyoQty.ToString();
            highCyouheiYR.name = "CyouheiYR3";
            highCyouheiYR.GetComponent <Button>().enabled     = true;
            highCyouheiYR.GetComponent <ItemInfo>().posessQty = cyouheiYRJyoQty;
        }

        //cyouheiKB
        //Ge
        string cyouheiKBTmp    = "cyouheiKB";
        string cyouheiKBPath   = cyouheiItemPath + "CyouheiKB";
        string cyouheiKBString = PlayerPrefs.GetString(cyouheiKBTmp);

        string[] cyouheiKB_list = cyouheiKBString.Split(delimiterChars);
        int      cyouheiKBGeQty = int.Parse(cyouheiKB_list[0]);

        if (cyouheiKBGeQty != 0)
        {
            GameObject lowCyouheiKB = Instantiate(Resources.Load(cyouheiKBPath)) as GameObject;
            lowCyouheiKB.transform.SetParent(GameObject.Find("Content").transform);
            lowCyouheiKB.transform.localScale         = new Vector2(1, 1);
            lowCyouheiKB.transform.localPosition      = new Vector3(0, 0, 0);
            lowCyouheiKB.GetComponent <Image>().color = lowColor;
            if (Application.systemLanguage != SystemLanguage.Japanese)
            {
                lowCyouheiKB.transform.FindChild("CyouheiRank").GetComponent <Text>().text = "Low";
            }
            else
            {
                lowCyouheiKB.transform.FindChild("CyouheiRank").GetComponent <Text>().text = "下";
            }
            lowCyouheiKB.transform.FindChild("Qty").GetComponent <Text>().text = cyouheiKBGeQty.ToString();
            lowCyouheiKB.name = "CyouheiKB1";
            lowCyouheiKB.GetComponent <Button>().enabled     = true;
            lowCyouheiKB.GetComponent <ItemInfo>().posessQty = cyouheiKBGeQty;
        }

        //Cyu
        int cyouheiKBCyuQty = int.Parse(cyouheiKB_list[1]);

        if (cyouheiKBCyuQty != 0)
        {
            GameObject midCyouheiKB = Instantiate(Resources.Load(cyouheiKBPath)) as GameObject;
            midCyouheiKB.transform.SetParent(GameObject.Find("Content").transform);
            midCyouheiKB.transform.localScale         = new Vector2(1, 1);
            midCyouheiKB.transform.localPosition      = new Vector3(0, 0, 0);
            midCyouheiKB.GetComponent <Image>().color = midColor;
            if (Application.systemLanguage != SystemLanguage.Japanese)
            {
                midCyouheiKB.transform.FindChild("CyouheiRank").GetComponent <Text>().text = "Mid";
            }
            else
            {
                midCyouheiKB.transform.FindChild("CyouheiRank").GetComponent <Text>().text = "中";
            }
            midCyouheiKB.transform.FindChild("Qty").GetComponent <Text>().text = cyouheiKBCyuQty.ToString();
            midCyouheiKB.name = "CyouheiKB2";
            midCyouheiKB.GetComponent <Button>().enabled     = true;
            midCyouheiKB.GetComponent <ItemInfo>().posessQty = cyouheiKBCyuQty;
        }

        //Jyo
        int cyouheiKBJyoQty = int.Parse(cyouheiKB_list[2]);

        if (cyouheiKBJyoQty != 0)
        {
            GameObject highCyouheiKB = Instantiate(Resources.Load(cyouheiKBPath)) as GameObject;
            highCyouheiKB.transform.SetParent(GameObject.Find("Content").transform);
            highCyouheiKB.transform.localScale         = new Vector2(1, 1);
            highCyouheiKB.transform.localPosition      = new Vector3(0, 0, 0);
            highCyouheiKB.GetComponent <Image>().color = highColor;
            if (Application.systemLanguage != SystemLanguage.Japanese)
            {
                highCyouheiKB.transform.FindChild("CyouheiRank").GetComponent <Text>().text = "High";
            }
            else
            {
                highCyouheiKB.transform.FindChild("CyouheiRank").GetComponent <Text>().text = "上";
            }
            highCyouheiKB.transform.FindChild("Qty").GetComponent <Text>().text = cyouheiKBJyoQty.ToString();
            highCyouheiKB.name = "CyouheiKB3";
            highCyouheiKB.GetComponent <Button>().enabled     = true;
            highCyouheiKB.GetComponent <ItemInfo>().posessQty = cyouheiKBJyoQty;
        }

        //cyouheiTP
        //Ge
        string cyouheiTPTmp    = "cyouheiTP";
        string cyouheiTPPath   = cyouheiItemPath + "CyouheiTP";
        string cyouheiTPString = PlayerPrefs.GetString(cyouheiTPTmp);

        string[] cyouheiTP_list = cyouheiTPString.Split(delimiterChars);
        int      cyouheiTPGeQty = int.Parse(cyouheiTP_list[0]);

        if (cyouheiTPGeQty != 0)
        {
            GameObject lowCyouheiTP = Instantiate(Resources.Load(cyouheiTPPath)) as GameObject;
            lowCyouheiTP.transform.SetParent(GameObject.Find("Content").transform);
            lowCyouheiTP.transform.localScale         = new Vector2(1, 1);
            lowCyouheiTP.transform.localPosition      = new Vector3(0, 0, 0);
            lowCyouheiTP.GetComponent <Image>().color = lowColor;
            if (Application.systemLanguage != SystemLanguage.Japanese)
            {
                lowCyouheiTP.transform.FindChild("CyouheiRank").GetComponent <Text>().text = "Low";
            }
            else
            {
                lowCyouheiTP.transform.FindChild("CyouheiRank").GetComponent <Text>().text = "下";
            }
            lowCyouheiTP.transform.FindChild("Qty").GetComponent <Text>().text = cyouheiTPGeQty.ToString();
            lowCyouheiTP.name = "CyouheiTP1";
            lowCyouheiTP.GetComponent <Button>().enabled     = true;
            lowCyouheiTP.GetComponent <ItemInfo>().posessQty = cyouheiTPGeQty;
        }

        //Cyu
        int cyouheiTPCyuQty = int.Parse(cyouheiTP_list[1]);

        if (cyouheiTPCyuQty != 0)
        {
            GameObject midCyouheiTP = Instantiate(Resources.Load(cyouheiTPPath)) as GameObject;
            midCyouheiTP.transform.SetParent(GameObject.Find("Content").transform);
            midCyouheiTP.transform.localScale         = new Vector2(1, 1);
            midCyouheiTP.transform.localPosition      = new Vector3(0, 0, 0);
            midCyouheiTP.GetComponent <Image>().color = midColor;
            if (Application.systemLanguage != SystemLanguage.Japanese)
            {
                midCyouheiTP.transform.FindChild("CyouheiRank").GetComponent <Text>().text = "Mid";
            }
            else
            {
                midCyouheiTP.transform.FindChild("CyouheiRank").GetComponent <Text>().text = "中";
            }
            midCyouheiTP.transform.FindChild("Qty").GetComponent <Text>().text = cyouheiTPCyuQty.ToString();
            midCyouheiTP.name = "CyouheiTP2";
            midCyouheiTP.GetComponent <Button>().enabled     = true;
            midCyouheiTP.GetComponent <ItemInfo>().posessQty = cyouheiTPCyuQty;
        }

        //Jyo
        int cyouheiTPJyoQty = int.Parse(cyouheiTP_list[2]);

        if (cyouheiTPJyoQty != 0)
        {
            GameObject highCyouheiTP = Instantiate(Resources.Load(cyouheiTPPath)) as GameObject;
            highCyouheiTP.transform.SetParent(GameObject.Find("Content").transform);
            highCyouheiTP.transform.localScale         = new Vector2(1, 1);
            highCyouheiTP.transform.localPosition      = new Vector3(0, 0, 0);
            highCyouheiTP.GetComponent <Image>().color = highColor;
            if (Application.systemLanguage != SystemLanguage.Japanese)
            {
                highCyouheiTP.transform.FindChild("CyouheiRank").GetComponent <Text>().text = "High";
            }
            else
            {
                highCyouheiTP.transform.FindChild("CyouheiRank").GetComponent <Text>().text = "上";
            }
            highCyouheiTP.transform.FindChild("Qty").GetComponent <Text>().text = cyouheiTPJyoQty.ToString();
            highCyouheiTP.name = "CyouheiTP3";
            highCyouheiTP.GetComponent <Button>().enabled     = true;
            highCyouheiTP.GetComponent <ItemInfo>().posessQty = cyouheiTPJyoQty;
        }

        //cyouheiYM
        //Ge
        string cyouheiYMTmp    = "cyouheiYM";
        string cyouheiYMPath   = cyouheiItemPath + "CyouheiYM";
        string cyouheiYMString = PlayerPrefs.GetString(cyouheiYMTmp);

        string[] cyouheiYM_list = cyouheiYMString.Split(delimiterChars);
        int      cyouheiYMGeQty = int.Parse(cyouheiYM_list[0]);

        if (cyouheiYMGeQty != 0)
        {
            GameObject lowCyouheiYM = Instantiate(Resources.Load(cyouheiYMPath)) as GameObject;
            lowCyouheiYM.transform.SetParent(GameObject.Find("Content").transform);
            lowCyouheiYM.transform.localScale         = new Vector2(1, 1);
            lowCyouheiYM.transform.localPosition      = new Vector3(0, 0, 0);
            lowCyouheiYM.GetComponent <Image>().color = lowColor;
            if (Application.systemLanguage != SystemLanguage.Japanese)
            {
                lowCyouheiYM.transform.FindChild("CyouheiRank").GetComponent <Text>().text = "Low";
            }
            else
            {
                lowCyouheiYM.transform.FindChild("CyouheiRank").GetComponent <Text>().text = "下";
            }
            lowCyouheiYM.transform.FindChild("Qty").GetComponent <Text>().text = cyouheiYMGeQty.ToString();
            lowCyouheiYM.name = "CyouheiYM1";
            lowCyouheiYM.GetComponent <Button>().enabled     = true;
            lowCyouheiYM.GetComponent <ItemInfo>().posessQty = cyouheiYMGeQty;
        }

        //Cyu
        int cyouheiYMCyuQty = int.Parse(cyouheiYM_list[1]);

        if (cyouheiYMCyuQty != 0)
        {
            GameObject midCyouheiYM = Instantiate(Resources.Load(cyouheiYMPath)) as GameObject;
            midCyouheiYM.transform.SetParent(GameObject.Find("Content").transform);
            midCyouheiYM.transform.localScale         = new Vector2(1, 1);
            midCyouheiYM.transform.localPosition      = new Vector3(0, 0, 0);
            midCyouheiYM.GetComponent <Image>().color = midColor;
            if (Application.systemLanguage != SystemLanguage.Japanese)
            {
                midCyouheiYM.transform.FindChild("CyouheiRank").GetComponent <Text>().text = "Mid";
            }
            else
            {
                midCyouheiYM.transform.FindChild("CyouheiRank").GetComponent <Text>().text = "中";
            }
            midCyouheiYM.transform.FindChild("Qty").GetComponent <Text>().text = cyouheiYMCyuQty.ToString();
            midCyouheiYM.name = "CyouheiYM2";
            midCyouheiYM.GetComponent <Button>().enabled     = true;
            midCyouheiYM.GetComponent <ItemInfo>().posessQty = cyouheiYMCyuQty;
        }

        //Jyo
        int cyouheiYMJyoQty = int.Parse(cyouheiYM_list[2]);

        if (cyouheiYMJyoQty != 0)
        {
            GameObject highCyouheiYM = Instantiate(Resources.Load(cyouheiYMPath)) as GameObject;
            highCyouheiYM.transform.SetParent(GameObject.Find("Content").transform);
            highCyouheiYM.transform.localScale         = new Vector2(1, 1);
            highCyouheiYM.transform.localPosition      = new Vector3(0, 0, 0);
            highCyouheiYM.GetComponent <Image>().color = highColor;
            if (Application.systemLanguage != SystemLanguage.Japanese)
            {
                highCyouheiYM.transform.FindChild("CyouheiRank").GetComponent <Text>().text = "High";
            }
            else
            {
                highCyouheiYM.transform.FindChild("CyouheiRank").GetComponent <Text>().text = "上";
            }
            highCyouheiYM.transform.FindChild("Qty").GetComponent <Text>().text = cyouheiYMJyoQty.ToString();
            highCyouheiYM.name = "CyouheiYM3";
            highCyouheiYM.GetComponent <Button>().enabled     = true;
            highCyouheiYM.GetComponent <ItemInfo>().posessQty = cyouheiYMJyoQty;
        }

        //3. Hidensyo
        string hidensyoItemPath = "Prefabs/Item/Hidensyo/Hidensyo";
        //Ge
        int hidensyoGeQty = PlayerPrefs.GetInt("hidensyoGe");

        if (hidensyoGeQty != 0)
        {
            GameObject lowHidensyo = Instantiate(Resources.Load(hidensyoItemPath)) as GameObject;
            lowHidensyo.transform.SetParent(GameObject.Find("Content").transform);
            lowHidensyo.transform.localScale         = new Vector2(1, 1);
            lowHidensyo.transform.localPosition      = new Vector3(0, 0, 0);
            lowHidensyo.GetComponent <Image>().color = lowColor;
            if (Application.systemLanguage != SystemLanguage.Japanese)
            {
                lowHidensyo.transform.FindChild("HidensyoRank").GetComponent <Text>().text = "Low";
            }
            else
            {
                lowHidensyo.transform.FindChild("HidensyoRank").GetComponent <Text>().text = "下";
            }
            lowHidensyo.transform.FindChild("Qty").GetComponent <Text>().text = hidensyoGeQty.ToString();
            lowHidensyo.name = "Hidensyo1";
            lowHidensyo.GetComponent <Button>().enabled     = true;
            lowHidensyo.GetComponent <ItemInfo>().posessQty = hidensyoGeQty;
        }

        //Cyu
        int hidensyoCyuQty = PlayerPrefs.GetInt("hidensyoCyu");

        if (hidensyoCyuQty != 0)
        {
            GameObject midHidensyo = Instantiate(Resources.Load(hidensyoItemPath)) as GameObject;
            midHidensyo.transform.SetParent(GameObject.Find("Content").transform);
            midHidensyo.transform.localScale         = new Vector2(1, 1);
            midHidensyo.transform.localPosition      = new Vector3(0, 0, 0);
            midHidensyo.GetComponent <Image>().color = midColor;
            if (Application.systemLanguage != SystemLanguage.Japanese)
            {
                midHidensyo.transform.FindChild("HidensyoRank").GetComponent <Text>().text = "Mid";
            }
            else
            {
                midHidensyo.transform.FindChild("HidensyoRank").GetComponent <Text>().text = "中";
            }
            midHidensyo.transform.FindChild("Qty").GetComponent <Text>().text = hidensyoCyuQty.ToString();
            midHidensyo.name = "Hidensyo2";
            midHidensyo.GetComponent <Button>().enabled     = true;
            midHidensyo.GetComponent <ItemInfo>().posessQty = hidensyoCyuQty;
        }

        //Jyo
        int hidensyoJyoQty = PlayerPrefs.GetInt("hidensyoJyo");

        if (hidensyoJyoQty != 0)
        {
            GameObject highHidensyo = Instantiate(Resources.Load(hidensyoItemPath)) as GameObject;
            highHidensyo.transform.SetParent(GameObject.Find("Content").transform);
            highHidensyo.transform.localScale         = new Vector2(1, 1);
            highHidensyo.transform.localPosition      = new Vector3(0, 0, 0);
            highHidensyo.GetComponent <Image>().color = highColor;
            if (Application.systemLanguage != SystemLanguage.Japanese)
            {
                highHidensyo.transform.FindChild("HidensyoRank").GetComponent <Text>().text = "High";
            }
            else
            {
                highHidensyo.transform.FindChild("HidensyoRank").GetComponent <Text>().text = "上";
            }
            highHidensyo.transform.FindChild("Qty").GetComponent <Text>().text = hidensyoJyoQty.ToString();
            highHidensyo.name = "Hidensyo3";
            highHidensyo.GetComponent <Button>().enabled     = true;
            highHidensyo.GetComponent <ItemInfo>().posessQty = hidensyoJyoQty;
        }

        //4. Shinobi
        string shinobiItemPath = "Prefabs/Item/Shinobi/Shinobi";
        //Ge
        int shinobiGeQty = PlayerPrefs.GetInt("shinobiGe");

        if (shinobiGeQty != 0)
        {
            GameObject lowShinobi = Instantiate(Resources.Load(shinobiItemPath)) as GameObject;
            lowShinobi.transform.SetParent(GameObject.Find("Content").transform);
            lowShinobi.transform.localScale         = new Vector2(1, 1);
            lowShinobi.transform.localPosition      = new Vector3(0, 0, 0);
            lowShinobi.GetComponent <Image>().color = lowColor;
            if (Application.systemLanguage != SystemLanguage.Japanese)
            {
                lowShinobi.transform.FindChild("ShinobiRank").GetComponent <Text>().text = "Low";
            }
            else
            {
                lowShinobi.transform.FindChild("ShinobiRank").GetComponent <Text>().text = "下";
            }
            lowShinobi.transform.FindChild("Qty").GetComponent <Text>().text = shinobiGeQty.ToString();
            lowShinobi.name = "Shinobi1";
            lowShinobi.GetComponent <Button>().enabled     = true;
            lowShinobi.GetComponent <ItemInfo>().posessQty = shinobiGeQty;
        }

        //Cyu
        int shinobiCyuQty = PlayerPrefs.GetInt("shinobiCyu");

        if (shinobiCyuQty != 0)
        {
            GameObject midShinobi = Instantiate(Resources.Load(shinobiItemPath)) as GameObject;
            midShinobi.transform.SetParent(GameObject.Find("Content").transform);
            midShinobi.transform.localScale         = new Vector2(1, 1);
            midShinobi.transform.localPosition      = new Vector3(0, 0, 0);
            midShinobi.GetComponent <Image>().color = midColor;
            if (Application.systemLanguage != SystemLanguage.Japanese)
            {
                midShinobi.transform.FindChild("ShinobiRank").GetComponent <Text>().text = "Mid";
            }
            else
            {
                midShinobi.transform.FindChild("ShinobiRank").GetComponent <Text>().text = "中";
            }
            midShinobi.transform.FindChild("Qty").GetComponent <Text>().text = shinobiCyuQty.ToString();
            midShinobi.name = "Shinobi2";
            midShinobi.GetComponent <Button>().enabled     = true;
            midShinobi.GetComponent <ItemInfo>().posessQty = shinobiCyuQty;
        }

        //Jyo
        int shinobiJyoQty = PlayerPrefs.GetInt("shinobiJyo");

        if (shinobiJyoQty != 0)
        {
            GameObject highShinobi = Instantiate(Resources.Load(shinobiItemPath)) as GameObject;
            highShinobi.transform.SetParent(GameObject.Find("Content").transform);
            highShinobi.transform.localScale         = new Vector2(1, 1);
            highShinobi.transform.localPosition      = new Vector3(0, 0, 0);
            highShinobi.GetComponent <Image>().color = highColor;
            if (Application.systemLanguage != SystemLanguage.Japanese)
            {
                highShinobi.transform.FindChild("ShinobiRank").GetComponent <Text>().text = "High";
            }
            else
            {
                highShinobi.transform.FindChild("ShinobiRank").GetComponent <Text>().text = "上";
            }
            highShinobi.transform.FindChild("Qty").GetComponent <Text>().text = shinobiJyoQty.ToString();
            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);

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

        //7. Nanban

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

        nanbanList = new List <string> (nanbanString.Split(delimiterChars));

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

            if (qty != "0")
            {
                int    tempNanbanId = i + 1;
                string nanbanPath   = "Prefabs/Item/nanban";
                nanbanPath = nanbanPath + tempNanbanId;
                GameObject nanban = Instantiate(Resources.Load(nanbanPath)) as GameObject;
                nanban.transform.SetParent(GameObject.Find("Content").transform);
                nanban.transform.localScale    = new Vector2(1, 1);
                nanban.transform.localPosition = new Vector3(0, 0, 0);
                nanban.transform.FindChild("Qty").GetComponent <Text>().text = qty.ToString();

                nanban.name = "nanban" + tempNanbanId.ToString();

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

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

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

        //8. Koueki
        showThreeItem("koueki");


        //9. Cyoutei
        showThreeItem("cyoutei");


        //10. Tech
        //TP
        int tpTechQty = PlayerPrefs.GetInt("transferTP");

        if (tpTechQty != 0)
        {
            string     path = "Prefabs/Item/Tech/Tech";
            GameObject tech = Instantiate(Resources.Load(path)) as GameObject;
            tech.transform.SetParent(GameObject.Find("Content").transform);
            tech.transform.localScale    = new Vector2(1, 1);
            tech.transform.localPosition = new Vector3(0, 0, 0);
            tech.name = "tech1";

            //Image
            string spritePath = "Prefabs/Item/Tech/Sprite/tp";
            tech.GetComponent <Image> ().sprite =
                Resources.Load(spritePath, typeof(Sprite)) as Sprite;

            //Qty
            tech.transform.FindChild("Qty").GetComponent <Text>().text = tpTechQty.ToString();
            tech.GetComponent <ItemInfo>().posessQty = tpTechQty;
        }

        //KB
        int kbTechQty = PlayerPrefs.GetInt("transferKB");

        if (kbTechQty != 0)
        {
            string     path = "Prefabs/Item/Tech/Tech";
            GameObject tech = Instantiate(Resources.Load(path)) as GameObject;
            tech.transform.SetParent(GameObject.Find("Content").transform);
            tech.transform.localScale    = new Vector2(1, 1);
            tech.transform.localPosition = new Vector3(0, 0, 0);
            tech.name = "tech2";

            //Image
            string spritePath = "Prefabs/Item/Tech/Sprite/kb";
            tech.GetComponent <Image> ().sprite =
                Resources.Load(spritePath, typeof(Sprite)) as Sprite;

            //Qty
            tech.transform.FindChild("Qty").GetComponent <Text>().text = kbTechQty.ToString();
            tech.GetComponent <ItemInfo>().posessQty = kbTechQty;
        }

        //SNB
        int snbTechQty = PlayerPrefs.GetInt("transferSNB");

        if (snbTechQty != 0)
        {
            string     path = "Prefabs/Item/Tech/Tech";
            GameObject tech = Instantiate(Resources.Load(path)) as GameObject;
            tech.transform.SetParent(GameObject.Find("Content").transform);
            tech.transform.localScale    = new Vector2(1, 1);
            tech.transform.localPosition = new Vector3(0, 0, 0);
            tech.name = "tech3";

            //Image
            string spritePath = "Prefabs/Item/Tech/Sprite/snb";
            tech.GetComponent <Image> ().sprite =
                Resources.Load(spritePath, typeof(Sprite)) as Sprite;

            //Qty
            tech.transform.FindChild("Qty").GetComponent <Text>().text = snbTechQty.ToString();
            tech.GetComponent <ItemInfo>().posessQty = snbTechQty;
        }

        //Meisei
        int meiseiQty = PlayerPrefs.GetInt("meisei");

        if (meiseiQty != 0)
        {
            string     path   = "Prefabs/Item/meisei";
            GameObject meisei = Instantiate(Resources.Load(path)) as GameObject;
            meisei.transform.SetParent(GameObject.Find("Content").transform);
            meisei.transform.localScale    = new Vector2(1, 1);
            meisei.transform.localPosition = new Vector3(0, 0, 0);
            meisei.name = "meisei";

            //Qty
            meisei.transform.FindChild("Qty").GetComponent <Text>().text = meiseiQty.ToString();
            meisei.GetComponent <ItemInfo>().posessQty = meiseiQty;
        }

        //Shiro
        showShiro();
    }