예제 #1
0
        /************************************************************************************************************************/

        private void DoBorderGUI()
        {
            var size = _Rect.rectValue.size;

            _BorderFields[0].normalizeMultiplier = _BorderFields[2].normalizeMultiplier = 1f / size.x;
            _BorderFields[1].normalizeMultiplier = _BorderFields[3].normalizeMultiplier = 1f / size.y;

            TwinFloatField.DoGroupGUI(_Border, AnimancerGUI.TempContent("Border", BorderTooltip), _BorderFields);
        }
예제 #2
0
        /************************************************************************************************************************/

        private void DoRectGUI()
        {
            var texture = ((Sprite)target).texture;

            _RectFields[0].normalizeMultiplier = _RectFields[2].normalizeMultiplier = 1f / texture.width;
            _RectFields[1].normalizeMultiplier = _RectFields[3].normalizeMultiplier = 1f / texture.height;

            TwinFloatField.DoGroupGUI(_Rect, AnimancerGUI.TempContent("Rect", RectTooltip), _RectFields);
        }
예제 #3
0
        /************************************************************************************************************************/

        private void DoPivotGUI()
        {
            var showMixedValue = EditorGUI.showMixedValue;

            var targets = this.targets;
            var size    = targets[0] is Sprite sprite ? sprite.rect.size : Vector2.one;

            for (int i = 1; i < targets.Length; i++)
            {
                sprite = targets[i] as Sprite;
                if (sprite == null || sprite.rect.size != size)
                {
                    EditorGUI.showMixedValue = true;
                }
            }

            _PivotFields[0].normalizeMultiplier = 1f / size.x;
            _PivotFields[1].normalizeMultiplier = 1f / size.y;

            TwinFloatField.DoGroupGUI(_Pivot, AnimancerGUI.TempContent("Pivot", PivotTooltip), _PivotFields);

            EditorGUI.showMixedValue = showMixedValue;
        }