public void getStsAndMakeInstance(int jinkei, int mapId){ String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoId = PlayerPrefs.GetInt(map); string busyoString = busyoId.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet (); int hp = sts.getHp (busyoId, lv); int atk = sts.getAtk (busyoId, lv); int dfc = sts.getDfc (busyoId, lv); int spd = sts.getSpd (busyoId, lv); string busyoName = sts.getBusyoName (busyoId); ArrayList senpouArray = sts.getSenpou (busyoId); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance (); inst.makeInstance (busyoId, mapId, hp, atk, dfc, spd, senpouArray, busyoName); }
public int getStsAndMakeInstance(int jinkei, int mapId, float mntMinusRatio, float seaMinusRatio, float rainMinusRatio, float snowMinusRatio){ String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoId = PlayerPrefs.GetInt(map); string busyoString = busyoId.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet (); int hp = sts.getHp (busyoId, lv); int atk = sts.getAtk (busyoId, lv); int dfc = sts.getDfc (busyoId, lv); int spd = sts.getSpd (busyoId, lv); string busyoName = sts.getBusyoName (busyoId); ArrayList senpouArray = sts.getSenpou (busyoId); //Map & Weather Minus string heisyu = sts.getHeisyu (busyoId); if (mntMinusRatio != 0) { if (heisyu == "KB") { float tmp = (float)spd * mntMinusRatio; if (tmp < 1) { tmp = 1; } spd = Mathf.FloorToInt (tmp); } }else if (seaMinusRatio != 0) { if (heisyu == "TP") { float tmp = (float)dfc * seaMinusRatio; if (tmp < 1) { tmp = 1; } dfc = Mathf.FloorToInt (tmp); }else if (heisyu == "YM") { float tmp = (float)dfc * seaMinusRatio; if (tmp < 1) { tmp = 1; } dfc = Mathf.FloorToInt (tmp); } } if (rainMinusRatio != 0) { if (heisyu == "TP") { float tmp = (float)atk * rainMinusRatio; if (tmp < 1) { tmp = 1; } atk = Mathf.FloorToInt (tmp); }else if (heisyu == "YM") { float tmp = (float)atk * rainMinusRatio; if (tmp < 1) { tmp = 1; } atk = Mathf.FloorToInt (tmp); } }else if(snowMinusRatio != 0) { float tmp = (float)spd * 0.5f; if (tmp < 1) { tmp = 1; } spd = Mathf.FloorToInt (tmp); if (heisyu == "TP") { float tmp2 = (float)atk * snowMinusRatio; if (tmp2 < 1) { tmp2 = 1; } atk = Mathf.FloorToInt (tmp2); }else if (heisyu == "YM") { float tmp2 = (float)atk * snowMinusRatio; if (tmp2 < 1) { tmp2 = 1; } atk = Mathf.FloorToInt (tmp2); }else if (heisyu == "KB") { float tmp2 = (float)dfc * snowMinusRatio; if (tmp2 < 1) { tmp2 = 1; } dfc = Mathf.FloorToInt (tmp2); } } if (busyoId == soudaisyo) { soudaisyoHp = hp; soudaisyoAtk = atk; soudaisyoDfc = dfc; soudaisyoSpd = spd; } int boubi = 0; if (activeStageId == 0) { //Passive boubi = PlayerPrefs.GetInt("activeBoubi", 0); } //View Object & pass status to it. PlayerInstance inst = new PlayerInstance (); inst.makeInstance (busyoId, mapId, hp, atk, dfc, spd, senpouArray, busyoName, soudaisyo, boubi); return busyoId; }
//doramatic charactor // Use this for initialization void Start() { //map生成 Instantiate(mapPrefab); Instantiate(treePrefab); Instantiate(wallPrefab); /*プレイヤー配置*/ //ユーザ陣形データのロード int jinkei =PlayerPrefs.GetInt("jinkei",0); //1.魚麟 if (jinkei == 1) { if(PlayerPrefs.HasKey("1map1")){ int mapId = 1; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("1map2")){ int mapId = 2; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("1map7")){ int mapId = 7; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("1map8")){ int mapId = 8; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("1map11")){ int mapId = 11; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("1map12")){ int mapId = 12; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("1map13")){ int mapId = 13; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("1map14")){ int mapId = 14; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("1map17")){ int mapId = 17; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("1map18")){ int mapId = 18; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("1map21")){ int mapId = 21; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("1map22")){ int mapId = 22; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } //2.鶴翼 }else if(jinkei == 2){ if(PlayerPrefs.HasKey("2map3")){ int mapId = 3; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("2map4")){ int mapId = 4; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("2map5")){ int mapId = 5; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("2map7")){ int mapId = 7; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("2map8")){ int mapId = 8; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("2map11")){ int mapId = 11; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("2map12")){ int mapId = 12; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("2map17")){ int mapId = 17; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("2map18")){ int mapId = 18; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("2map23")){ int mapId = 23; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("2map24")){ int mapId = 24; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("2map25")){ int mapId = 25; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } } //3.偃月 else if(jinkei == 3){ if(PlayerPrefs.HasKey("3map3")){ int mapId = 3; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("3map7")){ int mapId = 7; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("3map8")){ int mapId = 8; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("3map9")){ int mapId = 9; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("3map11")){ int mapId = 11; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("3map12")){ int mapId = 12; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("3map14")){ int mapId = 14; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("3map15")){ int mapId = 15; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("3map16")){ int mapId = 16; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("3map20")){ int mapId = 20; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("3map21")){ int mapId = 21; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("3map25")){ int mapId = 25; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } } //4.雁行 else if(jinkei == 4){ if(PlayerPrefs.HasKey("4map1")){ int mapId = 1; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("4map2")){ int mapId = 2; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("4map7")){ int mapId = 7; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("4map8")){ int mapId = 8; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("4map12")){ int mapId = 12; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("4map13")){ int mapId = 13; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("4map14")){ int mapId = 14; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("4map18")){ int mapId = 18; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("4map19")){ int mapId = 19; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("4map20")){ int mapId = 20; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("4map24")){ int mapId = 24; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } if(PlayerPrefs.HasKey("4map25")){ int mapId = 25; String map = jinkei.ToString() + "map" + mapId; //Get Status int busyoInt = PlayerPrefs.GetInt(map); string busyoString = busyoInt.ToString(); int lv =PlayerPrefs.GetInt(busyoString); StatusGet sts = new StatusGet(); int hp = sts.getHp(busyoInt,lv); int atk = sts.getAtk(busyoInt,lv); int dfc = sts.getDfc(busyoInt,lv); int spd = sts.getSpd(busyoInt,lv); string busyoName = sts.getBusyoName(busyoInt); ArrayList senpouArray = sts.getSenpou(busyoInt); //View Object & pass status to it. PlayerInstance inst = new PlayerInstance(); inst.makeInstance(busyoInt, mapId, hp, atk, dfc, spd, senpouArray, busyoName); } } /*エネミー配置*/ //stageId取得しマスタ判別 int tempStageId = PlayerPrefs.GetInt("activeStageId",0); int kuniId = PlayerPrefs.GetInt("activeKuniId",0); Entity_stage_mst stageMst = Resources.Load ("Data/stage_mst") as Entity_stage_mst; //y=10(X-1)+z-1 int stageId = 10*(kuniId - 1) + tempStageId; int enemyJinkei = stageMst.param[stageId - 1].jinkei; int enemyLv = stageMst.param[stageId - 1].lv; int[] enemyArray = new int[25]; enemyArray[0] = stageMst.param[stageId - 1].map1; enemyArray[1] = stageMst.param[stageId - 1].map2; enemyArray[2] = stageMst.param[stageId - 1].map3; enemyArray[3] = stageMst.param[stageId - 1].map4; enemyArray[4] = stageMst.param[stageId - 1].map5; enemyArray[5] = stageMst.param[stageId - 1].map6; enemyArray[6] = stageMst.param[stageId - 1].map7; enemyArray[7] = stageMst.param[stageId - 1].map8; enemyArray[8] = stageMst.param[stageId - 1].map9; enemyArray[9] = stageMst.param[stageId - 1].map10; enemyArray[10] = stageMst.param[stageId - 1].map11; enemyArray[11] = stageMst.param[stageId - 1].map12; enemyArray[12] = stageMst.param[stageId - 1].map13; enemyArray[13] = stageMst.param[stageId - 1].map14; enemyArray[14] = stageMst.param[stageId - 1].map15; enemyArray[15] = stageMst.param[stageId - 1].map16; enemyArray[16] = stageMst.param[stageId - 1].map17; enemyArray[17] = stageMst.param[stageId - 1].map18; enemyArray[18] = stageMst.param[stageId - 1].map19; enemyArray[19] = stageMst.param[stageId - 1].map20; enemyArray[20] = stageMst.param[stageId - 1].map21; enemyArray[21] = stageMst.param[stageId - 1].map22; enemyArray[22] = stageMst.param[stageId - 1].map23; enemyArray[23] = stageMst.param[stageId - 1].map24; enemyArray[24] = stageMst.param[stageId - 1].map25; int ch_num = stageMst.param[stageId - 1].chQty; int ch_lv = stageMst.param[stageId - 1].lv; for(int i=0; i < enemyArray.Length; i++ ){ if(enemyArray[i] != 0){ int enemyMapId = i+1; int EnemyMap = enemyArray[i]; StatusGet sts = new StatusGet(); int hp = sts.getHp(EnemyMap,enemyLv); int atk = sts.getAtk(EnemyMap,enemyLv); int dfc = sts.getDfc(EnemyMap,enemyLv); int spd = sts.getSpd(EnemyMap,enemyLv); BusyoInfoGet info = new BusyoInfoGet(); String busyoName = info.getName(EnemyMap); String ch_type = info.getHeisyu(EnemyMap); EnemyInstance inst = new EnemyInstance(); inst.makeInstance(enemyMapId, EnemyMap, ch_lv, ch_type, ch_num, hp, atk, dfc, spd, busyoName); } } //HP bar //Instantiate(hpBarPlayerPrefab); //Instantiate(hpBarEnemyPrefab); //合戦開始エフェクト 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); }