コード例 #1
0
    public ReadMoveCameraConfig(string xmlFilePath)
    {
        ResourceItem xmlfileUnit = ResourcesManager.Instance.loadImmediate(xmlFilePath, ResourceType.ASSET);
        TextAsset    xmlfile     = xmlfileUnit.Asset as TextAsset;

        if (!xmlfile)
        {
            Debug.LogError(" error infos: 没有找到指定的xml文件:" + xmlFilePath);
        }

        xmlDoc = new XmlDocument();
        xmlDoc.LoadXml(xmlfile.text);

        XmlNodeList infoNodeList = xmlDoc.SelectSingleNode("CameraRemotion ").ChildNodes;

        for (int i = 0; i < infoNodeList.Count; i++)     //(XmlNode xNode in infoNodeList)
        {
            if ((infoNodeList[i] as XmlElement).GetAttributeNode("un32MapID") == null)
            {
                continue;
            }

            string tpName = (infoNodeList[i] as XmlElement).GetAttributeNode("un32MapID").InnerText;

            CameraRemotionConfigInfo cameraInfo = new CameraRemotionConfigInfo();
            cameraInfo.un32MapID = Convert.ToInt32(tpName);
            //NpcSelectInfo.NpcId = Convert.ToInt32(typeName);
            foreach (XmlElement xEle in infoNodeList[i].ChildNodes)
            {
                #region 搜索
                switch (xEle.Name)
                {
                case "LeftEdge":
                    cameraInfo.mLeftEdge = GameMethod.ResolveToVector3(xEle.InnerText);
                    break;

                case "RightEdge":
                    cameraInfo.mRightEdge = GameMethod.ResolveToVector3(xEle.InnerText);
                    break;

                case "TopEdge":
                    cameraInfo.mTopEdge = GameMethod.ResolveToVector3(xEle.InnerText);
                    break;

                case "BottomEdge":
                    cameraInfo.mBottomEdge = GameMethod.ResolveToVector3(xEle.InnerText);
                    break;

                case "MovementSpeed":
                    cameraInfo.mMovementSpeed = Convert.ToInt32(xEle.InnerText);
                    break;
                }
                #endregion
            }
            ConfigReader.cameraXmlInfoDict.Add(Convert.ToInt32(tpName), cameraInfo);
        }
    }
コード例 #2
0
    public ReadGuidePopTipTaskConfig(string xmlFilePath)
    {
        //TextAsset xmlfile = Resources.Load(xmlFilePath) as TextAsset;
        ResourceUnit xmlfileUnit = ResourcesManager.Instance.loadImmediate(xmlFilePath, ResourceType.ASSET);
        TextAsset    xmlfile     = xmlfileUnit.Asset as TextAsset;

        if (!xmlfile)
        {
            Debug.LogError(" error infos: 没有找到指定的xml文件:" + xmlFilePath);
        }

        xmlDoc = new XmlDocument();
        xmlDoc.LoadXml(xmlfile.text);

        XmlNodeList infoNodeList = xmlDoc.SelectSingleNode("PopWindow").ChildNodes;

        for (int i = 0; i < infoNodeList.Count; i++)     //(XmlNode xNode in infoNodeList)
        {
            if ((infoNodeList[i] as XmlElement).GetAttributeNode("id") == null)
            {
                continue;
            }

            string typeName = (infoNodeList[i] as XmlElement).GetAttributeNode("id").InnerText;

            PopTipskInfo info = new PopTipskInfo();
            info.TaskId = Convert.ToInt32(typeName);
            foreach (XmlElement xEle in infoNodeList[i].ChildNodes)
            {
                #region 搜索
                switch (xEle.Name)
                {
                case "content":
                    info.mTip = Convert.ToString(xEle.InnerText);
                    break;

                case "site":
                    info.mResPath = Convert.ToString(xEle.InnerText);
                    break;

                case "address":
                    info.mSitePos = GameMethod.ResolveToVector3(xEle.InnerText);
                    break;

                case "rate":
                    info.mRate = GameMethod.ResolveToVector3(xEle.InnerText);
                    break;

                case "mTime":
                    info.mTime = Convert.ToSingle(xEle.InnerText);
                    break;
                }
                #endregion
            }
            ConfigReader.guidePopTipTaskXmlDict.Add(info.TaskId, info);
        }
    }
