public void GoToLevel(int levelIndex, bool monsterSelection = true) { GameplayController.Instance.CurrentLevelIndex = Mathf.Min(levelIndex, GameplayController.Instance.NumOfLevels - 1); if (!m_bought) { //already bought stored locally - just keep playing if (levelIndex > 7) { PurchaseController purchase_cont = gameObject.GetComponent <PurchaseController> (); bool bought = purchase_cont.InitStates(); if (bought) { PostCheckBuy(levelIndex, monsterSelection); } else { purchase_cont.ShowBuyScreen(true, (bool success) => { if (success) { purchase_cont.ShowBuyScreen(false); PostCheckBuy(levelIndex, monsterSelection); } else { purchase_cont.ShowBuyScreen(false); ShowMapPanel(); } }); } } else { PostCheckBuy(levelIndex, monsterSelection); } } else { PostCheckBuy(levelIndex, monsterSelection); } }