Nixi
Retroseed Studio
$0.0
(no ratings)
Date |
Price |
---|---|
日期和时间 |
价钱($) |
02/10(2022) |
0.0 |
11/18(2024) |
0.0 |
Jump AssetStore
Library designed to approach the principles of clean coding and to simplify writing tests when developing on Unity using Unity dependency injection as well as the more classic dependency injection.Nixi is a library that was designed primarily to approach the principles of clean coding and to simplify writing tests when developing on Unity using Unity dependency injection as well as the more classic dependency injection.It makes it easier to write and test classes derived from MonoBehaviour class while keeping the principles of encapsulation to be able to expose only what needs to be exposed.There are specific field decorators (named Nixi attributes), with which it is possible to inject according to two different approaches :From Unity dependency injection systems such as : GetComponent, GetComponentInChildren, etc.From a simple IOC container (NixiContainer) filled in advance from a class that takes priority over the others.The Nixi attributes are intended to be used during "play mode scene" and can also be reused in tests to follow the evolution of these fields and/or mock where it is useful, including non-public fields.These reuses and accesses during testing are intended to simulate and verify Unity context (GetComponent, GetComponentInChildren, etc.), as well as to simulate interfaces that have been decorated for injection from NixiContainer (or decorated with SerializeField). This is only allowed for these cases, no others.Nixi is an open source project under the MIT license.You can find github project on this link :https://github.com/f-antoine/NixiCreate a class derived from MonoBehaviourInjectable class (derived from MonoBehaviour, handling dependency injection during the Awake call) that can be agenced and tested more easily without exposing all the variables.No need to SerializeField many fields and/or write workarounds to test the code, Nixi decorators are used to replicate the Unity dependency injection behaviours based on your settings and a test template is provided to identify these parameters and simulate situations without having to launch scenes for testing.Unity dependency injection can be used to directly search for components that implement an interface instead of an implementation, it is also possible to work on interfaces with Nixi decorators to find these Unity components.A simple container (NixiContainer) is provided in this library, to map singletons and transients, allowing you to inject an implementation generated by this container into an interface field that is not primarily about Unity components.It is possible to register elements from the scene in the NixiContainer to reduce the back and forth between the scene and the code and thus be able to focus on the essentials.E.g : you can pass all ScriptableObjects concerning monsters in a SO_MonsterContainer class, then register it in the NixiContainer and call it from other locations, this avoids loading everything from the resources folder or other approaches that could cost machine resources.