コード例 #3
0
        public override void EnterTask()
        {
            switch (flashTask.Type)
            {
            case FlashType.FlashAlpha:
                TweenAlpha.Begin(objFlash.gameObject, 0f, Convert.ToInt32(flashTask.StartEffect));
                tween = TweenAlpha.Begin(objFlash, flashTask.During, Convert.ToInt32(flashTask.TargetEffect));
                break;

            case FlashType.FlashMove:
                tween = TweenPosition.Begin(objFlash, flashTask.During, GameMethod.ResolveToVector3(flashTask.TargetEffect, ';'));
                break;

            case FlashType.FlashScale:
                tween = TweenScale.Begin(objFlash, flashTask.During, GameMethod.ResolveToVector3(flashTask.TargetEffect, ';'));
                break;
            }
            tween.method = flashTask.EffectType;
            tween.style  = flashTask.Style;
            if (tween.style == UITweener.Style.Once)
            {
                EventDelegate.Add(tween.onFinished, FlashEnd, true);
            }
        }
コード例 #4
0
    public ReadGuideObstructTaskConfig(string xmlFilePath)
    {
        //TextAsset xmlfile = Resources.Load(xmlFilePath) as TextAsset;
        ResourceItem xmlfileUnit = ResourcesManager.Instance.loadImmediate(xmlFilePath, ResourceType.ASSET);
        TextAsset    xmlfile     = xmlfileUnit.Asset as TextAsset;

        if (!xmlfile)
        {
            Debug.LogError(" error infos: 没有找到指定的xml文件:" + xmlFilePath);
        }

        xmlDoc = new XmlDocument();
        xmlDoc.LoadXml(xmlfile.text);

        XmlNodeList infoNodeList = xmlDoc.SelectSingleNode("obstruct").ChildNodes;

        for (int i = 0; i < infoNodeList.Count; i++)     //(XmlNode xNode in infoNodeList)
        {
            if ((infoNodeList[i] as XmlElement).GetAttributeNode("id") == null)
            {
                continue;
            }

            string typeName = (infoNodeList[i] as XmlElement).GetAttributeNode("id").InnerText;

            CObstructTask obstructInfo = new CObstructTask();
            obstructInfo.TaskId   = Convert.ToInt32(typeName);
            obstructInfo.TaskType = GuideTaskType.ObstructTask;
            Vector3 center = new Vector3();
            Vector3 target = new Vector3();
            foreach (XmlElement xEle in infoNodeList[i].ChildNodes)
            {
                #region 搜索
                switch (xEle.Name)
                {
                case "centerpoint":
                    center = GameMethod.ResolveToVector3(Convert.ToString(xEle.InnerText), ';');
                    break;

                case "targetpoint":
                    target = GameMethod.ResolveToVector3(Convert.ToString(xEle.InnerText), ';');
                    break;

                case "text":
                    obstructInfo.ObsTip = Convert.ToString(xEle.InnerText);
                    break;

                case "time":
                    obstructInfo.ObsShowTime = Convert.ToSingle(xEle.InnerText);
                    break;

                case "path":
                    obstructInfo.ObsPath = Convert.ToString(xEle.InnerText);
                    break;

                case "count":
                    obstructInfo.ObsCount = Convert.ToInt32(xEle.InnerText);
                    break;
                }
                #endregion
            }
            obstructInfo.ObsCenter  = center;
            obstructInfo.ObsDisance = Vector3.Distance(center, target);
            CTaskBase.obstructTaskDic.Add(obstructInfo.TaskId, obstructInfo);
        }
    }
