public void Start() { //Debug.LogError ("menumanager Awake"); gemGoldScript = GetComponent <GemGoldScript> (); if (PlayerPrefs.GetInt("FirstTimePlaying") == 0) { SaveLoad.saveload.FirstPlay(); mainGM.OnMainAwake(); PlayerPrefs.SetInt("FirstTimePlaying", 1); SaveLoad.saveload.Save(); } else if (PlayerPrefs.GetInt("FirstTimePlaying") == 1) { gemGoldScript.GemGoldAwake(); mainGM.OnMainAwake(); } // SaveLoad.saveload.FirstPlay (); Hero.hero.InstantiateHero(mainGM.gridEquippedHero); HeroWeapon.heroWeapon.InstantiateHWeapon(mainGM.gridEquippedHWeapon); MagicianWeapon.magicianWeapon.InstantiateMWeapon(mainGM.gridEquippedMWeapon); }
void Start() { inventoryManager = this; gemGoldScript = GetComponent <GemGoldScript> (); gemGoldScript.GemGoldAwake(); gold = gemGoldScript.gold; SetText(); // StartCoroutine (waitForMusic ()); preInven = 1; // if (hWeaponInventoryFront) { // for (int i = 0; i < 21; i++) { // if (i >= 0 && i < 20) { // if (inventory.SlotArray [i].transform.FindChild ("Item(Clone)").GetComponent<Item> ().itemNum == 0) { // emptyHWeaponSlotNum = i; // break; // } // } else if (i == 20) { // emptyHWeaponSlotNum = i; // break; // } // } // } else if (mWeaponInventoryFront) { // for (int i = 0; i < 21; i++) { // if (i >= 0 && i < 20) { // if (inventory.SlotArray [i].transform.FindChild ("Item(Clone)").GetComponent<Item> ().itemNum == 0) { // emptyMWeaponSlotNum = i; // break; // } // } else if (i == 20) { // emptyMWeaponSlotNum = i; // break; // } // } // } //HWeaponFront (); }
public void GemGoldAwake() { gemGoldScript = this; gem = PlayerPrefs.GetInt("Gem"); gold = PlayerPrefs.GetInt("Gold"); }
void Awake() { if (gameMaster == null) { gameMaster = this.GetComponent <GameMaster>(); } gemGoldScript = GetComponent <GemGoldScript> (); gemGoldScript.GemGoldAwake(); allFinished = false; stackModifiable = true; worldNum = PlayerPrefs.GetInt("worldNum"); stageNum = PlayerPrefs.GetInt("stageNum"); weaponMin = PlayerPrefs.GetInt("GridEquippedHWeaponMinDamage"); weaponMax = PlayerPrefs.GetInt("GridEquippedHWeaponMaxDamage"); weaponType = PlayerPrefs.GetInt("GridEquippedHWeaponType"); weaponChance = PlayerPrefs.GetInt("GridEquippedHWeaponChance"); weaponPenetration = PlayerPrefs.GetInt("GridEquippedHWeaponPenetration"); redWeaponValue = PlayerPrefs.GetInt("GridEquippedHWeaponRed"); blueWeaponValue = PlayerPrefs.GetInt("GridEquippedHWeaponBlue"); greenWeaponValue = PlayerPrefs.GetInt("GridEquippedHWeaponGreen"); purpleWeaponValue = PlayerPrefs.GetInt("GridEquippedHWeaponPurple") + PlayerPrefs.GetInt("GridEquippedMWeaponDamage"); yellowWeaponValue = PlayerPrefs.GetInt("GridEquippedHWeaponBrown"); goldText.text = (stageGold * 5).ToString(); SetGoldGaugeBar(0, 1); gridEquippedHWeapon = PlayerPrefs.GetInt("GridEquippedHWeapon"); skillTime = (float)PlayerPrefs.GetInt("GridEquippedHWeaponLegendSkillTime"); coolTime = (float)PlayerPrefs.GetInt("GridEquippedHWeaponLegendCoolTime"); if (gridEquippedHWeapon > 85 && gridEquippedHWeapon != 89 && gridEquippedHWeapon != 94) { legendSkillBackGround.SetActive(true); } if (stageNum != 14) { nextWorldNum = worldNum; nextStageNum = stageNum + 1; } else if (stageNum == 14) { nextWorldNum = worldNum + 1; nextStageNum = 0; } switch (worldNum) { case 1: switch (stageNum) { case 0: if (PlayerPrefs.GetInt("MonsterDictionaryDeminion") == 0) { PlayerPrefs.SetInt("MonsterDictionaryDeminion", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 1); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 1; } break; case 1: if (PlayerPrefs.GetInt("MonsterDictionaryEarthElementaling") == 0) { PlayerPrefs.SetInt("MonsterDictionaryEarthElementaling", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 2); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 2; } break; case 4: if (PlayerPrefs.GetInt("MonsterDictionarySlime") == 0) { PlayerPrefs.SetInt("MonsterDictionarySlime", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 3); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 3; } break; case 9: if (PlayerPrefs.GetInt("MonsterDictionaryNependeath") == 0) { PlayerPrefs.SetInt("MonsterDictionaryNependeath", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 4); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 4; } break; case 14: if (PlayerPrefs.GetInt("MonsterDictionaryEarthElemental") == 0) { PlayerPrefs.SetInt("MonsterDictionaryEarthElemental", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 5); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 5; } break; } break; case 2: switch (stageNum) { case 0: if (PlayerPrefs.GetInt("MonsterDictionarySandeminion") == 0) { PlayerPrefs.SetInt("MonsterDictionarySandeminion", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 6); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 6; } break; case 1: if (PlayerPrefs.GetInt("MonsterDictionaryCrazySand") == 0) { PlayerPrefs.SetInt("MonsterDictionaryCrazySand", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 7); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 7; } break; case 3: if (PlayerPrefs.GetInt("MonsterDictionaryTumbleWeed") == 0) { PlayerPrefs.SetInt("MonsterDictionaryTumbleWeed", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 8); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 8; } break; case 5: if (PlayerPrefs.GetInt("MonsterDictionaryMummy") == 0) { PlayerPrefs.SetInt("MonsterDictionaryMummy", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 9); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 9; } break; case 6: if (PlayerPrefs.GetInt("MonsterDictionaryKing'sBurial") == 0) { PlayerPrefs.SetInt("MonsterDictionaryKing'sBurial", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 10); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 10; } break; case 9: if (PlayerPrefs.GetInt("MonsterDictionaryCamel") == 0) { PlayerPrefs.SetInt("MonsterDictionaryCamel", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 11); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 11; } break; case 14: if (PlayerPrefs.GetInt("MonsterDictionarySandWhale") == 0) { PlayerPrefs.SetInt("MonsterDictionarySandWhale", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 12); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 12; } break; } break; case 3: switch (stageNum) { case 0: if (PlayerPrefs.GetInt("MonsterDictionaryColdeminion") == 0) { PlayerPrefs.SetInt("MonsterDictionaryColdeminion", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 13); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 13; } break; case 1: if (PlayerPrefs.GetInt("MonsterDictionarySnowman") == 0) { PlayerPrefs.SetInt("MonsterDictionarySnowman", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 14); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 14; } break; case 4: if (PlayerPrefs.GetInt("MonsterDictionaryBergbits") == 0) { PlayerPrefs.SetInt("MonsterDictionaryBergbits", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 15); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 15; } break; case 8: if (PlayerPrefs.GetInt("MonsterDictionaryPenguin") == 0) { PlayerPrefs.SetInt("MonsterDictionaryPenguin", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 16); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 16; } break; case 14: if (PlayerPrefs.GetInt("MonsterDictionaryCloudBear") == 0) { PlayerPrefs.SetInt("MonsterDictionaryCloudBear", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 17); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 17; } break; } break; case 4: switch (stageNum) { case 0: if (PlayerPrefs.GetInt("MonsterDictionaryDarkdeminion") == 0) { PlayerPrefs.SetInt("MonsterDictionaryDarkeminion", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 18); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 18; } break; case 1: if (PlayerPrefs.GetInt("MonsterDictionaryAirSlug") == 0) { PlayerPrefs.SetInt("MonsterDictionaryAirSlug", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 19); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 19; } break; case 2: if (PlayerPrefs.GetInt("MonsterDictionaryZlime") == 0) { PlayerPrefs.SetInt("MonsterDictionaryZlime", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 22); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 22; } break; case 4: if (PlayerPrefs.GetInt("MonsterDictionaryMimic") == 0) { PlayerPrefs.SetInt("MonsterDictionaryMimic", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 20); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 20; } break; case 6: if (PlayerPrefs.GetInt("MonsterDictionaryParasuck") == 0) { PlayerPrefs.SetInt("MonsterDictionaryParasuck", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 21); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 21; } break; case 14: if (PlayerPrefs.GetInt("MonsterDictionaryBabyCavian") == 0) { PlayerPrefs.SetInt("MonsterDictionaryBabyCavian", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 23); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 23; } break; } break; case 5: switch (stageNum) { case 0: if (PlayerPrefs.GetInt("MonsterDictionaryWoodeminion") == 0) { PlayerPrefs.SetInt("MonsterDictionaryWoodeminion", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 24); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 24; } break; case 1: if (PlayerPrefs.GetInt("MonsterDictionaryLogger") == 0) { PlayerPrefs.SetInt("MonsterDictionaryLogger", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 25); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 25; } break; case 3: if (PlayerPrefs.GetInt("MonsterDictionaryRaballetia") == 0) { PlayerPrefs.SetInt("MonsterDictionaryRaballetia", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 26); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 26; } break; case 7: if (PlayerPrefs.GetInt("MonsterDictionaryMushBoom") == 0) { PlayerPrefs.SetInt("MonsterDictionaryMushBoom", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 27); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 27; } break; case 14: if (PlayerPrefs.GetInt("MonsterDictionaryAmazonessTree") == 0) { PlayerPrefs.SetInt("MonsterDictionaryAmazonessTree", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 28); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 28; } break; } break; case 6: switch (stageNum) { case 0: if (PlayerPrefs.GetInt("MonsterDictionaryMudeminion") == 0) { PlayerPrefs.SetInt("MonsterDictionaryMudeminion", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 29); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 29; } break; case 1: if (PlayerPrefs.GetInt("MonsterDictionaryPuffer") == 0) { PlayerPrefs.SetInt("MonsterDictionaryPuffer", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 30); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 30; } break; case 3: if (PlayerPrefs.GetInt("MonsterDictionaryDandelion") == 0) { PlayerPrefs.SetInt("MonsterDictionaryDandelion", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 31); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 31; } break; case 4: if (PlayerPrefs.GetInt("MonsterDictionaryDarkMagician") == 0) { PlayerPrefs.SetInt("MonsterDictionaryDarkMagician", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 32); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 32; } break; case 14: if (PlayerPrefs.GetInt("MonsterDictionaryNecro") == 0) { PlayerPrefs.SetInt("MonsterDictionaryNecro", 1); PlayerPrefs.SetInt("MonsterDictionaryMaxMonsNum", 33); monsDic = true; monsterInfo.GetComponent <MonsterInfo> ().curMonsNum = 33; } break; } break; // case 7: // switch (stageNum) { // case 0: // if (PlayerPrefs.GetInt("MonsterDictionary") == 0) { // PlayerPrefs.SetInt ("MonsterDictionary", 1); // PlayerPrefs.SetInt ("MonsterDictionaryMaxMonsNum", ); // monsDic = true; // monsterInfo.GetComponent<MonsterInfo> ().curMonsNum = ; // } // break; // case 0: // if (PlayerPrefs.GetInt("MonsterDictionary") == 0) { // PlayerPrefs.SetInt ("MonsterDictionary", 1); // PlayerPrefs.SetInt ("MonsterDictionaryMaxMonsNum", ); // monsDic = true; // monsterInfo.GetComponent<MonsterInfo> ().curMonsNum = ; // } // break; // case 0: // if (PlayerPrefs.GetInt("MonsterDictionary") == 0) { // PlayerPrefs.SetInt ("MonsterDictionary", 1); // PlayerPrefs.SetInt ("MonsterDictionaryMaxMonsNum", ); // monsDic = true; // monsterInfo.GetComponent<MonsterInfo> ().curMonsNum = ; // } // break; // case 0: // if (PlayerPrefs.GetInt("MonsterDictionary") == 0) { // PlayerPrefs.SetInt ("MonsterDictionary", 1); // PlayerPrefs.SetInt ("MonsterDictionaryMaxMonsNum", ); // monsDic = true; // monsterInfo.GetComponent<MonsterInfo> ().curMonsNum = ; // } // break; // case 0: // if (PlayerPrefs.GetInt("MonsterDictionary") == 0) { // PlayerPrefs.SetInt ("MonsterDictionary", 1); // PlayerPrefs.SetInt ("MonsterDictionaryMaxMonsNum", ); // monsDic = true; // monsterInfo.GetComponent<MonsterInfo> ().curMonsNum = ; // } // break; // } // break; // case 8: // switch (stageNum) { // case 0: // if (PlayerPrefs.GetInt("MonsterDictionary") == 0) { // PlayerPrefs.SetInt ("MonsterDictionary", 1); // PlayerPrefs.SetInt ("MonsterDictionaryMaxMonsNum", ); // monsDic = true; // monsterInfo.GetComponent<MonsterInfo> ().curMonsNum = ; // } // break; // case 0: // if (PlayerPrefs.GetInt("MonsterDictionary") == 0) { // PlayerPrefs.SetInt ("MonsterDictionary", 1); // PlayerPrefs.SetInt ("MonsterDictionaryMaxMonsNum", ); // monsDic = true; // monsterInfo.GetComponent<MonsterInfo> ().curMonsNum = ; // } // break; // case 0: // if (PlayerPrefs.GetInt("MonsterDictionary") == 0) { // PlayerPrefs.SetInt ("MonsterDictionary", 1); // PlayerPrefs.SetInt ("MonsterDictionaryMaxMonsNum", ); // monsDic = true; // monsterInfo.GetComponent<MonsterInfo> ().curMonsNum = ; // } // break; // case 0: // if (PlayerPrefs.GetInt("MonsterDictionary") == 0) { // PlayerPrefs.SetInt ("MonsterDictionary", 1); // PlayerPrefs.SetInt ("MonsterDictionaryMaxMonsNum", ); // monsDic = true; // monsterInfo.GetComponent<MonsterInfo> ().curMonsNum = ; // } // break; // } // break; } }