Click or drag to resize

Archon.SwissArmyLib.Utils Namespace

Contains various smaller utilities.
Classes
  ClassDescription
Public classBetterTime
A simple wrapper for Unity's Time that caches values to avoid the marshal overhead of each call. The performance benefit is very small, but completely free. Only readonly Time properties (except for FixedDeltaTime) are cached, but everything is wrapped anyway so you don't have to use multiple time classes. Since this is just a wrapper just refer to Unity's documentation about what each property does.
Public classColorUtils
Utility methods for Color.
Public classLazyT
Provides support for lazy initialization. If you're on .NET 4.0 or higher you might want to use System.Lazy instead.
Public classServiceLocator
A (somewhat) simple implementation of the service locator pattern. The ServiceLocator knows about MonoBehaviours and how to work with them. Creating scene-specific resolvers that only live as long as their respective scene is also supported.
Remarks
Please note that when you load a new scene, the MonoBehaviours in that scene will have their Awake() method called before their scene becomes the active one. This means you can't rely on SceneManager.GetActiveScene() to return the scene they're in, so you might want to use GameObject.scene to specify which scene to register the resolver for.
Enumerations
  EnumerationDescription
Public enumerationUpdateLoop
Unity's update loops.