Ejemplo n.º 1
0
        /************************************************Unity方法与事件***********************************************/
        protected override void Start()
        {
            base.Start();

            videoPlayer.loopPointReached += (VideoPlayer source) =>
            {
                bMovieEnd = true;
            };

            BuglyUtil.Init();
            videoPlayer.Prepare();
            MissionConifg.LoadMissionConfig();
            propertyConfig.LoadPropertyConfig();
            TaskConifg.LoadTaskData();
            ItemConifg.LoadItemsConfig();
            TreasureBoxConfig.LoadTreasureBoxConfig();
            iconManager.OnlyLoadSelf();
            RoleConifg.LoadRoleConfig();
            LanConfig.LoadLanConfig();
            FontConfig.LoadFontConfig();
            I18NConfig.LoadResConfig();
            AccessoryConfig.LoadAccessoryConfig();
            AwardConfig.LoadAwardConfig();
            ActionConifg.LoadActionConfig();
            LevelConifg.LoadLevelConfig();
            SoundConfig.LoadSoundConfig();
            imageProgress.fillAmount = 0;
            GuLog.Debug("<><Preload>Load Begin!");
            StartCoroutine(StartLoading());
#if CLEAR_DATA
            LocalDataManager.getInstance().deleteAll();
#endif
            mHeartbearActionManager.addEventListener(mUploadFreindHeatbeatAction);
            mHeartbearActionManager.addEventListener(mUploadintakeHeatbeatAction);
            mHeartbeatManager.setHeartbeatListener(() =>
            {
                GuLog.Debug("Preload start do heart beat");
                mHeartbearActionManager.startHeartbeat();
            });
        }
Ejemplo n.º 2
0
    public void ReadConfig()
    {
        if (isLoadFinish == false)
        {
            return;
        }
        isLoadFinish = false;
        lock (LockObject) { GameSystem.Instance.readConfigCnt += 1; }

        Debug.Log("Config reading " + name);
        string text = ResourceLoadManager.Instance.GetConfigText(name);

        if (text == null)
        {
            Debug.LogError("LoadConfig failed: " + name);
            return;
        }
        awardPackConfig.Clear();

        XmlDocument xmlDoc = CommonFunction.LoadXmlConfig(GlobalConst.DIR_XML_AWARDPACK, text);
        //解析xml的过程
        XmlNodeList nodeList = xmlDoc.SelectSingleNode("Data").ChildNodes;

        foreach (XmlElement land in nodeList)
        {
            XmlNode comment = land.SelectSingleNode(GlobalConst.CONFIG_SWITCH_COLUMN);
            if (comment != null && comment.InnerText == GlobalConst.CONFIG_SWITCH)
            {
                continue;
            }
            AwardPackConfig config = new AwardPackConfig();
            AwardConfig     award  = new AwardConfig();
            foreach (XmlElement xel in land)
            {
                if (xel.InnerText == "")
                {
                    continue;
                }

                uint value;
                if (xel.Name == "id")
                {
                    uint.TryParse(xel.InnerText, out value);
                    config.id = value;
                }
                else if (xel.Name.Contains("award_id"))
                {
                    award = new AwardConfig();
                    uint.TryParse(xel.InnerText, out value);
                    award.award_id = value;
                }
                else if (xel.Name.Contains("award_value"))
                {
                    if (xel.InnerText.Contains("-"))
                    {
                        string[] tokens = xel.InnerText.Split('-');
                        award.award_value     = uint.Parse(tokens[0]);
                        award.award_max_value = uint.Parse(tokens[1]);
                    }
                    else
                    {
                        uint.TryParse(xel.InnerText, out value);
                        award.award_value     = value;
                        award.award_max_value = value;
                    }
                    award.award_prob = 10000;
                    config.awards.Add(award);
                }
                else if (xel.Name.Contains("award_prob"))
                {
                    uint prob = 10000;
                    uint.TryParse(xel.InnerText, out prob);
                    award.award_prob = prob;
                }
            }
            awardPackConfig[config.id] = config;
        }
    }