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 的唯一标识符的句柄。
描述¶
RID Variant 类型用于通过其唯一 ID 访问低级资源。RID 是不透明的,这意味着它们不会自行授予对资源的访问权限。它们由低级服务类使用,例如 DisplayServer、RenderingServer、TextServer 等。
低级资源可能对应于高级 Resource,例如 Texture 或 Mesh。
备注
通过 C# 使用这个 API 时有显著的不同。详见 C# API 与 GDScript 的差异。
构造函数¶
RID ( ) |
|
方法¶
get_id ( ) const |
|
is_valid ( ) const |
操作符¶
operator != ( RID right ) |
|
operator < ( RID right ) |
|
operator <= ( RID right ) |
|
operator == ( RID right ) |
|
operator > ( RID right ) |
|
operator >= ( RID right ) |
构造函数说明¶
RID RID ( )
构造空的 RID,内容为无效的 ID 0
。
构造给定 RID 的副本。
方法说明¶
int get_id ( ) const
返回引用的底层资源的 ID。
bool is_valid ( ) const
如果该 RID 非 0
,则返回 true
。
操作符说明¶
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
。