瀏覽代碼

Expand Resource section (#3543)

* Expand Resource section

Added how you can export classes that inherits from Resource as a convenience.
mechPenSketch 5 年之前
父節點
當前提交
e7a7e11c42
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      getting_started/scripting/gdscript/gdscript_exports.rst

+ 7 - 0
getting_started/scripting/gdscript/gdscript_exports.rst

@@ -125,6 +125,13 @@ Examples
     export(Resource) var resource
     export(Resource) var resource
     # In the Inspector, you can then drag and drop a resource file
     # In the Inspector, you can then drag and drop a resource file
     # from the FileSystem dock into the variable slot.
     # from the FileSystem dock into the variable slot.
+    
+    # Opening the inspector dropdown may result in an
+    # extremely long list of possible classes to create, however.
+    # Therefore, if you specify an extension of Resource such as:
+    export(AnimationNode) var resource
+    # The drop-down menu will be limited to AnimationNode and all
+    # its inherited classes.
 
 
 It must be noted that even if the script is not being run while in the
 It must be noted that even if the script is not being run while in the
 editor, the exported properties are still editable. This can be used
 editor, the exported properties are still editable. This can be used