Ejemplo n.º 1
0
        void AddOrRemoveTargetFromModuleSelection(InteractionTarget target)
        {
            if (!m_CurrentSelection.Contains(target))
            {
                if (m_MaxSelectionCount == 0)
                {
                    return;
                }

                if (m_MaxSelectionCount > 0 && m_CurrentSelection.Count >= m_MaxSelectionCount)
                {
                    var targetToDeselect = m_CurrentSelection[0];
                    targetToDeselect.SetSelected(false);
                    m_CurrentSelection.RemoveAt(0);
                }

                m_CurrentSelection.Add(target);
                target.SetSelected(true);
            }
            else
            {
                m_CurrentSelection.Remove(target);
                target.SetSelected(false);
            }
        }