예제 #1
0
        public override void BuildUIContent()
        {
            base.BuildUIContent();
            CloseBtn = TargetGo.transform.Find("BG/CloseBtn").GetComponent <Button>();
            CloseBtn.onClick.AddListener(CloseView);
            LogoutBtn = TargetGo.transform.Find("BG/LogoutBtn").GetComponent <Button>();
            LogoutBtn.onClick.AddListener(OnClickLogout);

            Audio_On = TargetGo.transform.Find("BG/Audio/GameObject/Btn").GetComponent <Button>();
            Audio_On.onClick.AddListener(delegate() { this.OnClickAudioToggle(true); });
            Audio_Off = TargetGo.transform.Find("BG/Audio/GameObject/Btn (1)").GetComponent <Button>();
            Audio_Off.onClick.AddListener(delegate() { this.OnClickAudioToggle(false); });

            Volum_Slider          = TargetGo.transform.Find("BG/Volum/Slider").GetComponent <Slider>();
            Volum_Slider.minValue = 0;
            Volum_Slider.maxValue = 1.0f;
            Volum_Slider.onValueChanged.AddListener(OnChangeVolumn);
            if (PlayerSave.HasKey("ismute"))
            {
                if (PlayerSave.GetInt("ismute") == 0)
                {
                    Audio_On.gameObject.SetActive(false);
                    Audio_Off.gameObject.SetActive(true);
                    MusicManager.Instance.IsMute = false;
                }
                else
                {
                    Audio_On.gameObject.SetActive(true);
                    Audio_Off.gameObject.SetActive(false);

                    MusicManager.Instance.IsMute = true;
                }
            }
        }
예제 #2
0
        public bool DataSet(int id, object a)
        {
            regions = LoadReagionsConfig.Instance.regionsInfo;
            Dropdown.OptionData op0 = new Dropdown.OptionData();
            op0.text = "请选择省份";
            ProvincelList.Add(op0);
            foreach (var province in regions)
            {
                Dropdown.OptionData op = new Dropdown.OptionData();
                op.text = province.Key;
                ProvincelList.Add(op);
            }
            Provincedropdown.AddOptions(ProvincelList);
            OnProvinceChange(0);
            if (PlayerSave.HasKey("province"))
            {
                Provincedropdown.value = PlayerSave.GetInt("province");
            }
            if (PlayerSave.HasKey("city"))
            {
                CityDropDown.value = PlayerSave.GetInt("city");
            }
            if (PlayerSave.HasKey("country"))
            {
                CountryDropDown.value = PlayerSave.GetInt("country");
            }

            if (PlayerSave.HasKey("pinpai"))
            {
                PinPaiDropDown.value = PlayerSave.GetInt("pinpai");
            }
            return(true);
        }
예제 #3
0
파일: GameStarter.cs 프로젝트: rerwr/test
 void MusicSetting()
 {
     if (PlayerSave.HasKey("ismute"))
     {
         if (PlayerSave.GetInt("ismute") == 1)
         {
             MusicManager.Instance.IsMute = true;
         }
         else
         {
             MusicManager.Instance.IsMute = false;
         }
     }
 }