C# Class KEngine.KResourceModule

Inheritance: UnityEngine.MonoBehaviour
Afficher le fichier Open project: mr-kelly/KEngine Class Usage Examples

Méthodes publiques

Свойство Type Description
CustomGetResourcesPath Func,System
DocumentResourcesPath string
LoadByQueue bool
LogLevel int
Quality KResourceQuality
ResourcePathPriorityType KResourcePathPriorityType

Méthodes publiques

Méthode Description
Collect ( ) : void
ContainsResourceUrl ( string resourceUrl ) : bool
GetAppDataPath ( ) : string

獲取app數據目錄,可寫,同Application.PersitentDataPath,但在windows平台時為了避免www類中文目錄無法讀取問題,單獨實現

GetAssetBundlePath ( string path ) : string

统一在字符串后加上.box, 取决于配置的AssetBundle后缀

GetBuildPlatformName ( ) : string

Different platform's assetBundles is incompatible. CosmosEngine put different platform's assetBundles in different folder. Here, get Platform name that represent the AssetBundles Folder.

GetFileProtocol ( ) : string

On Windows, file protocol has a strange rule that has one more slash

GetResourceFullPath ( string url, bool withFileProtocol, string &fullPath, bool isLog = true ) : GetResourceFullPathType

根据相对路径,获取到StreamingAssets完整路径,或Resources中的路径

GetResourceFullPath ( string url, bool withFileProtocol = true, bool isLog = true ) : string

完整路径,www加载

IsStreamingAssetsExists ( string path ) : bool

check file exists of streamingAssets. On Android will use plugin to do that.

LoadBundle ( string path, AssetFileLoader callback = null ) : AbstractResourceLoader

load asset bundle immediatly

LoadBundleAsync ( string path, AssetFileLoader callback = null ) : AbstractResourceLoader

Load Async Asset Bundle

LoadSyncFromStreamingAssets ( string path ) : byte[]

Load file from streamingAssets. On Android will use plugin to do that.

LogLoadTime ( string resType, string resPath, System begin ) : void
LogRequest ( string resType, string resPath ) : void
TryGetDocumentResourceUrl ( string url, bool withFileProtocol, string &newUrl ) : bool

可被WWW读取的Resource路径

TryGetInAppStreamingUrl ( string url, bool withFileProtocol, string &newUrl ) : bool

(not android ) only! Android资源不在目录! Editor返回文件系统目录,运行时返回StreamingAssets目录

Private Methods

Méthode Description
Awake ( ) : void
FileExistsWithDifferentCase ( string filePath ) : bool

大小写敏感地进行文件判断, Windows Only

InitResourcePath ( ) : void

Initialize the path of AssetBundles store place ( Maybe in PersitentDataPath or StreamingAssetsPath )

KResourceModule ( ) : System
Update ( ) : void

Method Details

Collect() public static méthode

public static Collect ( ) : void
Résultat void

ContainsResourceUrl() public static méthode

public static ContainsResourceUrl ( string resourceUrl ) : bool
resourceUrl string
Résultat bool

GetAppDataPath() public static méthode

獲取app數據目錄,可寫,同Application.PersitentDataPath,但在windows平台時為了避免www類中文目錄無法讀取問題,單獨實現
public static GetAppDataPath ( ) : string
Résultat string

GetAssetBundlePath() public static méthode

统一在字符串后加上.box, 取决于配置的AssetBundle后缀
public static GetAssetBundlePath ( string path ) : string
path string
Résultat string

GetBuildPlatformName() public static méthode

Different platform's assetBundles is incompatible. CosmosEngine put different platform's assetBundles in different folder. Here, get Platform name that represent the AssetBundles Folder.
public static GetBuildPlatformName ( ) : string
Résultat string

GetFileProtocol() public static méthode

On Windows, file protocol has a strange rule that has one more slash
public static GetFileProtocol ( ) : string
Résultat string

GetResourceFullPath() public static méthode

根据相对路径,获取到StreamingAssets完整路径,或Resources中的路径
public static GetResourceFullPath ( string url, bool withFileProtocol, string &fullPath, bool isLog = true ) : GetResourceFullPathType
url string
withFileProtocol bool
fullPath string
isLog bool
Résultat GetResourceFullPathType

GetResourceFullPath() public static méthode

完整路径,www加载
public static GetResourceFullPath ( string url, bool withFileProtocol = true, bool isLog = true ) : string
url string
withFileProtocol bool 是否带有file://前缀
isLog bool
Résultat string

IsStreamingAssetsExists() public static méthode

check file exists of streamingAssets. On Android will use plugin to do that.
public static IsStreamingAssetsExists ( string path ) : bool
path string relative path, when file is "file:///android_asset/test.txt", the pat is "test.txt"
Résultat bool

LoadBundle() public static méthode

load asset bundle immediatly
public static LoadBundle ( string path, AssetFileLoader callback = null ) : AbstractResourceLoader
path string
callback AssetFileLoader
Résultat AbstractResourceLoader

LoadBundleAsync() public static méthode

Load Async Asset Bundle
public static LoadBundleAsync ( string path, AssetFileLoader callback = null ) : AbstractResourceLoader
path string
callback AssetFileLoader cps style async
Résultat AbstractResourceLoader

LoadSyncFromStreamingAssets() public static méthode

Load file from streamingAssets. On Android will use plugin to do that.
public static LoadSyncFromStreamingAssets ( string path ) : byte[]
path string relative path, when file is "file:///android_asset/test.txt", the pat is "test.txt"
Résultat byte[]

LogLoadTime() public static méthode

public static LogLoadTime ( string resType, string resPath, System begin ) : void
resType string
resPath string
begin System
Résultat void

LogRequest() public static méthode

public static LogRequest ( string resType, string resPath ) : void
resType string
resPath string
Résultat void

TryGetDocumentResourceUrl() public static méthode

可被WWW读取的Resource路径
public static TryGetDocumentResourceUrl ( string url, bool withFileProtocol, string &newUrl ) : bool
url string
withFileProtocol bool 是否带有file://前缀
newUrl string
Résultat bool

TryGetInAppStreamingUrl() public static méthode

(not android ) only! Android资源不在目录! Editor返回文件系统目录,运行时返回StreamingAssets目录
public static TryGetInAppStreamingUrl ( string url, bool withFileProtocol, string &newUrl ) : bool
url string
withFileProtocol bool 是否带有file://前缀
newUrl string
Résultat bool

Property Details

CustomGetResourcesPath public_oe static_oe property

public static Func,System CustomGetResourcesPath
Résultat Func,System

DocumentResourcesPath public_oe static_oe property

public static string DocumentResourcesPath
Résultat string

LoadByQueue public_oe static_oe property

public static bool LoadByQueue
Résultat bool

LogLevel public_oe static_oe property

public static int LogLevel
Résultat int

Quality public_oe static_oe property

public static KResourceQuality Quality
Résultat KResourceQuality

ResourcePathPriorityType public_oe static_oe property

是否優先找下載的資源?還是app本身資源優先. 优先下载的资源,即采用热更新的资源
public static KResourcePathPriorityType ResourcePathPriorityType
Résultat KResourcePathPriorityType