Browse Source

[3.1] [Mono] Make all structs serializable

Manually cherrypicked from https://github.com/godotengine/godot/pull/31191
Aaron Franke 6 years ago
parent
commit
3a7aa3a0e4

+ 3 - 0
modules/mono/glue/Managed/Files/AABB.cs

@@ -5,6 +5,7 @@
 // file: core/variant_call.cpp
 // commit: 5ad9be4c24e9d7dc5672fdc42cea896622fe5685
 using System;
+using System.Runtime.InteropServices;
 #if REAL_T_IS_DOUBLE
 using real_t = System.Double;
 #else
@@ -13,6 +14,8 @@ using real_t = System.Single;
 
 namespace Godot
 {
+    [Serializable]
+    [StructLayout(LayoutKind.Sequential)]
     public struct AABB : IEquatable<AABB>
     {
         private Vector3 _position;

+ 1 - 0
modules/mono/glue/Managed/Files/Basis.cs

@@ -8,6 +8,7 @@ using real_t = System.Single;
 
 namespace Godot
 {
+    [Serializable]
     [StructLayout(LayoutKind.Sequential)]
     public struct Basis : IEquatable<Basis>
     {

+ 3 - 0
modules/mono/glue/Managed/Files/Color.cs

@@ -1,7 +1,10 @@
 using System;
+using System.Runtime.InteropServices;
 
 namespace Godot
 {
+    [Serializable]
+    [StructLayout(LayoutKind.Sequential)]
     public struct Color : IEquatable<Color>
     {
         public float r;

+ 3 - 0
modules/mono/glue/Managed/Files/Plane.cs

@@ -1,4 +1,5 @@
 using System;
+using System.Runtime.InteropServices;
 #if REAL_T_IS_DOUBLE
 using real_t = System.Double;
 #else
@@ -7,6 +8,8 @@ using real_t = System.Single;
 
 namespace Godot
 {
+    [Serializable]
+    [StructLayout(LayoutKind.Sequential)]
     public struct Plane : IEquatable<Plane>
     {
         private Vector3 _normal;

+ 1 - 0
modules/mono/glue/Managed/Files/Quat.cs

@@ -8,6 +8,7 @@ using real_t = System.Single;
 
 namespace Godot
 {
+    [Serializable]
     [StructLayout(LayoutKind.Sequential)]
     public struct Quat : IEquatable<Quat>
     {

+ 1 - 0
modules/mono/glue/Managed/Files/Rect2.cs

@@ -8,6 +8,7 @@ using real_t = System.Single;
 
 namespace Godot
 {
+    [Serializable]
     [StructLayout(LayoutKind.Sequential)]
     public struct Rect2 : IEquatable<Rect2>
     {

+ 1 - 0
modules/mono/glue/Managed/Files/Transform.cs

@@ -8,6 +8,7 @@ using real_t = System.Single;
 
 namespace Godot
 {
+    [Serializable]
     [StructLayout(LayoutKind.Sequential)]
     public struct Transform : IEquatable<Transform>
     {

+ 1 - 0
modules/mono/glue/Managed/Files/Transform2D.cs

@@ -8,6 +8,7 @@ using real_t = System.Single;
 
 namespace Godot
 {
+    [Serializable]
     [StructLayout(LayoutKind.Sequential)]
     public struct Transform2D : IEquatable<Transform2D>
     {

+ 1 - 0
modules/mono/glue/Managed/Files/Vector2.cs

@@ -14,6 +14,7 @@ using real_t = System.Single;
 
 namespace Godot
 {
+    [Serializable]
     [StructLayout(LayoutKind.Sequential)]
     public struct Vector2 : IEquatable<Vector2>
     {

+ 1 - 0
modules/mono/glue/Managed/Files/Vector3.cs

@@ -14,6 +14,7 @@ using real_t = System.Single;
 
 namespace Godot
 {
+    [Serializable]
     [StructLayout(LayoutKind.Sequential)]
     public struct Vector3 : IEquatable<Vector3>
     {