public void Init() { allBG = new mBG[totalBG]; SetBGData((int)BGMAPS.CASTLE, "BG/BG_Castle", true, 400); SetBGData((int)BGMAPS.FARM, "BG/BG_Farm", true, 750); SetBGData((int)BGMAPS.FOREST, "BG/BG_Forest", true, 900); SetBGData((int)BGMAPS.UNDERWATER, "BG/BG_Underwater", true, 1000); currBG = 0; hasInitOnce = false; currNoofParts = 0; timeToNextPart = 0.0f; partsParent.SetActive(true); }
public void SetCurrBG() { currBG = BGMAPS.CASTLE; if (TutorialScript.Instance.isTutorial) { return; } int randomedNumber = UnityEngine.Random.Range(0, 1000); for (int i = 0; i < totalBG; ++i) { if (randomedNumber < allBG[i].gachaChance) { currBG = (BGMAPS)i; return; } } }