예제 #1
0
 void Start()
 {
     _ASPText = skillTreeButton.transform.FindChild("ASP/text").GetComponent <MadText>();
     backToMenuButton.onMouseDown += backToMenuButton.onTap = (sprite) => { MadLevel.LoadFirst(); };
     skillTreeButton.onMouseDown  += skillTreeButton.onTap = (sprite) => { MadLevel.LoadLevelByName("Skill Tree"); };
     nextWorld.onMouseDown        += nextWorld.onTap = (sprite) => { setLaboratoryWorld(); };
     previousWorld.onMouseDown    += previousWorld.onTap = (sprite) => { setHauntedHouseWorld(); };
     _ASPText.text = PlayerData.Instance.data.talentPoints.ToString();
 }
예제 #2
0
    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");
        }
    }
예제 #3
0
    // Use this for initialization
    void Start()
    {
        var sprite = GetComponent <MadSprite> ();

        sprite.onTap = sprite.onMouseUp = (s) => MadLevel.LoadLevelByName("main_menu_final");
    }
예제 #4
0
 public void LevelSelectMemory()
 {
     MadLevel.LoadLevelByName("02c_Level_Select_Memory");
 }
예제 #5
0
 public void LevelSelectSpeed()
 {
     MadLevel.LoadLevelByName("02b_Level_Select_Speed");
 }
예제 #6
0
 public void LevelSelectPerception()
 {
     MadLevel.LoadLevelByName("02a_Level_Select_Perception");
 }
 public void restartGame()
 {
     MadLevel.LoadLevelByName(MadLevel.currentLevelName);
     Time.timeScale = 1.0f;
 }
 public void quitGame()
 {
     MadLevel.LoadLevelByName("Main Menu");
     Time.timeScale = 1.0f;
 }
 public void selectLevel()
 {
     MadLevel.LoadLevelByName("Level Select");
 }
예제 #10
0
 public void backToMainMenu()
 {
     MadLevel.LoadLevelByName("Main Menu");
 }
예제 #11
0
    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();
        }
    }
예제 #12
0
 void DoWin()
 {
     MadLevel.LoadLevelByName("Results");
 }
예제 #13
0
 void OnClick()
 {
     MadLevel.LoadLevelByName("Credits");
 }
예제 #14
0
 public void startGame()
 {
     //Application.LoadLevel("_Level Select Scene");
     MadLevel.LoadLevelByName("Level Select");
 }