From 224937cd097165bb79fee06fb27a59aafee2bf99 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Perrier Date: Thu, 8 Apr 2021 18:46:56 +0200 Subject: [PATCH] Convert Int3 to generated type. --- Source/Engine/Core/Math/Int3.cs | 18 +----------------- Source/Engine/Core/Math/Int3.h | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/Source/Engine/Core/Math/Int3.cs b/Source/Engine/Core/Math/Int3.cs index 93193881a..e0c67bd33 100644 --- a/Source/Engine/Core/Math/Int3.cs +++ b/Source/Engine/Core/Math/Int3.cs @@ -12,9 +12,8 @@ namespace FlaxEngine /// Represents a three dimensional mathematical vector (signed integers). /// [Serializable] - [StructLayout(LayoutKind.Sequential, Pack = 4)] [TypeConverter(typeof(TypeConverters.Int3Converter))] - public struct Int3 : IEquatable, IFormattable + partial struct Int3 : IEquatable, IFormattable { private static readonly string _formatString = "X:{0} Y:{1} Z:{2}"; @@ -58,21 +57,6 @@ namespace FlaxEngine /// public static readonly Int3 Maximum = new Int3(int.MaxValue); - /// - /// The X component of the vector. - /// - public int X; - - /// - /// The Y component of the vector. - /// - public int Y; - - /// - /// The Z component of the vector. - /// - public int Z; - /// /// Initializes a new instance of the struct. /// diff --git a/Source/Engine/Core/Math/Int3.h b/Source/Engine/Core/Math/Int3.h index 6886acc6b..d639ea103 100644 --- a/Source/Engine/Core/Math/Int3.h +++ b/Source/Engine/Core/Math/Int3.h @@ -13,22 +13,29 @@ struct Vector4; /// /// Three-components vector (32 bit integer type). /// -API_STRUCT(InBuild) struct FLAXENGINE_API Int3 +API_STRUCT() struct FLAXENGINE_API Int3 { +DECLARE_SCRIPTING_TYPE_MINIMAL(Int3); public: union { struct { - // X component - int32 X; + /// + /// The X component. + /// + API_FIELD() int32 X; - // Y component - int32 Y; + /// + /// The Y component. + /// + API_FIELD() int32 Y; - // Y component - int32 Z; + /// + /// The Z component. + /// + API_FIELD() int32 Z; }; // Raw values