Пример #1
0
        public ConditionCopyNonLazyBinder FromScriptableObjectResource(string resourcePath)
        {
            BindingUtil.AssertIsValidResourcePath(resourcePath);
            BindingUtil.AssertIsInterfaceOrScriptableObject(ContractType);

            ProviderFunc =
                (container) => new ScriptableObjectResourceProvider(
                    resourcePath, ContractType, container, BindInfo.Arguments,
                    false, null, BindInfo.InstantiatedCallback);

            return(this);
        }
Пример #2
0
        ScopeConcreteIdArgConditionCopyNonLazyBinder FromScriptableObjectInternal(
            ScriptableObject resource, bool createNew)
        {
            BindingUtil.AssertIsInterfaceOrScriptableObject(AllParentTypes);

            BindInfo.RequireExplicitScope = true;
            SubFinalizer = new ScopableBindingFinalizer(
                BindInfo,
                (container, type) => new ScriptableObjectInstanceProvider(
                    resource, type, container, BindInfo.Arguments, createNew,
                    BindInfo.ConcreteIdentifier, BindInfo.InstantiatedCallback));

            return(new ScopeConcreteIdArgConditionCopyNonLazyBinder(BindInfo));
        }