Browse Source

Merge pull request #70210 from raulsntos/dotnet/script-not-found-error

C#: Add note about the class name in instantiate error
Ignacio Roldán Etcheverry 2 năm trước cách đây
mục cha
commit
d44d0cc0fd
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      modules/mono/csharp_script.cpp

+ 1 - 1
modules/mono/csharp_script.cpp

@@ -2292,7 +2292,7 @@ bool CSharpScript::can_instantiate() const {
 	// For tool scripts, this will never fire if the class is not found. That's because we
 	// don't know if it's a tool script if we can't find the class to access the attributes.
 	if (extra_cond && !valid) {
-		ERR_FAIL_V_MSG(false, "Cannot instance script because the associated class could not be found. Script: '" + get_path() + "'.");
+		ERR_FAIL_V_MSG(false, "Cannot instance script because the associated class could not be found. Script: '" + get_path() + "'. Make sure the script exists and contains a class definition with a name that matches the filename of the script exactly (it's case-sensitive).");
 	}
 
 	return valid && extra_cond;