/// <summary>
        /// 子类中需要解析配置数据时再调用,最好在所有的基础数据都获取到后再调用
        /// </summary>
        protected virtual void ParseConfigData()
        {
            if (_baseDataId <= 0)
            {
                return;
            }
            SceneObjectProperty tBaseData = _dataConfigManager.GetConfigData <SceneObjectProperty>(DataConfigDefine.SceneObjectProperty, _baseDataId);

            if (tBaseData != null)
            {
                Id      = tBaseData.Id;
                ModelId = tBaseData.ModelID;
                Name    = tBaseData.Name;
                var tModelData = _dataConfigManager.GetConfigData <SceneModel>(DataConfigDefine.SceneModel, ModelId);
                Height  = tModelData.Height;
                Radius  = tModelData.Radius;
                Size    = new Vector3(tModelData.SizeX, tModelData.SizeY, tModelData.SizeZ);
                Rotaion = new Vector3(tModelData.RotationX, tModelData.RotationY, tModelData.RotationZ);
                Offset  = new Vector3(tModelData.OffsetX, tModelData.OffsetY, tModelData.OffsetZ);
            }
        }
Exemple #2
0
 /// <summary>
 /// 返回一个模型的ModelData,不要在这个方法中调用需要在构造函数中初始化的一些属性
 /// </summary>
 /// <returns></returns>
 protected virtual void ParseModelData()
 {
     _modelData = _configManager.GetConfigData <SceneModel>(DataConfigDefine.SceneModel, _objectBaseData.ModelId);
 }