Collection of helpful utilities we use in our Unity projects.
.. image:: https://raw.githubusercontent.com/ArchonInteractive/SwissArmyLib/master/logo.png
.. image:: https://ci.appveyor.com/api/projects/status/sapkbwkbl5ug901u/branch/master?svg=true :alt: Build status :target: https://ci.appveyor.com/project/Phault/swissarmylib/branch/master
.. image:: https://readthedocs.org/projects/swissarmylib-docs/badge/?version=latest :alt: Documentation Status :target: http://swissarmylib-docs.readthedocs.io/en/latest/?badge=latest
.. image:: https://api.bintray.com/packages/phault/SwissArmyLib/development/images/download.svg :alt: Download :target: https://bintray.com/phault/SwissArmyLib/development/_latestVersion#files
API Reference <https://casperlindschouw.com/swissarmylib/>
_
SwissArmyLib is an attempt to create a collection of useful utilities with a focus on being performant. It is primarily intended for Unity projects, but feel free to rip parts out and use them for whatever you want.
A very important part in the design decisions of this library was to keep the garbage generation low. This means you will probably frown a little upon the use of interfaces for callbacks, instead of just using delicious delegates. It also means using the trusty old for loops for iterating through collections where possible.
There's a lot of libraries with some of the same features, but they're often walled off behind a restrictive or ambiguous license. This project is under the very permissive MIT license and we honestly do not care what you use it for.
Events_
Timers_
Coroutines_
Automata_
Finite State Machine
_Pushdown Automaton
_Pooling_
Support for both arbitrary classes and GameObjects
IPoolable_ interface for callbacks
Timed despawns
Service Locator
_
An implementation of the Service Locator pattern
Aware of MonoBehaviours and how to work with them
Supports scene-specific resolvers
Supports both singletons and short-lived objects
Managed Update Loop
_
overhead of Native C++ --> Managed C# <https://blogs.unity3d.com/2015/12/23/1k-update-calls/>
_Spatial Partitioning
_
Resource Pool
_
Gravity
Misc
BetterTime_
Shake
Some collection types
_
Some useful attributes
_
ExecutionOrder_
ReadOnly_
A few other tiny utilities
Download
Binaries for the bleeding edge can be found `here <download_>`_.
Alternatively you can either `build it yourself <building_>`_ (very easily) or simply `copy the source code into your Unity project <copysource_>`_ and call it a day.
License
~~~~~~~
`MIT <https://tldrlegal.com/license/mit-license>`_ - Do whatever you want. :)
Contributing
Pull requests are very welcome!
I might deny new features if they're too niche though, but it's still very much appreciated!
If you're looking for a way to contribute, please consider helping with the documentation at this repository <https://github.com/ArchonInteractive/SwissArmyLib-docs>
_.
.. _download: https://bintray.com/phault/SwissArmyLib/development/_latestVersion#files .. _building: https://swissarmylib-docs.readthedocs.io/en/latest/Getting%20Started.html#building-the-source .. _copysource: https://swissarmylib-docs.readthedocs.io/en/latest/Getting%20Started.html#method-2-copy-source
.. _Events: https://swissarmylib-docs.readthedocs.io/en/latest/Events/Event.html .. _GlobalEvents: https://swissarmylib-docs.readthedocs.io/en/latest/Events/GlobalEvents.html .. _Timers: https://swissarmylib-docs.readthedocs.io/en/latest/Events/TellMeWhen.html .. _Coroutines: https://swissarmylib-docs.readthedocs.io/en/latest/Coroutines/BetterCoroutines.html .. _Automata: https://swissarmylib-docs.readthedocs.io/en/latest/Automata/index.html .. _Finite State Machine: https://swissarmylib-docs.readthedocs.io/en/latest/Automata/Finite%20State%20Machine.html .. _Pushdown Automaton: https://swissarmylib-docs.readthedocs.io/en/latest/Automata/Pushdown%20Automaton.html .. _Pooling: https://swissarmylib-docs.readthedocs.io/en/latest/Pooling/index.html .. _IPoolable: https://swissarmylib-docs.readthedocs.io/en/latest/Pooling/IPoolable.html .. _PoolableGroup: https://swissarmylib-docs.readthedocs.io/en/latest/Pooling/PoolableGroup.html .. _Service Locator: https://swissarmylib-docs.readthedocs.io/en/latest/Utils/Service%20Locator.html .. _Managed Update Loop: https://swissarmylib-docs.readthedocs.io/en/latest/Events/ManagedUpdate.html .. _ManagedUpdateBehaviour: https://swissarmylib-docs.readthedocs.io/en/latest/Events/ManagedUpdateBehaviour.html .. _Spatial Partitioning: https://swissarmylib-docs.readthedocs.io/en/latest/Partitioning/index.html .. _Resource Pool: https://swissarmylib-docs.readthedocs.io/en/latest/Resource%20System/index.html .. _BetterTime: https://swissarmylib-docs.readthedocs.io/en/latest/Utils/BetterTime.html .. _Some collection types: https://swissarmylib-docs.readthedocs.io/en/latest/Collections/index.html .. _Some useful attributes: https://swissarmylib-docs.readthedocs.io/en/latest/Utils/Attributes/index.html .. _ExecutionOrder: https://swissarmylib-docs.readthedocs.io/en/latest/Utils/Attributes/ExecutionOrder.html .. _ReadOnly: https://swissarmylib-docs.readthedocs.io/en/latest/Utils/Attributes/ReadOnly.html