Пример #1
0
        public void TestPrefabResourceSelfSingle1()
        {
            Container.Bind <GameObject>().FromPrefabResource("BindGameObject/Cube").WithGameObjectName(GameObjName).AsSingle();

            FixtureUtil.AssertNumGameObjects(Container, 1);
            FixtureUtil.AssertNumGameObjectsWithName(Container, GameObjName, 1);

            FixtureUtil.AddInitMethod(Container, (GameObject gameObject) =>
            {
                Assert.IsNotNull(gameObject.GetComponent <BoxCollider>());
            });
        }
Пример #2
0
        public void TestPrefabConcreteSingle1()
        {
            Container.Bind <UnityEngine.Object>().To <GameObject>()
            .FromPrefab(CubePrefab).WithGameObjectName(GameObjName).AsSingle();

            FixtureUtil.AssertNumGameObjects(Container, 1);
            FixtureUtil.AssertNumGameObjectsWithName(Container, GameObjName, 1);

            FixtureUtil.AddInitMethod(Container, (UnityEngine.Object obj) =>
            {
                Assert.IsNotNull(((GameObject)obj).GetComponent <BoxCollider>());
            });
        }