mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 09:16:35 +08:00
Merge pull request #3532 from eska014/fix-globals-vectors
Encode vectors in Globals
This commit is contained in:
commit
cecb37a7a3
@ -916,6 +916,14 @@ static String _encode_variant(const Variant& p_variant) {
|
||||
float val = p_variant;
|
||||
return rtos(val)+(val==int(val)?".0":"");
|
||||
} break;
|
||||
case Variant::VECTOR2: {
|
||||
Vector2 val = p_variant;
|
||||
return String("Vector2(")+rtos(val.x)+String(", ")+rtos(val.y)+String(")");
|
||||
} break;
|
||||
case Variant::VECTOR3: {
|
||||
Vector3 val = p_variant;
|
||||
return String("Vector3(")+rtos(val.x)+ String(", ") +rtos(val.y)+ String(", ") +rtos(val.z)+String(")");
|
||||
} break;
|
||||
case Variant::STRING: {
|
||||
String val = p_variant;
|
||||
return "\""+val.xml_escape()+"\"";
|
||||
|
Loading…
Reference in New Issue
Block a user