Пример #1
0
    public List <IBinding> GetBindings()
    {
        BindingBuilder bb = new BindingBuilder();

        bb.BindExistingInstance(ApplicationManager.Instance);
        bb.BindExistingInstance(SceneNavigator.Instance);
        bb.BindExistingInstance(SettingsManager.Instance);
        bb.BindExistingInstance(SongMetaManager.Instance);
        bb.BindExistingInstance(ThemeManager.Instance);
        bb.BindExistingInstance(CursorManager.Instance);
        bb.BindExistingInstance(UiManager.Instance);
        bb.BindExistingInstance(MidiManager.Instance);
        bb.BindExistingInstance(AudioManager.Instance);
        bb.BindExistingInstance(I18NManager.Instance);

        EventSystem eventSystem = GameObjectUtils.FindComponentWithTag <EventSystem>("EventSystem");

        bb.BindExistingInstance(eventSystem);

        // Lazy binding of settings, because they are not needed in every scene and loading the settings takes time.
        bb.BindExistingInstanceLazy(() => SettingsManager.Instance.Settings);
        bb.BindExistingInstanceLazy(() => StatsManager.Instance.Statistics);

        return(bb.GetBindings());
    }
    public List <IBinding> GetBindings()
    {
        BindingBuilder bb = new BindingBuilder();

        bb.BindExistingInstance(this);
        bb.BindExistingInstanceLazy(() => LazyInjectionDemo.Instance);
        bb.Bind("author").ToExistingInstance("Tolkien");
        bb.Bind(typeof(int)).ToExistingInstance(42);
        bb.Bind("personWithAge").ToExistingInstance("Bob");
        bb.Bind(typeof(IDependencyInjectionDemoInterface)).ToNewInstancesOfType(typeof(DependencyInjectionDemoInterfaceImpl));
        bb.Bind(typeof(IDependencyInjectionDemoInterfaceWithConstructorParameters)).ToSingleInstanceOfType(typeof(DependencyInjectionDemoInterfaceWithConstructorParametersImpl));
        return(bb.GetBindings());
    }
Пример #3
0
    public List <IBinding> GetBindings()
    {
        BindingBuilder bb = new BindingBuilder();

        bb.BindExistingInstance(ApplicationManager.Instance);
        bb.BindExistingInstance(SceneNavigator.Instance);
        bb.BindExistingInstance(SettingsManager.Instance);
        bb.BindExistingInstance(SongMetaManager.Instance);
        bb.BindExistingInstance(ThemeManager.Instance);

        // Lazy binding of settings, because they are not needed in every scene and loading the settings takes time.
        bb.BindExistingInstanceLazy(() => SettingsManager.Instance.Settings);

        return(bb.GetBindings());
    }
Пример #4
0
    public List <IBinding> GetBindings()
    {
        BindingBuilder bb = new BindingBuilder();

        bb.BindExistingInstance(ApplicationManager.Instance);
        bb.BindExistingInstance(SettingsManager.Instance);
        bb.BindExistingInstance(CoroutineManager.Instance);
        bb.BindExistingInstance(ClientSideConnectRequestManager.Instance);
        bb.BindExistingInstance(ClientSideMicSampleRecorder.Instance);
        bb.BindExistingInstance(ClientSideMicDataSender.Instance);

        // Lazy binding of settings, because they are not needed in every scene and loading the settings takes time.
        bb.BindExistingInstanceLazy(() => SettingsManager.Instance.Settings);

        return(bb.GetBindings());
    }