コード例 #1
0
        public override void ParseConfig(string xml)
        {
            if (string.IsNullOrEmpty(xml))
            {
                Logger.ErrorFormat("vehicle asset config is Empty");
                return;
            }

            var cfg = XmlConfigParser <VehicleAssetConfig> .Load(xml);

            if (null == cfg)
            {
                Logger.ErrorFormat("vehicle asset config is illegal content:{0}", xml);
                return;
            }

            foreach (var item in cfg.Items)
            {
                if (_items.ContainsKey(item.Id))
                {
                    Logger.ErrorFormat("the vehicle asset id has been assigned {0}", item.Id);
                    continue;
                }

                _items[item.Id] = item;
            }
        }
コード例 #2
0
        public override void ParseConfig(string xml)
        {
            if (string.IsNullOrEmpty(xml))
            {
                Logger.ErrorFormat("dynamic prediction error correction config is Empty");
                return;
            }

            var cfg = XmlConfigParser <DynamicPredictionErrorCorrectionConfig> .Load(xml);

            if (null == cfg)
            {
                Logger.ErrorFormat("dynamic prediction error correction config is illegal content:{0}", xml);
                return;
            }

            LinearDeltaThresholdSq  = cfg.LinearDeltaThresholdSq;
            LinearInterpAlpha       = cfg.LinearInterpAlpha;
            LinearRecipFixTime      = cfg.LinearRecipFixTime;
            AngularDeltaThreshold   = cfg.AngularDeltaThreshold;
            AngularInterpAlpha      = cfg.AngularInterpAlpha;
            AngularRecipFixTime     = cfg.AngularRecipFixTime;
            BodySpeedThresholdSq    = cfg.BodySpeedThresholdSq;
            BodyPositionThresholdSq = cfg.BodyPositionThresholdSq;
        }
コード例 #3
0
        public override void ParseConfig(string xml)
        {
            _configs.Clear();
            _transitions.Clear();
            StateTransitionConfig cfg = null;

            try
            {
                cfg = XmlConfigParser <StateTransitionConfig> .Load(xml);
            }
            catch (Exception e)
            {
                Logger.Error("error : " + e.ToString());
            }
            foreach (var item in cfg.Items)
            {
                item.vsTransition = new bool[(int)Transition.Length];

                foreach (var transition in item.Transitions)
                {
                    item.vsTransition[(int)transition] = true;
                }

                _configs[item.State] = item;
            }
            InitTransitions();
        }
コード例 #4
0
        public override void ParseConfig(string xml)
        {
            Data = XmlConfigParser <ScenesIndoorCullData.IndoorCullRecords> .Load(xml);

            Data.ListToDict();
            Data.recordsList.Clear();
        }
コード例 #5
0
        public override void ParseConfig(string xml)
        {
            if (string.IsNullOrEmpty(xml))
            {
                Logger.Error("InputBlockConfig config xml is empty !");
                return;
            }
            _configs.Clear();
            var cfg = XmlConfigParser <InputBlockConfig> .Load(xml);

            if (null == cfg)
            {
                Logger.ErrorFormat("InputBlockConfig config is illegal content : {0}", xml);
                return;
            }

            foreach (InputBlockItem inputBlockItem in cfg.Items)
            {
                if (!_configs.ContainsKey(inputBlockItem.PostureType))
                {
                    _configs.Add(inputBlockItem.PostureType, inputBlockItem);
                }
                else
                {
                    Logger.ErrorFormat("{0} is already in config!!!", inputBlockItem.PostureType);
                }
            }
        }
コード例 #6
0
        public override void ParseConfig(string xml)
        {
            var cfg = XmlConfigParser <ClientEffectCommonConfig> .Load(xml);

            foreach (var item in cfg.Items)
            {
                if (_configs.ContainsKey(item.Type))
                {
                    Logger.ErrorFormat("Duplicate define for type {0}", item.Type);
                }
                _configs[item.Type] = item;

                switch (item.Type)
                {
                case EClientEffectType.BulletDrop:
                    BulletDropServerMaxCount = item.ServerLimit;
                    BulletDropClientMaxCount = item.ClientLimit;
                    BulletDropLifeTime       = item.LifeTime;
                    break;

                case EClientEffectType.DefaultHit:
                    DecayLifeTime = item.LifeTime;
                    break;
                }
            }
        }
コード例 #7
0
        public override void ParseConfig(string xml)
        {
            Data = XmlConfigParser <ScenesLightmapData.MeshRecords> .Load(xml);

            Data.ListToDict();
            Data.recordsList.Clear();
        }
