-
Notifications
You must be signed in to change notification settings - Fork 548
Configuration
Open the configuration editor Window -> 配置编辑器(Configuration Editor)
In the 新增配置(new configuration tab), enter the 配置名(configuration name) to create a configuration table, the configuration table will be placed Resources/Config directory
After the build in the current configuration options, select the configuration you just created, edit the fields you want
translation:
Field Type -> 字段类型
Field Content -> 字段内容
- StringArray type different data separated by '|'
- Edit the configuration, remember to click the (保存)save button
- New Data Recall [Rebuild Package Configuration File] (https://github.com/GaoKaiHaHa/MyUnityFrameWork/wiki/Resource-Management)
ConfigManager
public static Dictionary <string, SingleField> GetData (string ConfigName)
Get a configuration object
SingleField
public int GetInt ()
Get an Int
public int GetFloat ()
Gets a Float
public bool GetBool ()
Get a Bool
public string GetString ()
Get a String
public string [] GetStringArray ()
Gets a String array
public Vector2 GetVector2 ()
Get a Vector2
public Vector3 GetVector3 ()
Get a Vector3
public Color GetColor ()
Get a Color
public T GetEnum <T> () where T: struct
Get an enumeration
void LoadConfig ()
{
if (ConfigManager.GetIsExistConfig ("LanguageConfig"))
{
Dictionary <string, SingleField> config = ConfigManager.GetData ("LanguageConfig");
if (config.ContainsKey ("DefaultLanguage"))
{
SystemLanguage defaultLanguage = config ["DefaultLanguage"]. GetEnum <SystemLanguage> ();
}
}
}