Issue You have a component that derives from MonoBehaviour<T…> or implements IInitializable<T…>, but you don’t want the Init section to be drawn in the Inspector. One possible reason for this could be that the component only needs to receive Init arguments when it is being initialized at runtime using AddComponent, but never when it is ..
Category : 9. Problems & Solutions
Issue Due to a limitation with Unity’s serialization system, embedded value providers cannot be serialized directly as part of prefab assets. Solution 1: Create Asset You can get around this limitation by adding the [CreateAssetMenu] attribute to your value provider, and creating assets to back them. You can then drag-and-drop the value provider assets into ..
Problem You have a base class that depends on some services. You want to create a class that derives from that base class, which depends on some additional services on top of the ones that the base class does. class Base : MonoBehaviour<A, B> { // The base class depends on some services A a; ..
Issue Init(args) only supports passing a maximum of twelve arguments to a component that derives from MonoBehaviour<T…> or implements IInitializable<T…> during its initialization. What can you do if you have a legacy class that depends on more than twelve external objects, and you want to refactor the class to derive from MonoBehaviour<T…> and receive those ..
Issue When launching the game, a service does not get injected to any of its clients as expected, and an warning similar to the following can be seen in the Console window: Invalid Service Definition: Class of the registered instance ‘MyService’ does not implement the defining interface type of the service ‘IMyInterface’. UnityEngine.Debug:LogWarning (object) Sisus.Init.ServiceUtility:SetInstance ..
Issue An initializable component does not receive the objects that it depends on in its Init method during its initialization. Cause: Not All Dependencies Are Services One possible reason for this is that the component depends on one or more objects that have not been registered as services. Components that derive from MonoBehaviour<T…> can only ..