コード例 #8
0
        public override void ParseConfig(string xml)
        {
            var cfg = XmlConfigParser <NewWeaponConfig> .Load(xml);

            foreach (var item in cfg.Items)
            {
                _weaponDic[item.Id] = item;
                switch ((EWeaponSubType)item.SubType)
                {
                case EWeaponSubType.C4:
                    C4Id = item.Id;
                    break;

                case EWeaponSubType.Hand:
                    EmptyHandId = item.Id;
                    break;

                case EWeaponSubType.Melee:
                    switch (item.Id)
                    {
                    case (int)EWeaponIdType.MeleeVariant:
                        MeleeVariant = item.Id;
                        break;
                    }
                    break;
                }
            }
            if (!C4Id.HasValue)
            {
                Logger.Error("config for c4 doesn't exist");
            }
        }
コード例 #9
0
        public override void ParseConfig(string xml)
        {
            var data = XmlConfigParser <AudioWeaponConfig> .Load(xml);

            foreach (var item in data.Items)
            {
                itemsMap[item.Id] = item;
            }
        }
コード例 #10
0
        public override void ParseConfig(string xml)
        {
            _config = XmlConfigParser <RaycastActionConfig> .Load(xml);

            if (null == _config)
            {
                Logger.Error("parse raycastAction config failed !!");
            }
        }
コード例 #11
0
        public override void ParseConfig(string xml)
        {
            var cfg = XmlConfigParser <BulletDropConfig> .Load(xml);

            foreach (var bulletDropConfigItem in cfg.Items)
            {
                _itemDic[bulletDropConfigItem.Type] = bulletDropConfigItem;
            }
        }
コード例 #12
0
        public override void ParseConfig(string xml)
        {
            var cfg = XmlConfigParser <ClientEffectCommonConfig> .Load(xml);

            foreach (var item in cfg.Items)
            {
                _configs[item.Type] = item;
            }
        }
コード例 #13
0
        public override void ParseConfig(string xml)
        {
            _configs = XmlConfigParser <WeaponConfigs> .Load(xml);

            foreach (var item in _configs.Weapons)
            {
                _configCache[item.Id] = new WeaponAllConfigs(item);
            }
        }
コード例 #14
0
        public override void ParseConfig(string xml)
        {
            var cfg = XmlConfigParser <WeaponPartsConfig> .Load(xml);

            foreach (var item in cfg.Items)
            {
                partItems[item.Id] = item;
            }
        }
コード例 #15
0
 public override void ParseConfig(string xml)
 {
     try
     {
         MapConfigPoints.current = XmlConfigParser <MapConfigPoints> .Load(xml);
     }catch (Exception e)
     {
         Debug.LogErrorFormat("load map position failed.{0}", e.Message);
     }
 }
コード例 #16
0
        public override void ParseConfig(string xml)
        {
            if (Data == null)
            {
                Data = new MeshRecords();
            }
            MeshRecordsWrapper warpper = XmlConfigParser <MeshRecordsWrapper> .Load(xml);

            Data.recordsList.AddRange(warpper.meshRecords.recordsList);
        }
コード例 #17
0
        public override void ParseConfig(string xml)
        {
            var cfg = XmlConfigParser <ClipDropConfig> .Load(xml);

            _config = cfg;
            foreach (var item in cfg.Items)
            {
                _configDic[item.Id] = item;
            }
        }
コード例 #18
0
        public T Convert(Object obj, AssetInfo assetInfo)
        {
            if (obj is TextAsset && obj != null)
            {
                TextAsset text = obj as TextAsset;
                return(XmlConfigParser <T> .Load(text.text));
            }

            throw new ArgumentException(string.Format("{0} is not Texture2D {1}", assetInfo, obj));
        }
コード例 #19
0
        public override void ParseConfig(string xml)
        {
            XMLContent = xml;
            _config    = XmlConfigParser <CameraConfig> .Load(xml);

            foreach (var config in _config.ConfigItems)
            {
                HandleConfigItem(config);
            }
            _config.RecordConfigs();
        }
コード例 #20
0
 public override void ParseConfig(string xml)
 {
     try
     {
         Data = XmlConfigParser <IndoorCullRecordsWrapper> .Load(xml);
     }
     catch (Exception e)
     {
         UnityEngine.Debug.LogError(e);
     }
 }
コード例 #21
0
        public override void ParseConfig(string xml)
        {
            AudioEventConfig data = XmlConfigParser <AudioEventConfig> .Load(xml);

            foreach (var item in data.Items)
            {
                itemsMap[item.Id] = item;
#if UNITY_EDITOR
                nameItemsMap[item.Event] = item;
#endif
            }
        }
コード例 #22
0
        public override void ParseConfig(string xml)
        {
            try
            {
                DropPoolConfig.current = XmlConfigParser <DropPoolConfig> .Load(xml);

                Logger.Info("load DropPool succeeded.");
            }catch (Exception e)
            {
                Debug.LogErrorFormat("load DropPool failed.{0}", e.Message);
            }
        }
