コード例 #1
0
ファイル: BinderUntyped.cs プロジェクト: hexgrimm/Zenject
        public BindingConditionSetter ToSingle(string identifier)
        {
            if (_contractType.DerivesFrom(typeof(MonoBehaviour)))
            {
                throw new ZenjectBindException(
                          "Should not use ToSingle for Monobehaviours (when binding type '{0}'), you probably want either ToLookup or ToSingleFromPrefab or ToSingleGameObject"
                          .Fmt(_contractType.Name()));
            }

            return(ToProvider(_singletonMap.CreateProviderFromType(identifier, _contractType)));
        }
コード例 #2
0
ファイル: TypeBinder.cs プロジェクト: Avatarchik/OutOfTheBox
        public BindingConditionSetter ToSingle(string concreteIdentifier)
        {
#if !ZEN_NOT_UNITY3D
            if (ContractType.DerivesFrom(typeof(Component)))
            {
                throw new ZenjectBindException(
                          "Should not use ToSingle for Monobehaviours (when binding type '{0}'), you probably want either ToLookup or ToSinglePrefab or ToSingleGameObject"
                          .Fmt(ContractType.Name()));
            }
#endif

            return(ToProvider(_singletonMap.CreateProviderFromType(concreteIdentifier, ContractType)));
        }