浏览代码

Add `@GDScript.type_exists` documentation

Raul Santos 3 年之前
父节点
当前提交
e47ba81050
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      modules/gdscript/doc_classes/@GDScript.xml

+ 5 - 0
modules/gdscript/doc_classes/@GDScript.xml

@@ -239,6 +239,11 @@
 			<return type="bool" />
 			<return type="bool" />
 			<argument index="0" name="type" type="StringName" />
 			<argument index="0" name="type" type="StringName" />
 			<description>
 			<description>
+				Returns whether the given [Object]-derived class exists in [ClassDB]. Note that [Variant] data types are not registered in [ClassDB].
+				[codeblock]
+				type_exists("Sprite2D") # Returns true
+				type_exists("NonExistentClass") # Returns false
+				[/codeblock]
 			</description>
 			</description>
 		</method>
 		</method>
 	</methods>
 	</methods>