コード例 #23
0
        public override void ParseConfig(string xml)
        {
            _configs.Clear();
            _transitions.Clear();
            var cfg = XmlConfigParser <StateTransitionConfig> .Load(xml);

            foreach (var item in cfg.Items)
            {
                _configs[item.State] = item;
            }
            InitTransitions();
        }
コード例 #24
0
        public override void ParseConfig(string xml)
        {
            _typeDic.Clear();
            _configs.Clear();
            var cfg = XmlConfigParser <ClientEffectConfig> .Load(xml);

            foreach (var item in cfg.Items)
            {
                _typeDic[item.Type] = item;
                _configs[item.Id]   = item;
            }
        }
コード例 #25
0
        public override void ParseConfig(string xml)
        {
            XMLContent = xml;
            _config    = XmlConfigParser <CameraConfig> .Load(xml);

            _config.PoseConfigs = _config.PoseConfigs.OrderBy(var => var.CameraType).ToArray();

            foreach (var cameraConfigItem in _config.PoseConfigs)
            {
                _cameraConfigItems[cameraConfigItem.CameraType] = cameraConfigItem;
                if (cameraConfigItem.Far < 100)
                {
                    switch (cameraConfigItem.CameraType)
                    {
                    case ECameraPoseMode.Stand:
                    case ECameraPoseMode.DriveCar:
                    case ECameraPoseMode.Prone:
                    case ECameraPoseMode.Crouch:
                    case ECameraPoseMode.Swim:
                    case ECameraPoseMode.Rescue:
                    case ECameraPoseMode.Dying:
                    case ECameraPoseMode.Dead:
                        cameraConfigItem.Far = 1500;
                        break;

                    case ECameraPoseMode.AirPlane:
                    case ECameraPoseMode.Parachuting:
                    case ECameraPoseMode.ParachutingOpen:
                    case ECameraPoseMode.Gliding:
                        cameraConfigItem.Far = 8000;
                        break;

                    default:
                        throw new ArgumentOutOfRangeException();
                    }
                }
                if (Math.Abs(cameraConfigItem.Near) < 0.00001)
                {
                    cameraConfigItem.Near = 0.03f;
                }
            }

            if (_config.ObserveConfig == null)
            {
                _config.ObserveConfig                 = new ObserveCameraConfig();
                _config.ObserveConfig.Offset          = new Vector3(0, 1, 0);
                _config.ObserveConfig.ObserveDistance = 2;
            }

            DefaultTranstionTime = _config.DefaultTransitionTime;
            PostTransitionTime   = _config.PostTransitionTime;
        }
コード例 #26
0
        protected override void OnLoadSuccImpl(AssetInfo assetInfo, Object obj)
        {
            var asset = obj as TextAsset;

            if (null != asset)
            {
                var config = XmlConfigParser <SerializableCurve> .Load(asset.text);

                SingletonManager.Get <CharacterStateConfigManager>().AirMoveCurve = config.toCurve();
            }

            ForceExit();
        }
コード例 #27
0
        public override void ParseConfig(string xml)
        {
            _config = XmlConfigParser <WeaponUpdateConfig> .Load(xml);

            if (null == _config)
            {
                Logger.Error("invalid xml content");
                return;
            }
            foreach (var item in _config.Items)
            {
                _configs[item.Tid] = item;
            }
        }
コード例 #28
0
        public override void ParseConfig(string xml)
        {
            var config = XmlConfigParser <WeaponPartSurvivalConfig> .Load(xml);

            if (null == config)
            {
                Logger.Error("weapon part survival config is null !!");
                return;
            }
            foreach (var item in config.Items)
            {
                _configDic[item.Id] = item;
            }
        }
コード例 #29
0
        public override void ParseConfig(string xml)
        {
            _config = XmlConfigParser <GameRuleConfig> .Load(xml);

            if (null == _config)
            {
                Logger.Error("invalid xml content");
                return;
            }
            foreach (var item in _config.Items)
            {
                _configCache[item.Id] = item;
            }
        }
コード例 #30
0
        public override void ParseConfig(string xml)
        {
            _typeDic.Clear();
            _configs.Clear();
            var cfg = XmlConfigParser <ClientEffectConfig> .Load(xml);

            for (var i = 0; i < cfg.Items.Length; i++)
            {
                _typeDic[cfg.Items[i].Type] = cfg.Items[i];
                if (_configs.ContainsKey(cfg.Items[i].Id))
                {
                    Logger.ErrorFormat("id {0} is repeated ", cfg.Items[i].Id);
                }
                _configs[cfg.Items[i].Id] = cfg.Items[i];
            }
        }