コード例 #5
0
    public ReadMapObjConfig(string xmlFilePath)
    {
        //TextAsset xmlfile = Resources.Load(xmlFilePath) as TextAsset;
        ResourceItem xmlfileUnit = ResourcesManager.Instance.loadImmediate(xmlFilePath, ResourceType.ASSET);
        TextAsset    xmlfile     = xmlfileUnit.Asset as TextAsset;

        if (!xmlfile)
        {
            Debug.LogError(" error infos: 没有找到指定的xml文件:" + xmlFilePath);
        }

        xmlDoc = new XmlDocument();
        xmlDoc.LoadXml(xmlfile.text);

        XmlNodeList infoNodeList = xmlDoc.SelectSingleNode("MapObjCfg ").ChildNodes;

        for (int i = 0; i < infoNodeList.Count; i++)     //(XmlNode xNode in infoNodeList)
        {
            if ((infoNodeList[i] as XmlElement).GetAttributeNode("un32ID") == null)
            {
                continue;
            }

            string tpName = (infoNodeList[i] as XmlElement).GetAttributeNode("un32ID").InnerText;

            MapObjConfigInfo objInfo = new MapObjConfigInfo();
            objInfo.un32Id = Convert.ToInt32(tpName);
            //NpcSelectInfo.NpcId = Convert.ToInt32(typeName);
            foreach (XmlElement xEle in infoNodeList[i].ChildNodes)
            {
                #region 搜索
                switch (xEle.Name)
                {
                case "un32MapID":
                    objInfo.un32MapID = Convert.ToInt32(xEle.InnerText);
                    break;

                case "eObjectTypeID":
                    objInfo.eObjectTypeID = Convert.ToInt32(xEle.InnerText);
                    break;

                case "un32ObjIdx":
                    objInfo.un32ObjIdx = Convert.ToInt32(xEle.InnerText);
                    break;

                case "n32Camp":
                    objInfo.n32Camp = Convert.ToInt32(xEle.InnerText);
                    break;

                //case "cBornPos":
                //    objInfo.cBornPos = GameMethod.ResolveToVector3(xEle.InnerText);
                //    break;
                case "cBornDir":
                    objInfo.cBornDir = GameMethod.ResolveToVector3(xEle.InnerText);
                    break;

                case "ReplaceID":
                    objInfo.ReplaceID = xEle.InnerText;
                    break;

                case "n32Visibility":
                    objInfo.n32Visibility = Convert.ToInt32(xEle.InnerText);
                    break;

                case "eAttackMode":
                    objInfo.eAttackMode = Convert.ToInt32(xEle.InnerText);
                    break;
                }
                #endregion
            }
            ConfigReader.mapObjXmlInfoDict.Add(Convert.ToInt32(tpName), objInfo);
        }
    }
コード例 #6
0
    public ReadGuideFlashTaskConfig(string xmlFilePath)
    {
        //TextAsset xmlfile = Resources.Load(xmlFilePath) as TextAsset;
        ResourceItem xmlfileUnit = ResourcesManager.Instance.loadImmediate(xmlFilePath, ResourceType.ASSET);
        TextAsset    xmlfile     = xmlfileUnit.Asset as TextAsset;

        if (!xmlfile)
        {
            Debug.LogError(" error infos: 没有找到指定的xml文件:" + xmlFilePath);
        }

        xmlDoc = new XmlDocument();
        xmlDoc.LoadXml(xmlfile.text);

        XmlNodeList infoNodeList = xmlDoc.SelectSingleNode("Animine").ChildNodes;

        for (int i = 0; i < infoNodeList.Count; i++)     //(XmlNode xNode in infoNodeList)
        {
            if ((infoNodeList[i] as XmlElement).GetAttributeNode("id") == null)
            {
                continue;
            }

            string typeName = (infoNodeList[i] as XmlElement).GetAttributeNode("id").InnerText;

            CFlashTask flashInfo = new CFlashTask();
            flashInfo.TaskId   = Convert.ToInt32(typeName);
            flashInfo.TaskType = GuideTaskType.ObjFlashTask;
            foreach (XmlElement xEle in infoNodeList[i].ChildNodes)
            {
                #region 搜索
                switch (xEle.Name)
                {
                case "localpath":
                    flashInfo.UiPath = Convert.ToString(xEle.InnerText);
                    break;

                case "pathtype":
                    flashInfo.PathType = (UIPathType)Convert.ToInt32(xEle.InnerText);
                    break;

                case "startpos":
                    flashInfo.StartPos = GameMethod.ResolveToVector3(Convert.ToString(xEle.InnerText), ';');
                    break;

                case "begin":
                    flashInfo.StartEffect = Convert.ToString(xEle.InnerText);
                    break;

                case "objective":
                    flashInfo.TargetEffect = Convert.ToString(xEle.InnerText);
                    break;

                case "frequency":
                    flashInfo.During = Convert.ToSingle(xEle.InnerText);
                    break;

                case "form":
                    flashInfo.EffectType = (UITweener.Method)Convert.ToInt32(xEle.InnerText);
                    break;

                case "style":
                    flashInfo.Style = (UITweener.Style)Convert.ToInt32(xEle.InnerText);
                    break;

                case "animation":
                    flashInfo.Type = (FlashType)Convert.ToInt32(xEle.InnerText);
                    break;

                case "finish":
                    flashInfo.OverReset = Convert.ToInt32(xEle.InnerText);
                    break;

                case "DefaultLocation":
                    flashInfo.PrefabPath = Convert.ToString(xEle.InnerText);
                    break;
                }
                #endregion
            }
            CTaskBase.flashTaskDic.Add(flashInfo.TaskId, flashInfo);
        }
    }
