public void BackToMenu()
 {
     BacksoundController.IsActive        = false;
     BacksoundController.DestroyNow      = true;
     BacksoundIntroController.DestroyNow = false;
     if (Mode == GameplayMode.StaticLevel)
     {
         if (CurrentScene == SceneName.PlayParbaba)
         {
             SceneCommunication scom = new SceneCommunication(CurrentScene);
             scom.SendMessage(SceneName.ChooseLevelParbaba, dataStaticLevel.Place);
             scom.SendMessage(SceneName.ChooseLevelParbaba, dataStaticLevel.Level);
             Application.LoadLevel(SceneName.ChooseLevelParbaba.ToString());
         }
         else if (CurrentScene == SceneName.PlayBatuguru)
         {
             SceneCommunication scom = new SceneCommunication(CurrentScene);
             scom.SendMessage(SceneName.ChooseLevelBatuguru, dataStaticLevel.Place);
             scom.SendMessage(SceneName.ChooseLevelBatuguru, dataStaticLevel.Level);
             Application.LoadLevel(SceneName.ChooseLevelBatuguru.ToString());
         }
         else if (CurrentScene == SceneName.PlayParapat)
         {
             SceneCommunication scom = new SceneCommunication(CurrentScene);
             scom.SendMessage(SceneName.ChooseLevelParapat, dataStaticLevel.Place);
             scom.SendMessage(SceneName.ChooseLevelParapat, dataStaticLevel.Level);
             Application.LoadLevel(SceneName.ChooseLevelParapat.ToString());
         }
         else if (CurrentScene == SceneName.PlayTomok)
         {
             SceneCommunication scom = new SceneCommunication(CurrentScene);
             scom.SendMessage(SceneName.ChooseLevelTomok, dataStaticLevel.Place);
             scom.SendMessage(SceneName.ChooseLevelTomok, dataStaticLevel.Level);
             Application.LoadLevel(SceneName.ChooseLevelTomok.ToString());
         }
     }
     else if (Mode == GameplayMode.Edited)
     {
         Application.LoadLevel(SceneName.LevelEditorMenu.ToString());
     }
     else if (Mode == GameplayMode.ValidateLevel)
     {
         Level level             = dataLevel;
         SceneCommunication scom = new SceneCommunication(CurrentScene);
         scom.SendMessage(SceneName.LevelEditorCreate, level);
         scom.SendMessage(SceneName.LevelEditorCreate, ValidationStatus);
         scom.SendMessage(SceneName.LevelEditorCreate, SaveStatus);
         Application.LoadLevel(SceneName.LevelEditorCreate.ToString());
     }
 }
Beispiel #2
0
    public void Play()
    {
        //sceneCommunication sceneCommunication = new SceneCommunication(SceneName.ChooseLevel);
        //sceneCommunication.SendMessage(SceneName.ChoosePlace, dataLevel);
        transisionAnimator.SetTrigger("Close");
        StartCoroutine("LoadScene");

        BacksoundController.IsActive        = false;
        BacksoundController.DestroyNow      = true;
        BacksoundIntroController.DestroyNow = true;
        if (dataLevel.Place == "Parbaba")
        {
            SceneCommunication scom = new SceneCommunication(SceneName.ChooseLevelParbaba);
            scom.SendMessage(SceneName.PlayParbaba, dataLevel);
        }
        else if (dataLevel.Place == "Batuguru")
        {
            SceneCommunication scom = new SceneCommunication(SceneName.ChooseLevelBatuguru);
            scom.SendMessage(SceneName.PlayBatuguru, dataLevel);
        }
        else if (dataLevel.Place == "Parapat")
        {
            SceneCommunication scom = new SceneCommunication(SceneName.ChooseLevelParapat);
            scom.SendMessage(SceneName.PlayParapat, dataLevel);
        }
        else if (dataLevel.Place == "Tomok")
        {
            SceneCommunication scom = new SceneCommunication(SceneName.ChooseLevelTomok);
            scom.SendMessage(SceneName.PlayTomok, dataLevel);
        }
        // Application.LoadLevel(SceneName.Play.ToString());
    }
    public void Replay()
    {
        SceneCommunication scom = new SceneCommunication(CurrentScene);

        if (Mode == GameplayMode.StaticLevel)
        {
            scom.SendMessage(CurrentScene, dataStaticLevel);
        }
        else if (Mode == GameplayMode.ValidateLevel || Mode == GameplayMode.Edited)
        {
            scom.SendMessage(CurrentScene, dataLevel);
        }

        scom.SendMessage(CurrentScene, false);
        Application.LoadLevel(CurrentScene.ToString());
    }
    public void BackScene()
    {
        SceneCommunication sceneCommunication = new SceneCommunication(CurrentScene);

        sceneCommunication.SendMessage(SceneName.ChoosePlace, data);
        StartCoroutine("LoadScene");
    }
