// 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 #2
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);
    }
Exemple #3
0
    private void ReadMessage()
    {
        SceneCommunication sceneCommunication = new SceneCommunication(SceneName.LevelEditorCreate);

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

        dataRecieveds = sceneCommunication.RetrieveMessages();
    }