Class Info |
|---|
class IResource : public RefCount 通用资源类,继承自RefCount,存储纹理、模型、材质等二进制数据,含有资源路径、资源大小、资源类型、ID、读取状态等信息。 |
Constructor Name |
|---|
IResource(const String& filePath, ResourceType resourceType) 构造函数,第一个参数为资源路径,第二个参数为资源类型。 |
Qualifier and Type |
Method Name and Description |
|---|---|
const String& |
GetFilePath() const 获取资源路径。 |
void |
SetFilePath(const String& filePath) 设置资源路径。 |
GetId() const 获取资源ID。 |
|
void |
设置资源ID。 |
GetLoadState() const 获取资源加载状态。 |
|
void |
SetLoadState(LoadState loadState) 设置资源加载状态。 |
GetResourceType() const 获取资源类型。 |
|
virtual bool |
Resume() 应用程序从后台切到前台时,完成资源的重建。 |
virtual void |
Pause() 应用程序从前台切到后台时,完成资源的销毁。 |
Constructor |
|---|
IResource(const String& filePath, ResourceType resourceType) 构造函数。 |
Parameters
Name |
Description |
|---|---|
filePath |
资源路径。 |
resourceType |
资源类型。参见ResourceType。 |
Method |
|---|
const String& GetFilePath() const 获取当前资源路径。 |
Returns
Type |
Description |
|---|---|
const String& |
返回当前资源路径。 |
Method |
|---|
void SetFilePath(const String& filePath) 设置资源路径。 |
Parameters
Name |
Description |
|---|---|
filePath |
资源路径字符串。 |
Method |
|---|
void SetLoadState(LoadState loadState) 设置资源加载状态。 |
Parameters
Name |
Description |
|---|---|
loadState |
LoadState类型枚举值。 |
Method |
|---|
ResourceType GetResourceType() const 获取资源类型。 |
Returns
Type |
Description |
|---|---|
返回ResourceType类型枚举值。 |