Beispiel #5
0
 public void Play()
 {
     if (ParentObject.Rubbish.transform.childCount == 0)
     {
         messagePopupController.Show("Better to add rubbishes, isn't it?");
     }
     else if (ParentObject.Bubble.transform.childCount == 0)
     {
         messagePopupController.Show("Better to add bubble, isn't it?");
     }
     else if (validatedStatus)
     {
         if (Mode == LevelEditorMode.Developer)
         {
             saveLevelPopupController.Show(CreateLevelStatic());
         }
         else
         {
             saveLevelPopupController.Show(CreateLevel());
         }
     }
     else
     {
         Level level             = CreateLevel();
         SceneCommunication scom = new SceneCommunication(SceneName.LevelEditorCreate);
         if (level.Place == "Parbaba")
         {
             scom.SendMessage(SceneName.PlayParbaba, level);
             Application.LoadLevel(SceneName.PlayParbaba.ToString());
         }
         else if (level.Place == "Batuguru")
         {
             scom.SendMessage(SceneName.PlayBatuguru, level);
             Application.LoadLevel(SceneName.PlayBatuguru.ToString());
         }
         else if (level.Place == "Parapat")
         {
             scom.SendMessage(SceneName.PlayParapat, level);
             Application.LoadLevel(SceneName.PlayParapat.ToString());
         }
         else if (level.Place == "Tomok")
         {
             scom.SendMessage(SceneName.PlayTomok, level);
             Application.LoadLevel(SceneName.PlayTomok.ToString());
         }
     }
 }
Beispiel #6
0
    IEnumerator BatuguruScene()
    {
        SceneCommunication com = new SceneCommunication(SceneName.ChoosePlace);

        com.SendMessage(SceneName.ChooseLevelBatuguru, "Batuguru");
        asynOperation = Application.LoadLevelAsync(SceneName.ChooseLevelBatuguru.ToString());
        asynOperation.allowSceneActivation = false;
        yield return(asynOperation);
    }
    public void NextLevel()
    {
        int Level = dataStaticLevel.Level + 1;

        if (Level == 21)
        {
            BackToMenu();
        }
        else
        {
            BacksoundController.IsActive        = false;
            BacksoundController.DestroyNow      = true;
            BacksoundIntroController.DestroyNow = false;
            SceneCommunication scom = new SceneCommunication(CurrentScene);
            //scom.SendMessage(CurrentScene, new StaticLevel(dataStaticLevel.Season, dataStaticLevel.Place, dataStaticLevel.Level + 1));
            if (CurrentScene == SceneName.PlayBatuguru)
            {
                scom.SendMessage(SceneName.ChooseLevelBatuguru, new StaticLevel(dataStaticLevel.Season, dataStaticLevel.Place, dataStaticLevel.Level + 1));
                Application.LoadLevel(SceneName.ChooseLevelBatuguru.ToString());
            }
            else if (CurrentScene == SceneName.PlayTomok)
            {
                scom.SendMessage(SceneName.ChooseLevelTomok, new StaticLevel(dataStaticLevel.Season, dataStaticLevel.Place, dataStaticLevel.Level + 1));
                Application.LoadLevel(SceneName.ChooseLevelTomok.ToString());
            }
            else if (CurrentScene == SceneName.PlayParapat)
            {
                scom.SendMessage(SceneName.ChooseLevelParapat, new StaticLevel(dataStaticLevel.Season, dataStaticLevel.Place, dataStaticLevel.Level + 1));
                Application.LoadLevel(SceneName.ChooseLevelParapat.ToString());
            }
            else if (CurrentScene == SceneName.PlayParbaba)
            {
                scom.SendMessage(SceneName.ChooseLevelParbaba, new StaticLevel(dataStaticLevel.Season, dataStaticLevel.Place, dataStaticLevel.Level + 1));
                Application.LoadLevel(SceneName.ChooseLevelParbaba.ToString());
            }
        }
    }