コード例 #1
0
 public static IDManager Create(Allocator allocator)
 {
     return(new IDManager
     {
         idToIndex = new UnsafeList <IndexLookup>(1024, allocator),
         indexToID = new UnsafeList <int>(1024, allocator),
         sectionManager = SectionManager.Create(allocator),
         freeIDs = new UnsafeList <int>(1024, allocator)
     });
 }
コード例 #2
0
 public void Dispose()
 {
     if (idToIndex.IsCreated)
     {
         idToIndex.Dispose();
     }
     idToIndex = default;
     if (indexToID.IsCreated)
     {
         indexToID.Dispose();
     }
     indexToID = default;
     if (sectionManager.IsCreated)
     {
         sectionManager.Dispose();
     }
     sectionManager = default;
     if (freeIDs.IsCreated)
     {
         freeIDs.Dispose();
     }
     freeIDs = default;
 }