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.

RID

Resource 的唯一标识符的句柄。

Description

RID Variant 类型用于通过其唯一 ID 访问低级资源。RID 是不透明的,这意味着它们不会自行授予对资源的访问权限。它们由低级服务类使用,例如 DisplayServerRenderingServerTextServer 等。

低级资源可能对应于高级 Resource,例如 TextureMesh

备注

There are notable differences when using this API with C#. See C# API 与 GDScript 的差异 for more information.

Constructors

RID

RID ( )

RID

RID ( RID from )

Methods

int

get_id ( ) const

bool

is_valid ( ) const

Operators

bool

operator != ( RID right )

bool

operator < ( RID right )

bool

operator <= ( RID right )

bool

operator == ( RID right )

bool

operator > ( RID right )

bool

operator >= ( RID right )


Constructor Descriptions

RID RID ( )

构造空的 RID,内容为无效的 ID 0


RID RID ( RID from )

构造给定 RID 的副本。


Method Descriptions

int get_id ( ) const

返回引用的底层资源的 ID。


bool is_valid ( ) const

如果该 RID0,则返回 true


Operator Descriptions

bool operator != ( RID right )

如果 RID 不相等,则返回 true


bool operator < ( RID right )

如果该 RID 的 ID 小于右侧 right 的 ID,则返回 true


bool operator <= ( RID right )

如果该 RID 的 ID 小于等于右侧 right 的 ID,则返回 true


bool operator == ( RID right )

如果 RID 相等,则返回 true,表示它们引用的是同一个底层资源。


bool operator > ( RID right )

如果该 RID 的 ID 大于右侧 right 的 ID,则返回 true


bool operator >= ( RID right )

如果该 RID 的 ID 大于等于右侧 right 的 ID,则返回 true