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 ..
Category : 9. Problems & Solutions
Issue You have a base class that depends on some services. You want to create a class that derives from that base class, and depends on some additional services on top of the ones that the base class does. class Base : MonoBehaviour { // The base class itself could depend on some services 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 A client component that derives from MonoBehaviour<T…>, does not receive any services via its Init method. Cause #1: using Awake One possible reason for this, is that an Awake method has been defined in the client’s class. If this is is done, it will prevent the Awake method in the base class from being ..