コード例 #7
0
    public ReadGuideTaskConfig(string xmlFilePath)
    {
        //TextAsset xmlfile = Resources.Load(xmlFilePath) as TextAsset;
        ResourceItem xmlfileUnit = ResourcesManager.Instance.loadImmediate(xmlFilePath, ResourceType.ASSET);
        TextAsset    xmlfile     = xmlfileUnit.Asset as TextAsset;

        if (!xmlfile)
        {
            Debug.LogError(" error infos: 没有找到指定的xml文件:" + xmlFilePath);
        }

        xmlDoc = new XmlDocument();
        xmlDoc.LoadXml(xmlfile.text);

        XmlNodeList infoNodeList = xmlDoc.SelectSingleNode("Trigger").ChildNodes;

        for (int i = 0; i < infoNodeList.Count; i++)//XmlNode xNode in infoNodeList)
        {
            if ((infoNodeList[i] as XmlElement).GetAttributeNode("TaskID") == null)
            {
                continue;
            }
            string typeName = (infoNodeList[i] as XmlElement).GetAttributeNode("TaskID").InnerText;

            GuideTaskInfo guideInfo = new GuideTaskInfo();
            guideInfo.TaskId = Convert.ToInt32(typeName);
            foreach (XmlElement xEle in infoNodeList[i].ChildNodes)
            {
                #region 搜索
                switch (xEle.Name)
                {
                case "TaskId":
                    guideInfo.TaskId = Convert.ToInt32(xEle.InnerText);
                    break;

                case "Text":
                    guideInfo.Text = Convert.ToString(xEle.InnerText);
                    break;

                case "PrefabName":
                    guideInfo.PrefabName = Convert.ToString(xEle.InnerText);
                    break;

                case "PosXYZ":
                    guideInfo.PosXYZ = GameMethod.ResolveToVector3(xEle.InnerText);
                    break;

                case "ModelID":
                    guideInfo.ModelID = Convert.ToInt32(xEle.InnerText);
                    break;

                case "IsFinishModel":
                    guideInfo.IsFinishModel = Convert.ToInt32(xEle.InnerText);
                    break;

                case "GuideType":
                    guideInfo.GuideType = Convert.ToInt32(xEle.InnerText);
                    break;

                case "BtnName":
                    guideInfo.BtnName = xEle.InnerText;
                    break;

                case "triggertype":
                    guideInfo.mBtnTriggerType = (ButtonTriggerType)Convert.ToInt32(xEle.InnerText);
                    break;

                case "type":
                    guideInfo.mDragType = (ButtonDragType)Convert.ToInt32(xEle.InnerText);
                    break;

                case "times":
                    guideInfo.mTaskTimes = Convert.ToInt32(xEle.InnerText);
                    break;

                case "Btncoord":
                    guideInfo.mPos = GameMethod.ResolveToVector3(xEle.InnerText);
                    break;

                case "GuideEffect":
                    guideInfo.GuideEffect = xEle.InnerText;
                    break;
                }

                #endregion
            }
            ConfigReader.guideTaskXmlInfoDict.Add(guideInfo.TaskId, guideInfo);
        }
    }
