Browse Source

Remove struct layout stuff

It broke everything using the type
tags/v2.0.0
NorbiPeti 3 years ago
parent
commit
6fedf90380
Signed by: NorbiPeti <szatmari.norbert.peter@gmail.com> GPG Key ID: DBA4C4549A927E56
2 changed files with 5 additions and 7 deletions
  1. +0
    -1
      TechbloxModdingAPI/Utility/NativeApiExtensions.cs
  2. +5
    -6
      TechbloxModdingAPI/Utility/OptionalRef.cs

+ 0
- 1
TechbloxModdingAPI/Utility/NativeApiExtensions.cs View File

@@ -1,5 +1,4 @@
using Svelto.ECS;
using TechbloxModdingAPI.Blocks;

namespace TechbloxModdingAPI.Utility
{


+ 5
- 6
TechbloxModdingAPI/Utility/OptionalRef.cs View File

@@ -5,14 +5,13 @@ using Svelto.ECS;

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
{
[FieldOffset(0)] private readonly State state;
[FieldOffset(1)] private readonly uint index;
[FieldOffset(5)] private NB<T> array;
[FieldOffset(5)] private MB<T> managedArray;
[FieldOffset(1)] private readonly EntityInitializer initializer;
private readonly State state;
private readonly uint index;
private NB<T> array;
private MB<T> managedArray;
private readonly EntityInitializer initializer;
//The possible fields are: (index && (array || managedArray)) || initializer

public OptionalRef(NB<T> array, uint index)


Loading…
Cancel
Save