Example #1
0
    public static void LoadSettings()
    {
        TextAsset textAsset = AssetManager.Load <TextAsset>("EmbeddedAsset/Manifest/FieldMap/settingUtils.txt", false);

        if (textAsset == (UnityEngine.Object)null)
        {
            return;
        }
        SettingUtils.jsNode = JSON.Parse(textAsset.text);
        if (SettingUtils.jsNode == null)
        {
            return;
        }
        JSONNode jsonnode = SettingUtils.jsNode["FieldMapSettings"];

        if (jsonnode == null)
        {
            return;
        }
        if (jsonnode["enable"] != null)
        {
            SettingUtils.fieldMapSettings.enable = jsonnode["enable"].AsBool;
        }
        SettingUtils._ReadFieldMapSettingsFromJSONNode(jsonnode);
        if (jsonnode["activeProfileId"] != null)
        {
            SettingUtils.fieldMapSettings.activeProfileId = jsonnode["activeProfileId"].AsInt;
        }
        if (SettingUtils.fieldMapSettings.activeProfileId == -1)
        {
            return;
        }
        JSONNode jsonnode2 = jsonnode["debugProfile"];

        if (jsonnode2 == null)
        {
            return;
        }
        String   aKey      = "profile_" + SettingUtils.fieldMapSettings.activeProfileId;
        JSONNode jsonnode3 = jsonnode2[aKey];

        if (jsonnode3 == null)
        {
            return;
        }
        SettingUtils._ReadFieldMapSettingsFromJSONNode(jsonnode3);
    }