void Awake() { instance = this; DontDestroyOnLoad(gameObject); if (PlayerPrefs.HasKey("characterIndex")) { //we had a previous session currentCharacterIndex = PlayerPrefs.GetInt("characterIndex", 0); characterAvailability = PlayerPrefs.GetInt("characterAvailability", 1); levelOfCharacterSoldierBoy = PlayerPrefs.GetInt("levelSoldier", 1); powerOfCharacterSoldierBoy = PlayerPrefs.GetInt("powerSoldier", 10); levelOfCharacterCyborg = PlayerPrefs.GetInt("levelCyborg", 1); powerOfCharacterCyborg = PlayerPrefs.GetInt("powerCyborg", 55); levelOfCharacterChan = PlayerPrefs.GetInt("levelChan", 1); powerOfCharacterChan = PlayerPrefs.GetInt("powerChan", 99); CyborgBought = PlayerPrefs.GetInt("cyborgBought", 0); ChanBought = PlayerPrefs.GetInt("chanBought", 0); upgradePriceCoins_Soldier = PlayerPrefs.GetInt("UPGsoldier", 5000); upgradePriceEmeraldRed_Cyborg = PlayerPrefs.GetInt("UPGcyborg", 120); upgradePriceEmeraldRed_Chan = PlayerPrefs.GetInt("UPGchan", 250); } else { Save(); } }
public static void SellStart_Req(InPacket lea, Client c) { string Name = lea.ReadString(40); var chr = c.Character; //if (!(chr.MapX == 1 && chr.MapY == 51) && !(chr.MapX == 1 && chr.MapY == 52) && !(chr.MapX == 1 && chr.MapY == 53) && !(chr.MapX == 1 && chr.MapY == 54) && !(chr.MapX == 1 && chr.MapY == 55)) // return; Map map = MapFactory.GetMap(chr.MapX, chr.MapY); CharacterShop PlayerShop = new CharacterShop(Name); for (int i = 0; i < 12; i++) { int SourceType = lea.ReadShort(); int SourceSlot = lea.ReadShort(); int Quantity = lea.ReadInt(); int Price = lea.ReadInt(); Item Source = chr.Items.getItem((byte)SourceType, (byte)SourceSlot); if (Source != null) { PlayerShop.Add(new ShopData(Source.ItemID, Quantity, SourceType, SourceSlot, (byte)i, Source.Spirit, Source.Level1, Source.Level2, Source.Level3, Source.Level4, Source.Level5, Source.Level6, Source.Level7, Source.Level8, Source.Level9, Source.Level10, Source.Fusion, Source.IsLocked, Source.Icon, Source.Term, Price)); } } chr.Shop = PlayerShop; foreach (Character All in map.Characters) { PlayerShopPacket.SellStart(All.Client, chr, Name); } }
// Use this for initialization void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } }
// Use this for initialization void Start() { script = GameObject.Find("Buttons").GetComponent <CharacterShop>(); }