Beispiel #1
0
        protected bool TryDeselect(int index)
        {
            var success = false;

            if (selectables != null && index >= 0 && index < selectables.Count)
            {
                var selectable = selectables[index];

                selectables.RemoveAt(index);

                if (selectable != null)
                {
                    selectable.InvokeOnDeslected(this);

                    if (onDeselected != null)
                    {
                        onDeselected.Invoke(selectable);
                    }

                    if (OnAnyDeselected != null)
                    {
                        OnAnyDeselected.Invoke(this, selectable);
                    }
                }

                success = true;
            }

            return(success);
        }
        public void InvokeOnDeslected(LeanSelect select)
        {
            if (onDeselected != null)
            {
                onDeselected.Invoke();
            }

            if (OnAnyDeselected != null)
            {
                OnAnyDeselected.Invoke(select, this);
            }
        }