소스 검색

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" />
 			<argument index="0" name="type" type="StringName" />
 			<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>
 		</method>
 	</methods>