コード例 #8
0
    public ReadMsgSettingConfig(string xmlFilePath)
    {
        //TextAsset xmlfile = Resources.Load(xmlFilePath) as TextAsset;
        ResourceUnit xmlfileUnit = ResourcesManager.Instance.loadImmediate(xmlFilePath, ResourceType.ASSET);
        TextAsset    xmlfile     = xmlfileUnit.Asset as TextAsset;

        if (!xmlfile)
        {
            //Debug.LogError(" error infos: 没有找到指定的xml文件:" + xmlFilePath);
        }

        xmlDoc = new XmlDocument();
        xmlDoc.LoadXml(xmlfile.text);
        XmlNodeList infoNodeList = xmlDoc.SelectSingleNode("MsgSettingConfig ").ChildNodes;

        for (int i = 0; i < infoNodeList.Count; i++)
        {
            if ((infoNodeList[i] as XmlElement).GetAttributeNode("id") == null)
            {
                continue;
            }

            string typeName = (infoNodeList[i] as XmlElement).GetAttributeNode("id").InnerText;
            //Debug.LogError(typeName);
            MsgSettingConfigInfo msgSettingInfo = new MsgSettingConfigInfo();
            msgSettingInfo.id = Convert.ToInt32(typeName);
            #region 搜索
            foreach (XmlElement xEle in infoNodeList[i].ChildNodes)
            {
                switch (xEle.Name)
                {
                case "color":
                {
                    msgSettingInfo.color = GameMethod.ResolveToColor(xEle.InnerText);
                }
                break;

                case "font_size":
                {
                    msgSettingInfo.font_size = Convert.ToInt32(xEle.InnerText);
                }
                break;

                case "effect":
                {
                    msgSettingInfo.font_effect = Convert.ToInt32(xEle.InnerText);
                }
                break;

                case "effect_color":
                {
                    msgSettingInfo.fontEffect_color = GameMethod.ResolveToColor(xEle.InnerText);
                }
                break;

                case "effect_distance":
                {
                    msgSettingInfo.fontEffect_distance = GameMethod.ResolveToVector2(xEle.InnerText);
                }
                break;

                case "position_start_in":
                {
                    msgSettingInfo.position_start_in = GameMethod.ResolveToVector3(xEle.InnerText);
                }
                break;

                case "position_end_in":
                {
                    msgSettingInfo.position_end_in = GameMethod.ResolveToVector3(xEle.InnerText);
                }
                break;

                case "position_time_in":
                    msgSettingInfo.position_time_in = float.Parse(xEle.InnerText, System.Globalization.CultureInfo.InvariantCulture.NumberFormat);
                    break;

                case "position_start_out":
                {
                    msgSettingInfo.position_start_out = GameMethod.ResolveToVector3(xEle.InnerText);
                }
                break;

                case "position_end_out":
                {
                    msgSettingInfo.position_end_out = GameMethod.ResolveToVector3(xEle.InnerText);
                }
                break;

                case "position_time_out":
                    msgSettingInfo.position_time_out = float.Parse(xEle.InnerText, System.Globalization.CultureInfo.InvariantCulture.NumberFormat);
                    break;

                case "rotation_start_in":
                {
                    msgSettingInfo.rotation_start_in = GameMethod.ResolveToVector3(xEle.InnerText);
                }
                break;

                case "rotation_end_in":
                {
                    msgSettingInfo.rotation_end_in = GameMethod.ResolveToVector3(xEle.InnerText);
                }
                break;

                case "rotation_time_in":
                    msgSettingInfo.rotation_time_in = float.Parse(xEle.InnerText);
                    break;

                case "rotation_start_out":
                {
                    msgSettingInfo.rotation_start_out = GameMethod.ResolveToVector3(xEle.InnerText);
                }
                break;

                case "rotation_end_out":
                {
                    msgSettingInfo.rotation_end_out = GameMethod.ResolveToVector3(xEle.InnerText);
                }
                break;

                case "rotation_time_out":
                    msgSettingInfo.rotation_time_out = float.Parse(xEle.InnerText);
                    break;

                case "scale_start_in":
                {
                    msgSettingInfo.scale_start_in = GameMethod.ResolveToVector3(xEle.InnerText);
                }
                break;

                case "scale_end_in":
                {
                    msgSettingInfo.scale_end_in = GameMethod.ResolveToVector3(xEle.InnerText);
                }
                break;

                case "scale_time_in":
                    msgSettingInfo.scale_time_in = float.Parse(xEle.InnerText, System.Globalization.CultureInfo.InvariantCulture.NumberFormat);
                    break;

                case "scale_start_out":
                {
                    msgSettingInfo.scale_start_out = GameMethod.ResolveToVector3(xEle.InnerText);
                }
                break;

                case "scale_end_out":
                {
                    msgSettingInfo.scale_end_out = GameMethod.ResolveToVector3(xEle.InnerText);
                }
                break;

                case "scale_time_out":
                    msgSettingInfo.scale_time_out = float.Parse(xEle.InnerText, System.Globalization.CultureInfo.InvariantCulture.NumberFormat);
                    break;

                case "alpha_start_in":
                {
                    msgSettingInfo.alpha_start_in = float.Parse(xEle.InnerText, System.Globalization.CultureInfo.InvariantCulture.NumberFormat);
                }
                break;

                case "alpha_end_in":
                {
                    msgSettingInfo.alpha_end_in = float.Parse(xEle.InnerText, System.Globalization.CultureInfo.InvariantCulture.NumberFormat);
                }
                break;

                case "alpha_time_in":
                    msgSettingInfo.alpha_time_in = float.Parse(xEle.InnerText, System.Globalization.CultureInfo.InvariantCulture.NumberFormat);
                    break;

                case "alpha_start_out":
                {
                    msgSettingInfo.alpha_start_out = float.Parse(xEle.InnerText, System.Globalization.CultureInfo.InvariantCulture.NumberFormat);
                }
                break;

                case "alpha_end_out":
                {
                    msgSettingInfo.alpha_end_out = float.Parse(xEle.InnerText, System.Globalization.CultureInfo.InvariantCulture.NumberFormat);
                }
                break;

                case "alpha_time_out":
                    msgSettingInfo.alpha_time_out = float.Parse(xEle.InnerText, System.Globalization.CultureInfo.InvariantCulture.NumberFormat);
                    break;

                case "if_frame":
                    msgSettingInfo.if_frame = Convert.ToInt32(xEle.InnerText);
                    break;

                case "staytime":
                    msgSettingInfo.stayTime = Convert.ToInt32(xEle.InnerText);
                    break;
                }
            }
            #endregion
            ConfigReader.msgSettingXmlInfoDic.Add(msgSettingInfo.id, msgSettingInfo);
        }
    }
