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 的唯一标识符的句柄。
Description¶
RID Variant 类型用于通过其唯一 ID 访问低级资源。RID 是不透明的,这意味着它们不会自行授予对资源的访问权限。它们由低级服务类使用,例如 DisplayServer、RenderingServer、TextServer 等。
低级资源可能对应于高级 Resource,例如 Texture 或 Mesh。
备注
There are notable differences when using this API with C#. See C# API 与 GDScript 的差异 for more information.
Constructors¶
RID ( ) |
|
Methods¶
get_id ( ) const |
|
is_valid ( ) const |
Operators¶
operator != ( RID right ) |
|
operator < ( RID right ) |
|
operator <= ( RID right ) |
|
operator == ( RID right ) |
|
operator > ( RID right ) |
|
operator >= ( RID right ) |
Constructor Descriptions¶
RID RID ( )
构造空的 RID,内容为无效的 ID 0
。
构造给定 RID 的副本。
Method Descriptions¶
int get_id ( ) const
返回引用的底层资源的 ID。
bool is_valid ( ) const
如果该 RID 非 0
,则返回 true
。
Operator Descriptions¶
bool operator != ( RID right )
如果 RID 不相等,则返回 true
。
如果该 RID 的 ID 小于右侧 right
的 ID,则返回 true
。
bool operator <= ( RID right )
如果该 RID 的 ID 小于等于右侧 right
的 ID,则返回 true
。
bool operator == ( RID right )
如果 RID 相等,则返回 true
,表示它们引用的是同一个底层资源。
如果该 RID 的 ID 大于右侧 right
的 ID,则返回 true
。
bool operator >= ( RID right )
如果该 RID 的 ID 大于等于右侧 right
的 ID,则返回 true
。