示例#1
0
 } // end instance
 #region ******** 初始化配置信息 ********
 private IconConfig() {
     skillConfig = new Dictionary<string, ISkillInfo>();
     AssetBundle assetbundle = PlatformTool.LoadFromStreamingAssets("config/res_config.unity3d");
     string skillJson = assetbundle.LoadAsset<TextAsset>("skill_info_config.json").text;
     assetbundle.Unload(false);
     InitSkillConfig(skillJson);
 } // end IconConfig
示例#2
0
            } // end SqliteDatabase

            /// <summary>
            /// 连接数据库
            /// </summary>
            /// <param name="connectionString"> 数据库名 </param>
            public void Connect(string connectionString)
            {
                string path = PlatformTool.GetSqliteDatabasePath(connectionString);

                try {
                    dbConnection = new SqliteConnection(path);
                    dbConnection.Open();
                } catch (Exception ex) {
                    ConsoleTool.SetConsole(ex.ToString());
                } // end try
            }     // end Open
示例#3
0
 public GameSetting() {
     currentQuality = "Simple";
     path = PlatformTool.GetPersistentDataPath("GameSetting.bin");
     GameSetting setting = SerializeTool.GetDataWithPath<GameSetting>(path);
     if (setting == null) {
         musicValue = 0.5f;
         soundValue = 0.5f;
         return;
     } // end if 
     musicValue = setting.musicValue;
     soundValue = setting.soundValue;
     SetQuality(setting.currentQuality);
 } // end GameSetting
示例#4
0
                }     // end instance
                #region ******** 初始化角色配置信息 ********
                private CharacterConfigMgr()
                {
                    characterConfig = new Dictionary <string, ICharacterConfig>();
                    AssetBundle assetbundle = PlatformTool.LoadFromStreamingAssets("config/res_config.unity3d");
                    string      jsonInfo    = assetbundle.LoadAsset <TextAsset>("character_config.json").text;

                    assetbundle.Unload(false);
                    JsonData data = JsonMapper.ToObject(jsonInfo);
                    JsonData list = data["itemlist"];

                    for (int i = 0; i < list.Count; i++)
                    {
                        characterConfig.Add((string)list[i]["id"], new CharacterConfig(list[i]));
                    } // end for
                }     // end CharacterConfigMgr
示例#5
0
                }     // end instance
                #region ******** 初始化物品配置信息 ********
                private ItemConfig()
                {
                    itemConfig = new Dictionary <string, Dictionary <string, IItemInfo> >();
                    AssetBundle assetbundle   = PlatformTool.LoadFromStreamingAssets("config/res_config.unity3d");
                    string      stuffJson     = assetbundle.LoadAsset <TextAsset>("stuff_res_config.json").text;
                    string      equipJson     = assetbundle.LoadAsset <TextAsset>("equipment_res_config.json").text;
                    string      consumeJson   = assetbundle.LoadAsset <TextAsset>("consumable_res_config.json").text;
                    string      bluePrintJson = assetbundle.LoadAsset <TextAsset>("blueprint_res_config.json").text;

                    assetbundle.Unload(false);
                    InitStuffConfig(stuffJson);
                    InitEquipConfig(equipJson);
                    InitConsumeConfig(consumeJson);
                    InitBluePrintConfig(bluePrintJson);
                } // end ItemConfig