SwiftCollections is a Unity package that provides high-performance, memory-efficient data structures optimized for game development and real-time applications.
This package is a Unity-specific implementation of the SwiftCollections library
- Optimized for Performance: Designed for low time complexity and minimal memory allocations.
- Versatile Use Cases: Suitable for data structures in 3D environments and complex spatial queries.
- Memory-Conscious Data Structures: Custom allocators and lightweight collections minimize GC pressure.
- Open Unity and navigate to Window → Package Manager.
- Click the + button and select Add package from git URL.
- Enter the following URL:
https://github.com/mrdav30/SwiftCollections-Unity.git
- Click Add and Unity will install the package automatically.
- Download the .unitypackage file from the latest release.
- Open Unity and import the package via Assets → Import Package → Custom Package....
- Select the downloaded file and import the contents.
SwiftCollections-Unity depends on the following Unity package:
This dependency is automatically included when installing via UPM.
var bvh = new SwiftBVH<int>(100);
var volume = new BoundingVolume(new Vector3(0, 0, 0), new Vector3(1, 1, 1));
bvh.Insert(1, volume);
var results = new List<int>();
bvh.Query(new BoundingVolume(new Vector3(0, 0, 0), new Vector3(2, 2, 2)), results);
Console.WriteLine(results.Count); // Output: 1var array2D = new Array2D<int>(10, 10);
array2D[3, 4] = 42;
Console.WriteLine(array2D[3, 4]); // Output: 42var queue = new SwiftQueue<int>(10);
queue.Enqueue(5);
Console.WriteLine(queue.Dequeue()); // Output: 5var array = new int[10].Populate(() => new Random().Next(1, 100));- .NET Framework: 4.7.2+
- Unity3D Version: 2022.3+
- Platforms: Windows, Linux, macOS, WebGL, Mobile
This project is licensed under the MIT License - see the LICENSE file
for details.
- mrdav30 - Lead Developer
- Contributions are welcome! Feel free to submit pull requests or report issues.
For questions or support, reach out to mrdav30 via GitHub or open an issue in the repository.