Exemplo n.º 1
0
 //点击了退出按钮
 private void OnbtnQuit(GameObject go)
 {
     ToolsFunction.Log(this.gameObject, "点击了退出按钮");
     //这里调用保存游戏的分数和时间
     State.KEEP_IDLE = true;
     CloseView();           //关闭当前界面
     OpenView("AwardView"); //打开启动界面
     RecordTb.SaveRecord(); //保存游戏记录
     //保存游戏当中的设置
     XmlReadDoc.SaveSetting(SettingTb.Element[SettingTb.INDEX_MUSIC], SettingTb.Element[SettingTb.INDEX_HINT_TIP], SettingTb.Element[SettingTb.INDEX_SPEED], SettingTb.Element[SettingTb.INDEX_QUALITY]);
     //CMySql.UpdateSetting(SettingTb.Element[SettingTb.INDEX_MUSIC], SettingTb.Element[SettingTb.INDEX_HINT_TIP], SettingTb.Element[SettingTb.INDEX_SPEED], SettingTb.Element[SettingTb.INDEX_QUALITY]);
 }
Exemplo n.º 2
0
        /// <summary>
        /// 关闭设置界面
        /// </summary>
        /// <param name="go"></param>
        private void OnbtnBack(GameObject go)
        {
            //要将设置信息写入数据库啊!!
            //ToolsFunction.Log(this.gameObject, "音乐:" + toggleMusic.value.ToString());
            //ToolsFunction.Log(this.gameObject, "提示:" + toggleMaintip.value.ToString());
            //ToolsFunction.Log(this.gameObject, "速度:" + (int)(sliderSpeed.value * 2));
            //ToolsFunction.Log(this.gameObject, "记录:" + (int)(sliderQuality.value));

            SettingTb.Element[SettingTb.INDEX_MUSIC]    = toggleMusic.value.ToString();
            SettingTb.Element[SettingTb.INDEX_HINT_TIP] = toggleMaintip.value.ToString();
            SettingTb.Element[SettingTb.INDEX_SPEED]    = ((int)(sliderSpeed.value * 2)).ToString();
            SettingTb.Element[SettingTb.INDEX_QUALITY]  = ((int)(sliderQuality.value)).ToString();

            //保存设置信息到数据库
            XmlReadDoc.SaveSetting(SettingTb.Element[SettingTb.INDEX_MUSIC], SettingTb.Element[SettingTb.INDEX_HINT_TIP], SettingTb.Element[SettingTb.INDEX_SPEED], SettingTb.Element[SettingTb.INDEX_QUALITY]);
            //CMySql.UpdateSetting(SettingTb.Element[SettingTb.INDEX_MUSIC], SettingTb.Element[SettingTb.INDEX_HINT_TIP], SettingTb.Element[SettingTb.INDEX_SPEED], SettingTb.Element[SettingTb.INDEX_QUALITY]);
            SetRunRate();
            //关闭界面
            CloseView();
        }