Răsfoiți Sursa

Merge pull request #16747 from PJB3005/18-02-16-nodepath-tostring

Give C# NodePath a ToString().
Ignacio Etcheverry 7 ani în urmă
părinte
comite
f4dcfa38f7
1 a modificat fișierele cu 2 adăugiri și 1 ștergeri
  1. 2 1
      modules/mono/editor/bindings_generator.cpp

+ 2 - 1
modules/mono/editor/bindings_generator.cpp

@@ -2231,7 +2231,8 @@ void BindingsGenerator::_populate_builtin_type_interfaces() {
 												   "this." BINDINGS_PTR_FIELD " = NativeCalls.godot_icall_NodePath_Ctor(path);\n" CLOSE_BLOCK_L2
 														   MEMBER_BEGIN "public static implicit operator NodePath(string from)\n" OPEN_BLOCK_L2 "return new NodePath(from);\n" CLOSE_BLOCK_L2
 																   MEMBER_BEGIN "public static implicit operator string(NodePath from)\n" OPEN_BLOCK_L2
-												   "return NativeCalls." ICALL_PREFIX "NodePath_operator_String(NodePath." CS_SMETHOD_GETINSTANCE "(from));\n" CLOSE_BLOCK_L2);
+												   "return NativeCalls." ICALL_PREFIX "NodePath_operator_String(NodePath." CS_SMETHOD_GETINSTANCE "(from));\n" CLOSE_BLOCK_L2
+														   MEMBER_BEGIN "public override string ToString()\n" OPEN_BLOCK_L2 "return (string)this;\n" CLOSE_BLOCK_L2);
 	builtin_types.insert(itype.cname, itype);
 
 	// RID