C# Class KEngine.Modules.SettingModule

Unity SettingModule, with Resources.Load in product, with File.Read in editor
Inheritance: SettingModuleBase
显示文件 Open project: mr-kelly/KEngine Class Usage Examples

Public Properties

Property Type Description
CustomLoadSetting LoadSettingFuncDelegate
SettingBytesFilter SettingBytesFilterDelegate

Public Methods

Method Description
DefaultLoadSetting ( string path ) : byte[]

Default load setting strategry, editor load file, runtime resources.load

Get ( string path, bool useCache = true ) : TableFile

Quick method to get TableFile from instance

WatchSetting ( string path, System action ) : void

Watch the setting file, when changed, trigger the delegate

Protected Methods

Method Description
LoadSetting ( string path ) : string

Unity Resources.Load setting file in Resources folder

Private Methods

Method Description
GetFileSystemPath ( string path ) : string
LoadSettingFromFile ( string path ) : byte[]

Load setting in file system using `File` class

LoadSettingFromResources ( string path ) : byte[]
LoadSettingFromStreamingAssets ( string path ) : byte[]

KEngine 3 后,增加同步loadStreamingAssets文件,统一只用StreamingAsset路径

SettingModule ( ) : System

Method Details

DefaultLoadSetting() public static method

Default load setting strategry, editor load file, runtime resources.load
public static DefaultLoadSetting ( string path ) : byte[]
path string
return byte[]

Get() public static method

Quick method to get TableFile from instance
public static Get ( string path, bool useCache = true ) : TableFile
path string
useCache bool
return TableFile

LoadSetting() protected method

Unity Resources.Load setting file in Resources folder
protected LoadSetting ( string path ) : string
path string
return string

WatchSetting() public static method

Watch the setting file, when changed, trigger the delegate
public static WatchSetting ( string path, System action ) : void
path string
action System
return void

Property Details

CustomLoadSetting public_oe static_oe property

Override the default load file strategy
public static LoadSettingFuncDelegate CustomLoadSetting
return LoadSettingFuncDelegate

SettingBytesFilter public_oe static_oe property

Filter the loaded bytes, which settings file may be encrypted, so you can manipulate the bytes
public static SettingBytesFilterDelegate SettingBytesFilter
return SettingBytesFilterDelegate