コード例 #1
0
        public ConditionCopyNonLazyBinder FromScriptableObjectResource(string resourcePath)
        {
            BindingUtil.AssertIsValidResourcePath(resourcePath);
            BindingUtil.AssertIsInterfaceOrScriptableObject(ContractType);

            ProviderFunc =
                (container) => new ScriptableObjectResourceProvider(
                    resourcePath, ContractType, container, null, new List <TypeValuePair>(), false);

            return(this);
        }
コード例 #2
0
        ScopeArgConditionCopyNonLazyBinder FromScriptableObjectResourceInternal(
            string resourcePath, bool createNew)
        {
            BindingUtil.AssertIsValidResourcePath(resourcePath);
            BindingUtil.AssertIsInterfaceOrScriptableObject(AllParentTypes);

            BindInfo.RequireExplicitScope = true;
            SubFinalizer = new ScopableBindingFinalizer(
                BindInfo,
                createNew ? SingletonTypes.FromNewScriptableObjectResource : SingletonTypes.FromScriptableObjectResource,
                resourcePath.ToLower(),
                (container, type) => new ScriptableObjectResourceProvider(
                    resourcePath, type, container, BindInfo.ConcreteIdentifier, BindInfo.Arguments, createNew));

            return(new ScopeArgConditionCopyNonLazyBinder(BindInfo));
        }