2
0
Эх сурвалжийг харах

Add a note to set default values for custom resources (#4650)

Co-authored-by: Hugo Locurcio <[email protected]>
RoniPerson 4 жил өмнө
parent
commit
b1bf4a93e3

+ 6 - 0
tutorials/scripting/resources.rst

@@ -206,6 +206,9 @@ Let's see some examples.
     export(Resource) var sub_resource
     export(Array, String) var strings
 
+    # Make sure that every parameter has a default value. 
+    # Otherwise, there will be problems with creating and editing
+    # your resource via the inspector.
     func _init(p_health = 0, p_sub_resource = null, p_strings = []):
         health = p_health
         sub_resource = p_sub_resource
@@ -238,6 +241,9 @@ Let's see some examples.
                 [Export]
                 public String[] Strings { get; set; }
 
+                // Make sure that every parameter has a default value. 
+                // Otherwise, there will be problems with creating and editing
+                // your resource via the inspector.
                 public BotStats(int health = 0, Resource subResource = null, String[] strings = null)
                 {
                     Health = health;