C# 클래스 KEngine.KResourceModule

상속: UnityEngine.MonoBehaviour
파일 보기 프로젝트 열기: mr-kelly/KEngine 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
CustomGetResourcesPath Func,System
DocumentResourcesPath string
LoadByQueue bool
LogLevel int
Quality KResourceQuality
ResourcePathPriorityType KResourcePathPriorityType

공개 메소드들

메소드 설명
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目录

비공개 메소드들

메소드 설명
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

메소드 상세

Collect() 공개 정적인 메소드

public static Collect ( ) : void
리턴 void

ContainsResourceUrl() 공개 정적인 메소드

public static ContainsResourceUrl ( string resourceUrl ) : bool
resourceUrl string
리턴 bool

GetAppDataPath() 공개 정적인 메소드

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

GetAssetBundlePath() 공개 정적인 메소드

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

GetBuildPlatformName() 공개 정적인 메소드

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
리턴 string

GetFileProtocol() 공개 정적인 메소드

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

GetResourceFullPath() 공개 정적인 메소드

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

GetResourceFullPath() 공개 정적인 메소드

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

IsStreamingAssetsExists() 공개 정적인 메소드

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"
리턴 bool

LoadBundle() 공개 정적인 메소드

load asset bundle immediatly
public static LoadBundle ( string path, AssetFileLoader callback = null ) : AbstractResourceLoader
path string
callback AssetFileLoader
리턴 AbstractResourceLoader

LoadBundleAsync() 공개 정적인 메소드

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

LoadSyncFromStreamingAssets() 공개 정적인 메소드

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"
리턴 byte[]

LogLoadTime() 공개 정적인 메소드

public static LogLoadTime ( string resType, string resPath, System begin ) : void
resType string
resPath string
begin System
리턴 void

LogRequest() 공개 정적인 메소드

public static LogRequest ( string resType, string resPath ) : void
resType string
resPath string
리턴 void

TryGetDocumentResourceUrl() 공개 정적인 메소드

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

TryGetInAppStreamingUrl() 공개 정적인 메소드

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

프로퍼티 상세

CustomGetResourcesPath 공개적으로 정적으로 프로퍼티

public static Func,System CustomGetResourcesPath
리턴 Func,System

DocumentResourcesPath 공개적으로 정적으로 프로퍼티

public static string DocumentResourcesPath
리턴 string

LoadByQueue 공개적으로 정적으로 프로퍼티

public static bool LoadByQueue
리턴 bool

LogLevel 공개적으로 정적으로 프로퍼티

public static int LogLevel
리턴 int

Quality 공개적으로 정적으로 프로퍼티

public static KResourceQuality Quality
리턴 KResourceQuality

ResourcePathPriorityType 공개적으로 정적으로 프로퍼티

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