예제 #1
0
        public void WeCanFindTheFirstComponentOfAGivenType()
        {
            TestComponent comp = new TestComponent();

            child.AddComponent(comp);

            UnityObject cmp = UnityObject.FindObjectOfType(typeof(TestComponent));

            Assert.That(cmp, Is.Not.Null);
        }
예제 #2
0
        void CheckPersistentCanvas()
        {
            if (m_RootUIPersistentCanvas == null)
            {
                var uiManager = UnityObject.FindObjectOfType <DebugUIHandlerPersistentCanvas>();

                if (uiManager == null)
                {
                    m_PersistentRoot      = UnityObject.Instantiate(Resources.Load <Transform>("DebugUI Persistent Canvas")).gameObject;
                    m_PersistentRoot.name = "[Debug Canvas - Persistent]";
                    m_PersistentRoot.transform.localPosition = Vector3.zero;
                }
                else
                {
                    m_PersistentRoot = uiManager.gameObject;
                }

                m_RootUIPersistentCanvas = m_PersistentRoot.GetComponent <DebugUIHandlerPersistentCanvas>();
            }
        }
예제 #3
0
        private static bool checkRigidHands(out GameObject[] rigidHandObjects)
        {
            if (LeapProjectChecks.CheckIgnoredKey(IGNORE_RIGID_HANDS_CHECK_KEY))
            {
                rigidHandObjects = null;
                return(true);
            }

            rigidHandObjects = UnityObject.FindObjectsOfType <RigidHand>().Query()
                               .Select(x => x.gameObject).ToArray();
            if (rigidHandObjects.Length != 0 &&
                UnityObject.FindObjectOfType <InteractionManager>() != null)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }