Ejemplo n.º 1
0
    //小悟空的缘分好了
    public bool WukongJump(MonsterTeam Team)
    {
        bool jump = false;

        if (userMgr.UserConfig.wukongfate == 0)
        {
            Monster monWukong = null;
            foreach (Monster mon in Team.TeamMember)
            {
                if (mon != null && mon.num == Wukong)
                {
                    monWukong = mon;
                    break;
                }
            }

            if (monWukong != null)
            {
                bool allFated = Team.IsAllFataActive(monWukong);

                jump = allFated;
                if (jump)
                {
                    userMgr.UserConfig.wukongfate = 1;
                    userMgr.save();
                }
            }
        }

        return(jump);
    }
Ejemplo n.º 2
0
    //下载漫画
    void OnClickDownLoadIMG()
    {
        UserConfigManager user = Core.Data.usrManager;

        if (user.UserConfig.cartoon == 1)
        {
            user.UserConfig.cartoon = 0;
            checkBox.SetActive(false);
        }
        else
        {
            user.UserConfig.cartoon = 1;
            checkBox.SetActive(true);
        }

        user.save();
    }
Ejemplo n.º 3
0
    /// <summary>
    /// 这个方法只能提供给GameUI或GameBattle场景使用,
    /// </summary>
    public void SwitchSound(bool usedInBattle = false)
    {
        bMute = !bMute;

        uMgr.UserConfig.mute = bMute ? (short)1 : (short)0;
        uMgr.save();
        if (bMute)
        {
            Core.SoundEng.StopChannel(0);
        }
        else
        {
            string    fileName = getBGM(usedInBattle ? SceneBGM.BGM_BATTLE : SceneBGM.BGM_GAMEUI);
            AudioClip clip     = null;
            clip = Core.ResEng.getLoader <SoundLoader>().load(AUDIO_ROOT_PATH + fileName, cached);
            Core.SoundEng.PlayClipForce(clip, AUDIO_BMG, true, 0.8f);
        }
    }
    private void FeatureRight(AssetTask task)
    {
        float size = float.Parse(sourceMgr.getSouceSize(task.AssetBundleName)) / 1024 / 1024;

        m_CurSouceSizes += size;

        UserConfigManager usr = Core.Data.usrManager;

        usr.UserConfig.downCurSize = m_CurSouceSizes;
        usr.save();

        string color = "ffff02";
        string str1  = SetLabelColor(color, (m_CurSouceSizes).ToString("F"));

        SetDownloadSizeLabel(str1 + "/" + m_SouceSizes.ToString("F") + "MB");
        m_DownloadTime = (int)((m_SouceSizes - m_CurSouceSizes) * m_CurDownTime);
        SetDownloadTimeLabel(GetDownloadTime(m_DownloadTime));
        m_Index++;
        curCount++;

        if (m_EventDownloadModel != null)
        {
            m_EventDownloadModel(m_Index);
        }
        else
        {
            m_SLiderTotal.value = curTotalRatio + (1 - curTotalRatio) * curCount * 1.0f / totalCount;
        }



        SouceData data = new SouceData();

        data.FileName = task.AssetBundleName;
        data.Num      = sourceMgr.getNewNum(task.AssetBundleName);
        data.Size     = sourceMgr.getSouceSize(task.AssetBundleName);
        data.isError  = 1;
        sourceMgr.AddDownloadRecordAndSaveToLocaldisk(data);
    }
Ejemplo n.º 5
0
    /// <summary>
    /// 这个方法只能提供给GameUI或GameBattle场景使用,
    /// </summary>
    public void SwitchSound(bool usedInBattle = false)
    {
        bMute = !bMute;

        uMgr.UserConfig.mute = bMute ? (short)1 : (short)0;
        uMgr.save();

        //Debug.LogError(bMute.ToString());

        if (bMute)
        {
            Core.SoundEng.StopChannel(0);
            NGUITools.soundVolume = 0;
        }
        else
        {
            NGUITools.soundVolume = 1f;
            string    fileName = getBGM(usedInBattle ? SceneBGM.BGM_BATTLE : SceneBGM.BGM_GAMEUI);
            AudioClip clip     = null;
            clip = PrefabLoader.loadFromUnPack(AUDIO_ROOT_PATH + fileName, false, cached) as AudioClip;
            Core.SoundEng.PlayClipForce(clip, AUDIO_BMG, true, 0.8f);
        }
    }
    public void Start()
    {
        StringManager strMgr = Core.Data.stringManager;

        sourceMgr = Core.Data.sourceManager;

        m_DownTimeStr = strMgr.getString(90000);        //预计下载时间
        m_HourStr     = strMgr.getString(90001);        //时
        m_MinuteStr   = strMgr.getString(90002);        //分
        m_SecondStr   = strMgr.getString(90003);        //秒
        m_DownloadStr = strMgr.getString(90004);        //下载
        m_StopStr     = strMgr.getString(90005);        //暂停
        m_DownEndStr  = strMgr.getString(90006);        //下载礼包已下载完毕
        //本次需要更新的模型列表
        m_SouceDatas = sourceMgr.GetUpdateModes();

        totalCount = m_SouceDatas.Count;
        curCount   = 0;

        if (m_SouceDatas.Count > 0)
        {
            UserConfigManager usr = Core.Data.usrManager;
            m_SouceSizes = usr.UserConfig.downAllSize;
            ///
            ///  记录下总包的大小,第一次打开这个界面才会赋初始值,
            ///  也就是说这里面保存的一定是 首次所有需要下载的包的大小
            ///
            if (m_SouceSizes <= 0)
            {
                m_SouceSizes = GetSouceSizes(m_SouceDatas);
                m_SouceSizes = m_SouceSizes / 1024 / 1024;
                usr.UserConfig.downAllSize = m_SouceSizes;
                usr.save();
            }

            ///
            /// --- 当前的下载资源的总量,也就是说每次下载成功后都会保存新值 ----
            ///
            m_CurSouceSizes = usr.UserConfig.downCurSize;

            m_DownloadTime = (int)((m_SouceSizes - m_CurSouceSizes) * m_CurDownTime);
            string color = "ffff02";
            string str1  = SetLabelColor(color, m_CurSouceSizes.ToString("F"));
            SetDownloadSizeLabel(str1 + "/" + m_SouceSizes.ToString("F") + "MB");
            SetDownloadTimeLabel(GetDownloadTime(m_DownloadTime));
            m_IsDownload = true;
            m_BtnState   = BtnState.BS_Down;
            SetDownloadLabel(m_DownloadStr);
            m_ReceiveBtn.SetActive(false);

            m_Slider.value      = 0;
            curTotalRatio       = m_CurSouceSizes / m_SouceSizes;
            m_SLiderTotal.value = curTotalRatio;
        }
        else
        {
            m_BtnState          = BtnState.BS_Receive;
            m_Slider.value      = 1;
            m_SLiderTotal.value = 1;

            string color1 = "000000";
            string color2 = "ffff02";
            SetDownloadSizeLabel(SetLabelColor(color2, m_DownEndStr));
            SetDownloadLabel(m_DownloadStr);
            SetDownloadTimeLabel(SetLabelColor(color1, m_DownTimeStr + "0" + m_SecondStr));



            if (Core.Data.playerManager.RTData.downloadReawrd != 1)
            {
                m_ReceiveBtn.SetActive(true);
            }
            else
            {
                m_ReceiveBtn.SetActive(false);
            }
        }

        Spr_Receive.enabled = Core.Data.playerManager.RTData.downloadReawrd == 1;
    }