Remove struct layout stuff
It broke everything using the type
This commit is contained in:
parent
3eef859095
commit
6fedf90380
2 changed files with 5 additions and 7 deletions
|
@ -1,5 +1,4 @@
|
||||||
using Svelto.ECS;
|
using Svelto.ECS;
|
||||||
using TechbloxModdingAPI.Blocks;
|
|
||||||
|
|
||||||
namespace TechbloxModdingAPI.Utility
|
namespace TechbloxModdingAPI.Utility
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,14 +5,13 @@ using Svelto.ECS;
|
||||||
|
|
||||||
namespace TechbloxModdingAPI.Utility
|
namespace TechbloxModdingAPI.Utility
|
||||||
{
|
{
|
||||||
[StructLayout(LayoutKind.Explicit)] //Make the array and managedArray fields take up the same space
|
|
||||||
public ref struct OptionalRef<T> where T : struct, IEntityComponent
|
public ref struct OptionalRef<T> where T : struct, IEntityComponent
|
||||||
{
|
{
|
||||||
[FieldOffset(0)] private readonly State state;
|
private readonly State state;
|
||||||
[FieldOffset(1)] private readonly uint index;
|
private readonly uint index;
|
||||||
[FieldOffset(5)] private NB<T> array;
|
private NB<T> array;
|
||||||
[FieldOffset(5)] private MB<T> managedArray;
|
private MB<T> managedArray;
|
||||||
[FieldOffset(1)] private readonly EntityInitializer initializer;
|
private readonly EntityInitializer initializer;
|
||||||
//The possible fields are: (index && (array || managedArray)) || initializer
|
//The possible fields are: (index && (array || managedArray)) || initializer
|
||||||
|
|
||||||
public OptionalRef(NB<T> array, uint index)
|
public OptionalRef(NB<T> array, uint index)
|
||||||
|
|
Loading…
Reference in a new issue