Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
RID¶
Resource 的唯一标识符的句柄。
描述¶
The RID Variant type is used to access a low-level resource by its unique ID. RIDs are opaque, which means they do not grant access to the resource by themselves. They are used by the low-level server classes, such as DisplayServer, RenderingServer, TextServer, etc.
A low-level resource may correspond to a high-level Resource, such as Texture or Mesh.
Note: RIDs are only useful during the current session. It won't correspond to a similar resource if sent over a network, or loaded from a file at a later time.
备注
通过 C# 使用该 API 时会有显著不同,详见 C# API 与 GDScript 的差异。
构造函数¶
RID() |
|
方法¶
get_id() const |
|
is_valid() const |
运算符¶
operator !=(right: RID) |
|
operator <(right: RID) |
|
operator <=(right: RID) |
|
operator ==(right: RID) |
|
operator >(right: RID) |
|
operator >=(right: RID) |
构造函数说明¶
构造空的 RID,内容为无效的 ID 0。
构造给定 RID 的副本。
方法说明¶
返回引用的底层资源的 ID。
如果该 RID 非 0,则返回 true。
运算符说明¶
bool operator !=(right: RID) 🔗
如果 RID 不相等,则返回 true。
如果该 RID 的 ID 小于右侧 right 的 ID,则返回 true。
bool operator <=(right: RID) 🔗
如果该 RID 的 ID 小于等于右侧 right 的 ID,则返回 true。
bool operator ==(right: RID) 🔗
如果 RID 相等,则返回 true,表示它们引用的是同一个底层资源。
如果该 RID 的 ID 大于右侧 right 的 ID,则返回 true。
bool operator >=(right: RID) 🔗
如果该 RID 的 ID 大于等于右侧 right 的 ID,则返回 true。