IEnumerator WaitForAnimation() { yield return(new WaitForSeconds(2.2f)); // animation lasts 2 second if (completed) { // if level is completed go to next level or to 'Level Select' // depends of it this the last level if (MadLevel.HasNext(MadLevel.Type.Level)) { MadLevel.LoadNext(MadLevel.Type.Level); } else { MadLevel.LoadLevelByName("Level Select"); } } else { // if not completed go back to the menu MadLevel.LoadLevelByName("Level Select"); } }
IEnumerator CoGameStart() { if (isShowAd) { AdManager.ShowBannerAd(BannerAdPosition.Bottom, BannerAdSize.SmartBanner); } yield return(null); //레벨 번호 보이고 사라짐 int levelNum = 0; Int32.TryParse(MadLevel.arguments, out levelNum); Debug.Log("arg " + MadLevel.arguments); Debug.Log("levelNum " + levelNum); uiManager.textLevelNum.GetComponent <Text>().text = " - " + levelNum + " - "; uiManager.textLevelNum.SetActive(true); ////////// //ObstacleCtrl 들 시작 if (EventGameStart != null) { EventGameStart(); } ////////////// goalCtrl.trigger.radius = 0.4f; yield return(new WaitForSeconds(0.8f)); yield return(StartCoroutine(goalCtrl.CoGameStart())); yield return(StartCoroutine(playerCtrl.CoGameStart())); if (isShowAd) { AdManager.HideBannerAd(BannerAdNetwork.AdMob); } uiManager.textLevelNum.SetActive(false); //UI 클리어시 이벤트 추가 uiManager.goBtnGameNext.GetComponent <Button>().onClick.AddListener(() => { MadLevel.LoadNext(); }); uiManager.goBtnGameBack.GetComponent <Button>().onClick.AddListener(() => { MadLevel.LoadLevelByName("LevelSelectScreen"); }); uiManager.goBtnGameRestart.GetComponent <Button>().onClick.AddListener(() => { MadLevel.ReloadCurrent(); }); ////////////////// gameState = eGameState.gamePlaying; if (isShowAd) { EasyMobileManager.ShowInterstitialAd(); } }
void OnClick() { MadLevel.LoadNext(MadLevel.Type.Other); }