소스 검색

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

Co-authored-by: Hugo Locurcio <[email protected]>
RoniPerson 4 년 전
부모
커밋
e196267b6b
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      getting_started/step_by_step/resources.rst

+ 6 - 0
getting_started/step_by_step/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;