コード例 #9
0
    public ReadAdvancedGuideConfig(string xmlFilePath)
    {
        //TextAsset xmlfile = Resources.Load(xmlFilePath) as TextAsset;
        ResourceUnit xmlfileUnit = ResourcesManager.Instance.loadImmediate(xmlFilePath, ResourceType.ASSET);
        TextAsset    xmlfile     = xmlfileUnit.Asset as TextAsset;

        if (!xmlfile)
        {
            Debug.LogError(" error infos: 没有找到指定的xml文件:" + xmlFilePath);
        }

        xmlDoc = new XmlDocument();
        xmlDoc.LoadXml(xmlfile.text);

        XmlNodeList infoNodeList = xmlDoc.SelectSingleNode("LowerGuide").ChildNodes;

        for (int i = 0; i < infoNodeList.Count; i++)//(XmlNode xNode in infoNodeList)
        {
            if ((infoNodeList[i] as XmlElement).GetAttributeNode("Taskid") == null)
            {
                continue;
            }

            string typeName = (infoNodeList[i] as XmlElement).GetAttributeNode("Taskid").InnerText;

            AdvancedGuideInfo info = new AdvancedGuideInfo();
            info.Taskid = Convert.ToInt32(typeName);
            foreach (XmlElement xEle in infoNodeList[i].ChildNodes)
            {
                #region 搜索
                switch (xEle.Name)
                {
                case "Title":
                    info.Title = xEle.InnerText;
                    break;

                case "Event":
                    info.Event = (GuideEventType)Convert.ToInt32(xEle.InnerText);
                    break;

                case "EventValue0":
                    info.EventValue0 = GameMethod.ResolveToVector3(xEle.InnerText);
                    break;

                case "EventValue1":
                    info.EventValue1 = GameMethod.ResolveToIntList(xEle.InnerText);
                    break;

                case "EventValue2":
                    info.EventValue2 = Convert.ToInt32(xEle.InnerText);
                    break;

                case "Content":
                    info.Content = xEle.InnerText;
                    break;

                case "CDTime":
                    info.CDTime = float.Parse(xEle.InnerText, System.Globalization.CultureInfo.InvariantCulture.NumberFormat);
                    break;

                case "LimitTime":
                    info.LimitTime = Convert.ToInt32(xEle.InnerText);
                    break;

                case "SmallTitle":
                    info.SmallTitle = xEle.InnerText;
                    break;

                case "PrefabID":
                    info.PrefabID = xEle.InnerText;
                    break;

                case "PicID":
                    info.PicID = xEle.InnerText;
                    break;
                }
                #endregion
            }
            ConfigReader.advancedGuideInfoDict.Add(info.Taskid, info);
        }
    }
