public void BackScene()
    {
        SceneCommunication sceneCommunication = new SceneCommunication(CurrentScene);

        sceneCommunication.SendMessage(SceneName.ChoosePlace, data);
        StartCoroutine("LoadScene");
    }
Exemple #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());
    }
Exemple #3
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 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());
     }
 }
    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());
    }
Exemple #6
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());
         }
     }
 }
    // Use this for initialization
    void Start()
    {
        UserSoundConfig config = UserSoundConfig.Load();

        for (int i = 0; i < audioSourcesEffect.Length; i++)
        {
            audioSourcesEffect[i].volume = config.SoundVolume;
            audioSourcesEffect[i].mute   = !config.SoundStatus;
        }

        for (int i = 0; i < audioSourcesMusic.Length; i++)
        {
            audioSourcesMusic[i].volume = config.MusicVolume;
            audioSourcesMusic[i].mute   = !config.MusicStatus;
        }

        SceneCommunication       com        = new SceneCommunication(CurrentScene);
        List <CommunicationData> listOfdata = com.RetrieveMessages();

        if (listOfdata.Count == 0)
        {
            data = "Parbaba";
        }
        else if (listOfdata.Count == 1 && (listOfdata[0].Sender == SceneName.PlayParbaba || listOfdata[0].Sender == SceneName.PlayBatuguru || listOfdata[0].Sender == SceneName.PlayParapat || listOfdata[0].Sender == SceneName.PlayTomok))
        {
            preplayPopUp.Show((StaticLevel)listOfdata[0].Data);
        }
        else
        {
            data = (string)listOfdata[0].Data;
            if (listOfdata[0].Sender == SceneName.PlayParbaba || listOfdata[0].Sender == SceneName.PlayBatuguru || listOfdata[0].Sender == SceneName.PlayParapat || listOfdata[0].Sender == SceneName.PlayTomok)
            {
                levelLastPlayed = (int)listOfdata[1].Data;
            }
        }

        SlideLevel.GetComponent <ScrollRect>().horizontalNormalizedPosition = levelLastPlayed <= 5 ? 0 : levelLastPlayed / 20f;

        string command = "{";

        command += "action:OPEN_CHOOSELEVEL";
        command += ",place:" + data;
        command += "}";
        ServerStatistic.DoRequest(command);
    }
Exemple #8
0
    void Start()
    {
        userScore = UserScoreData.Load();

        UserSoundConfig config = UserSoundConfig.Load();

        for (int i = 0; i < audioSourcesEffect.Length; i++)
        {
            audioSourcesEffect[i].volume = config.SoundVolume;
            audioSourcesEffect[i].mute   = !config.SoundStatus;
        }

        SceneCommunication       sceneCommunication = new SceneCommunication(SceneName.ChoosePlace);
        List <CommunicationData> dataRecieveds      = sceneCommunication.RetrieveMessages();

        if (dataRecieveds.Count > 0 && (dataRecieveds[0].Sender == SceneName.ChooseLevelParbaba || dataRecieveds[0].Sender == SceneName.ChooseLevelBatuguru || dataRecieveds[0].Sender == SceneName.ChooseLevelParapat || dataRecieveds[0].Sender == SceneName.ChooseLevelTomok))
        {
            FirstSelected = (string)dataRecieveds[0].Data;
        }

        if (FirstSelected == "Parbaba")
        {
            PanelItem.GetComponent <RectTransform>().localPosition = new Vector3(715, PanelItem.GetComponent <RectTransform>().localPosition.y, PanelItem.GetComponent <RectTransform>().localPosition.z);
        }
        else if (FirstSelected == "Batuguru")
        {
            PanelItem.GetComponent <RectTransform>().localPosition = new Vector3(276, PanelItem.GetComponent <RectTransform>().localPosition.y, PanelItem.GetComponent <RectTransform>().localPosition.z);
        }
        else if (FirstSelected == "Parapat")
        {
            PanelItem.GetComponent <RectTransform>().localPosition = new Vector3(-227, PanelItem.GetComponent <RectTransform>().localPosition.y, PanelItem.GetComponent <RectTransform>().localPosition.z);
        }
        else if (FirstSelected == "Tomok")
        {
            PanelItem.GetComponent <RectTransform>().localPosition = new Vector3(-673, PanelItem.GetComponent <RectTransform>().localPosition.y, PanelItem.GetComponent <RectTransform>().localPosition.z);
        }

        string command = "{";

        command += "action:OPEN_CHOOSEPLACE";
        command += "}";
        ServerStatistic.DoRequest(command);
    }
    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());
            }
        }
    }
Exemple #10
0
    private void ReadMessage()
    {
        SceneCommunication sceneCommunication = new SceneCommunication(SceneName.LevelEditorCreate);

        dataRecieveds = sceneCommunication.RetrieveMessages();
    }
    private void ReadMessage()
    {
        SceneCommunication sceneCommunication = new SceneCommunication(CurrentScene);

        dataRecieveds = sceneCommunication.RetrieveMessages();
    }