예제 #1
0
        private void OnEnable()
        {
#if UNITY_EDITOR
            Vector2[] uv = null;
            foreach (var group in _groups)
            {
                foreach (var feature in group.features)
                {
                    LeapSpriteFeature spriteFeature = feature as LeapSpriteFeature;
                    if (spriteFeature != null)
                    {
                        foreach (var data in spriteFeature.featureData)
                        {
                            uv = data.sprite.uv;
                        }
                    }
                }
            }
#endif

            if (Application.isPlaying)
            {
                if (_space != null)
                {
                    _space.RebuildHierarchy();
                    _space.RecalculateTransformers();
                }

                foreach (var group in _groups)
                {
                    group.OnEnable();
                }
            }
        }
예제 #2
0
        private void OnEnable()
        {
#if UNITY_EDITOR
            Vector2[] uv = null;
            foreach (var group in _groups)
            {
                foreach (var feature in group.features)
                {
                    LeapSpriteFeature spriteFeature = feature as LeapSpriteFeature;
                    if (spriteFeature != null)
                    {
                        foreach (var data in spriteFeature.featureData)
                        {
                            uv = data.sprite.uv;
                        }
                    }
                }
            }

            UnityEditor.Undo.undoRedoPerformed -= onUndoRedoPerformed;
            UnityEditor.Undo.undoRedoPerformed += onUndoRedoPerformed;
#endif

            if (Application.isPlaying)
            {
                if (_space != null)
                {
                    _space.RebuildHierarchy();
                    _space.RecalculateTransformers();
                    _lastSpaceWasNull = false;
                }

                foreach (var group in _groups)
                {
                    group.OnEnable();
                }
            }
        }