public void OnPreviewGUI(Rect rect, Object target)
        {
            //skip 'rect (0, 0, 1, 1)' issue
            if (rect.width <= 1 || rect.height <= 1)
            {
                return;
            }

            //for mulriple preview
            Sprite sprite             = (Sprite)target;
            bool   hasMultipleTargets = _targets.Length > 1;

            _preview.Show(rect, sprite, _configData, hasMultipleTargets);
        }
Ejemplo n.º 2
0
        public void OnPreviewGUI(Rect rect, Sprite baseSprite, Sprite dummySprite, TextureInfo textureInfo)
        {
            //skip 'rect (0, 0, 1, 1)' issue
            if (rect.width <= 1 || rect.height <= 1)
            {
                return;
            }

            //for multiple preview
            bool hasMultipleTargets = Selection.objects.Length > 1;

            if (_isPreviewChanged || _preview.Rect != rect || hasMultipleTargets)
            {
                _preview.Update(rect, baseSprite, dummySprite, textureInfo, _configData);
                _isPreviewChanged = false;
            }

            _preview.Show(hasMultipleTargets);
        }