Skip to content

1947899648/Unity3D-Easy-Config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unity3D-Easy-Config

一种快速的、轻量的、简单的本地序列化配置功能

A fast, lightweight, and simple local serialization configuration feature

核心用法:

Core usage:

【1】EasyConfigHandler.Data()

【2】EasyConfigHandler.Save(newConfig)

注意:内置缓存机制,故支持Update()等高频访问

Note: Built-in caching mechanism, therefore supports high-frequency access such as Update().

核心方法清单如下:

The list of core methods is as follows:

【1】 泛型接口(Generic Interface):IEasyConfigBase

【2】 泛型配置控制类(Generic Configuration Controller):EasyConfigHandler

使用步骤如下:

The steps to use are as follows:

【Step1】

导入插件WPZ0325.EasyConfig,创建自定义配置类,比如“XXXXConfig”

Import the plugin WPZ0325.EasyConfig and create a custom configuration class, such as 'XXXXConfig'

s1

【Step2】 根据需求自定义配置的数据结构

Data structures customized according to requirements

s2

【Step3】

引入命名空间WPZ0325.EasyConfig,给配置类实现接口IEasyConfigBase,并设定配置的默认值

Introduce the namespace WPZ0325.EasyConfig, implement the IEasyConfigBase interface for the configuration class, and set the default values for the configuration.

s3

【Step4】

在业务代码中直接使用EasyConfigHandler来获取配置数据或更新配置数据,如下图:

In the business code, directly use EasyConfigHandler to obtain or update configuration data, as shown in the figure below:

s4_2

【Step5】

结束!

The end!

s7

补充说明:

Additional explanation:

执行程序后StreamingAssets自动生成文件夹EasyConfigsRoot

After running the program, the StreamingAssets folder EasyConfigsRoot is automatically created.

该文件夹里面存放配置Json文件,用户可根据需要直接自定义编辑参数值即可

This folder contains configuration JSON files. Users can directly customize and edit the parameter values as needed. s5

s6

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages