示例#1
0
        /// <summary>
        /// This loads the configuration
        /// </summary>
        static Assets()
        {
            // Load the JSON files
            // The JSON parsing options
            var JSONOptions = new JsonSerializerOptions
            {
                ReadCommentHandling = JsonCommentHandling.Skip,
                AllowTrailingCommas = true,
                IgnoreNullValues    = true
            };
            // Get the text file
            var text = Resource.ResourceManager.GetString("assets.json");

            // Get the dictionary
            config = JsonSerializer.Deserialize <AssetsConfig>(text, JSONOptions);

            // Get the text file
            text = Resource.ResourceManager.GetString("condition.json");

            // Get the dictionary
            conditionSchema = JsonSerializer.Deserialize <ConditionSchema>(text, JSONOptions);

            // Get the text file
            text           = Resource.ResourceManager.GetString("behavior.json");
            behaviorSchema = JsonSerializer.Deserialize <BehaviorSchema>(text, JSONOptions);
        }
示例#2
0
        /// <summary>
        /// This loads the configuration
        /// </summary>
        static Assets()
        {
            // Load the JSON files

            // Get the text file
            var text = Resource.ResourceManager.GetString("assets.json");

            // Get the dictionary
            config = JSONDeserializer.Deserialize <AssetsConfig>(text);

            // Get the text file
            text = Resource.ResourceManager.GetString("condition.json");

            // Get the dictionary
            ConditionSchema = JSONDeserializer.Deserialize <ConditionSchema>(text);

            // Get the text file
            text           = Resource.ResourceManager.GetString("behavior.json");
            behaviorSchema = JSONDeserializer.Deserialize <BehaviorSchema>(text);
        }