コード例 #10
0
    public ReadIGuideTaskConfig(string xmlFilePath)
    {
        //TextAsset xmlfile = Resources.Load(xmlFilePath) as TextAsset;
        ResourceItem xmlfileUnit = ResourcesManager.Instance.loadImmediate(xmlFilePath, ResourceType.ASSET);
        TextAsset    xmlfile     = xmlfileUnit.Asset as TextAsset;

        if (!xmlfile)
        {
            Debug.LogError(" error infos: 没有找到指定的xml文件:" + xmlFilePath);
        }

        xmlDoc = new XmlDocument();
        xmlDoc.LoadXml(xmlfile.text);

        XmlNodeList infoNodeList = xmlDoc.SelectSingleNode("UiTaskEvent").ChildNodes;

        for (int i = 0; i < infoNodeList.Count; i++)//(XmlNode xNode in infoNodeList)
        {
            if ((infoNodeList[i] as XmlElement).GetAttributeNode("id") == null)
            {
                continue;
            }

            string typeName = (infoNodeList[i] as XmlElement).GetAttributeNode("id").InnerText;

            IGuideData taskInfo = new IGuideData();
            taskInfo.TaskId = Convert.ToInt32(typeName);
            foreach (XmlElement xEle in infoNodeList[i].ChildNodes)
            {
                #region 搜索
                switch (xEle.Name)
                {
                case "startEvent":
                    taskInfo.StartTaskEvent = Convert.ToInt32(xEle.InnerText);
                    break;

                case "endEvent":
                    taskInfo.EndTaskEvent = Convert.ToInt32(xEle.InnerText);
                    break;

                case "textpath":
                    taskInfo.TextPath = Convert.ToString(xEle.InnerText);
                    break;

                case "textpos":
                    taskInfo.TextPos = GameMethod.ResolveToVector3(Convert.ToString(xEle.InnerText), ';');
                    break;

                case "content":
                    taskInfo.TextContent = GameMethod.ResolveToStrList(Convert.ToString(xEle.InnerText), ';');
                    break;

                case "shakepath":
                    taskInfo.ShakePath = Convert.ToString(xEle.InnerText);
                    break;

                case "shakepos":
                    taskInfo.ShakePos = GameMethod.ResolveToVector3(Convert.ToString(xEle.InnerText), ';');
                    break;

                case "flashpath":
                    taskInfo.FlashPath = Convert.ToString(xEle.InnerText);
                    break;

                case "flashpos":
                    taskInfo.FlashPos = GameMethod.ResolveToVector3(Convert.ToString(xEle.InnerText), ';');
                    break;

                case "destpos":
                    taskInfo.FlashDstPos = GameMethod.ResolveToVector3(Convert.ToString(xEle.InnerText), ';');
                    break;

                case "isshield":
                    taskInfo.IsMask = (Convert.ToInt32(xEle.InnerText) == 1) ? true : false;
                    break;
                }
                #endregion
            }
            ConfigReader.iGuideDatalXmlInfoDict.Add(taskInfo.TaskId, taskInfo);
        }
    }