public Upgrades(TowerScr tow) { tower = tow; Upgrade = new Dictionary <string, int[]> //0 - Price resurs 0 { //1 - Price resurs 1 { "Damage", new int[7] }, //2 - Price resurs 2 { "Range", new int[7] }, //3 - Price resurs 3 { "RotationSpeed", new int[7] }, //4 - Price resurs 4 { "SpeedShot", new int[7] }, //5 - Price money { "RangeDamage", new int[7] }, //6 - Level upgrade { "SlowEffect", new int[7] }, // { "ScorchEffect", new int[7] }, // { "PoisonEffect", new int[7] }, // { "PoisonTime", new int[7] } // }; }
public static void LoadObject(int i) { string typ = PlayerPrefs.GetString("Tw" + i + "T"); TowerScr t = null; if (typ == TowerScr.TowerName) { t = Instantiate(Resources.Load("Object/GAME/Towers/Tower1") as GameObject, new Vector3(), new Quaternion()).GetComponent <TowerScr>(); } else if (typ == TowerMageScr.TowerName) { t = Instantiate(Resources.Load("Object/GAME/Towers/FrostMage/TowerMage") as GameObject, new Vector3(), new Quaternion()).GetComponent <TowerScr>(); } else if (typ == TowerFireScr.TowerName) { t = Instantiate(Resources.Load("Object/GAME/Towers/FireMage/TowerFireMage") as GameObject, new Vector3(), new Quaternion()).GetComponent <TowerScr>(); } else if (typ == TowerCoreScr.TowerName) { t = Instantiate(Resources.Load("Object/GAME/Towers/Core/TowerCore") as GameObject, new Vector3(), new Quaternion()).GetComponent <TowerScr>(); } else if (typ == TowerPoisonScr.TowerName) { t = Instantiate(Resources.Load("Object/GAME/Towers/Poison/Tow") as GameObject, new Vector3(), new Quaternion()).GetComponent <TowerScr>(); } t.transform.position = new Vector3(PlayerPrefs.GetFloat("Tw" + i + "Px"), PlayerPrefs.GetFloat("Tw" + i + "Py"), PlayerPrefs.GetFloat("Tw" + i + "Pz")); t.transform.eulerAngles = new Vector3(PlayerPrefs.GetFloat("Tw" + i + "Rx"), PlayerPrefs.GetFloat("Tw" + i + "Ry"), PlayerPrefs.GetFloat("Tw" + i + "Rz")); t.rotationspeed = PlayerPrefs.GetFloat("Tw" + i + "Rs"); t.Range = PlayerPrefs.GetFloat("Tw" + i + "Rn"); t.RangeDamage = PlayerPrefs.GetFloat("Tw" + i + "RD"); t.SlowEffect = PlayerPrefs.GetFloat("Tw" + i + "SlE"); t.ScorchEffect = PlayerPrefs.GetFloat("Tw" + i + "ScE"); t.PoisonEffect = PlayerPrefs.GetFloat("Tw" + i + "PE"); t.PoisonTime = PlayerPrefs.GetFloat("Tw" + i + "PT"); t.Damage = PlayerPrefs.GetFloat("Tw" + i + "Dm"); t.speedshot = PlayerPrefs.GetFloat("Tw" + i + "SS"); t.SpeedTurn = PlayerPrefs.GetFloat("Tw" + i + "ST"); t.SpeedShotStartTime = Time.time + PlayerPrefs.GetFloat("Tw" + i + "SSST"); t.TargetPriority = PlayerPrefs.GetInt("Tw" + i + "TP"); t.UpPriceDamage = PlayerPrefs.GetInt("Tw" + i + "UPD"); t.UpPriceRange = PlayerPrefs.GetInt("Tw" + i + "UPR"); t.UpPriceRangeDamage = PlayerPrefs.GetInt("Tw" + i + "UPRD"); t.UpPriceRotationSpeed = PlayerPrefs.GetInt("Tw" + i + "UPRS"); t.UpPriceSlowEffect = PlayerPrefs.GetInt("Tw" + i + "UPSlE"); t.UpPriceScorchEffect = PlayerPrefs.GetInt("Tw" + i + "UPScE"); t.UpPricePoisonEffect = PlayerPrefs.GetInt("Tw" + i + "UPPE"); t.UpPricePoisonTime = PlayerPrefs.GetInt("Tw" + i + "UPPT"); t.UpPriceSpeedShot = PlayerPrefs.GetInt("Tw" + i + "UPSS"); t.SumPrice = PlayerPrefs.GetInt("Tw" + i + "SmP"); t.DefaultRotationSpeed = PlayerPrefs.GetFloat("Tw" + i + "DRS"); t.DefaultRange = PlayerPrefs.GetFloat("Tw" + i + "DR"); t.DefaultRangeDamage = PlayerPrefs.GetFloat("Tw" + i + "DRD"); t.DefaultSlowEffect = PlayerPrefs.GetFloat("Tw" + i + "DSlE"); t.DefaultScorchEffect = PlayerPrefs.GetFloat("Tw" + i + "DScE"); t.DefaultPoisonEffect = PlayerPrefs.GetFloat("Tw" + i + "DPE"); t.DefaultPoisonTime = PlayerPrefs.GetFloat("Tw" + i + "DPT"); t.DefaultDamage = PlayerPrefs.GetFloat("Tw" + i + "DD"); t.UpgradeList = new Upgrades(t); }