Ejemplo n.º 1
0
        public void GetComponentInHierarchyTest_ComponentInParet_DontIncludeInactive_SetInactive()
        {
            GetComponentInHierarchyTester tester = Setup(false, true, false);
            TestComponent result = tester.Run();

            Assert.IsNull(result);
        }
Ejemplo n.º 2
0
        public void GetComponentInHierarchyTest_ComponentInChild_IncludeInactive_SetInactive()
        {
            GetComponentInHierarchyTester tester = Setup(true, false, false);
            TestComponent result = tester.Run();

            Assert.NotNull(result);
        }
Ejemplo n.º 3
0
        public void GetComponentInHierarchyTest_ComponentInParet_IncludeInactive_SetActive()
        {
            GetComponentInHierarchyTester tester = Setup(incluneInactive: true, componentInParent: true, setActive: true);
            TestComponent result = tester.Run();

            Assert.NotNull(result);
        }
Ejemplo n.º 4
0
        private GetComponentInHierarchyTester Setup(bool incluneInactive, bool componentInParent, bool setActive)
        {
            _paret      = new GameObject();
            _child      = new GameObject();
            _grandChild = new GameObject();

            _child.transform.parent      = _paret.transform;
            _grandChild.transform.parent = _child.transform;

            GetComponentInHierarchyTester tester = _child.AddComponent <GetComponentInHierarchyTester>();

            tester.Setup(incluneInactive, componentInParent, setActive);

            return(tester);
        }