Ejemplo n.º 1
0
 private void CalculateListHeight()
 {
     ListHeight = 0;
     for (var i = 0; i < _state.Count; i++)
     {
         ListHeight += EditorTween.GetHeight(_state[i]);
     }
 }
Ejemplo n.º 2
0
        public void Enable()
        {
            _tweensList = new ReorderableList(_state.Items as IList, typeof(Tween))
            {
                displayAdd            = true,
                displayRemove         = true,
                draggable             = true,
                showDefaultBackground = true,

                headerHeight = 3,
                footerHeight = 50,

                onAddCallback           = list => EditorTween.OnAddButton(_state),
                onRemoveCallback        = list => EditorTween.OnRemoveButton(_state, list.index),
                drawHeaderCallback      = rect => EditorGUI.LabelField(rect, string.Empty),
                drawElementCallback     = (rect, index, isActive, isFocused) => EditorTween.Draw(rect, _state[index]),
                elementHeightCallback   = index => EditorTween.GetHeight(_state[index].GetType()),
                drawNoneElementCallback = rect => EditorGUI.LabelField(rect, AddFirstTweenLabel)
            };

            CalculateListHeight();
        }
Ejemplo n.º 3
0
 public void OnTweenRemoving <T>(T tween) where T : Tween =>
 ListHeight -= EditorTween.GetHeight(tween);
Ejemplo n.º 4
0
 public void OnTweenAdded <T>(T tween) where T : Tween =>
 ListHeight += EditorTween.GetHeight(tween);