Example #1
0
        public void GameObjectWithIgnoreAttribIsNotSnapped()
        {
            var go = new GameObject();

            Assert.IsTrue(EditorUtility.SnapIsEnabled(go.transform));
            EditorUtility.ClearSnapEnabledCache();
            go.AddComponent <IgnoreSnap>();
            Assert.IsFalse(EditorUtility.SnapIsEnabled(go.transform));
            UObject.DestroyImmediate(go);
        }
Example #2
0
        public void GameObjectWithIgnoreInterfaceIsSnapped()
        {
            var go = new GameObject();

            Assert.IsTrue(EditorUtility.SnapIsEnabled(go.transform));
            var attrib = go.AddComponent <IgnoreSnapInterface>();

            EditorUtility.ClearSnapEnabledCache();
            attrib.snapEnabled = true;
            Assert.IsTrue(EditorUtility.SnapIsEnabled(go.transform));
            UObject.DestroyImmediate(go);
        }
Example #3
0
        public void GameObjectWithConditionalIgnoreAttribIsSnapped()
        {
            var go = new GameObject();

            Assert.IsTrue(EditorUtility.SnapIsEnabled(go.transform));
            var attrib = go.AddComponent <IgnoreSnapConditionalAttribute>();

            EditorUtility.ClearSnapEnabledCache();
            attrib.m_SnapEnabled = true;
            Assert.IsTrue(EditorUtility.SnapIsEnabled(go.transform));
            UObject.DestroyImmediate(go);
        }