public override void SelectElement(int index, bool isDispatchSelectedChangeEvent = true) { if (this.m_isMultiSelected) { bool flag = this.m_multiSelected[index]; flag = !flag; if (this.MultiLimitCheckStep1(index, flag)) { return; } this.m_multiSelected[index] = flag; CUIListElementScript elemenet = base.GetElemenet(index); if (elemenet != null) { elemenet.ChangeDisplay(flag); } this.MultiLimitCheckStep2(); base.DispatchElementSelectChangedEvent(); } else { if (index == this.m_selected) { if (this.m_alwaysDispatchSelectedChangeEvent) { base.DispatchElementSelectChangedEvent(); } return; } if (this.m_selected >= 0) { CUIListElementScript elemenet2 = base.GetElemenet(this.m_selected); if (elemenet2 != null) { elemenet2.ChangeDisplay(false); } } this.m_selected = index; if (this.m_selected >= 0) { CUIListElementScript elemenet3 = base.GetElemenet(this.m_selected); if (elemenet3 != null) { elemenet3.ChangeDisplay(true); } } base.DispatchElementSelectChangedEvent(); } }
public override void SelectElement(int index, bool isDispatchSelectedChangeEvent = true) { if (this.m_selectingState != enExpandListSelectingState.None) { return; } this.m_lastSelectedElementIndex = this.m_selectedElementIndex; this.m_selectedElementIndex = index; if (this.m_lastSelectedElementIndex == this.m_selectedElementIndex) { this.m_selectedElementIndex = -1; } if (this.m_lastSelectedElementIndex >= 0) { CUIListElementScript elemenet = base.GetElemenet(this.m_lastSelectedElementIndex); if (elemenet != null) { elemenet.ChangeDisplay(false); } } if (this.m_selectedElementIndex >= 0) { CUIListElementScript elemenet2 = base.GetElemenet(this.m_selectedElementIndex); if (elemenet2 != null) { elemenet2.ChangeDisplay(true); if (elemenet2.onSelected != null) { elemenet2.onSelected(); } } } base.DispatchElementSelectChangedEvent(); this.m_contentAnchoredPosition = this.m_contentRectTransform.anchoredPosition; this.m_timeSlice = 0f; if (this.m_lastSelectedElementIndex >= 0) { this.m_selectingState = enExpandListSelectingState.Retract; } else if (this.m_selectedElementIndex >= 0) { this.m_targetContentAnchoredPosition = this.GetTargetContentAnchoredPosition(this.m_selectedElementIndex); this.m_selectingState = enExpandListSelectingState.Move; this.m_timeSlice = 0f; } }
public override void SelectElement(int index, bool isDispatchSelectedChangeEvent = true) { if (this.m_isMultiSelected) { bool selected = this.m_multiSelected[index]; selected = !selected; this.m_multiSelected[index] = selected; CUIListElementScript elemenet = base.GetElemenet(index); if (elemenet != null) { elemenet.ChangeDisplay(selected); } base.DispatchElementSelectChangedEvent(); } else if (index == this.m_selected) { if (base.m_alwaysDispatchSelectedChangeEvent) { base.DispatchElementSelectChangedEvent(); } } else { if (this.m_selected >= 0) { CUIListElementScript script2 = base.GetElemenet(this.m_selected); if (script2 != null) { script2.ChangeDisplay(false); } } this.m_selected = index; if (this.m_selected >= 0) { CUIListElementScript script3 = base.GetElemenet(this.m_selected); if (script3 != null) { script3.ChangeDisplay(true); } } base.DispatchElementSelectChangedEvent(); } }
public virtual void SelectElement(int index, bool isDispatchSelectedChangeEvent = true) { this.m_lastSelectedElementIndex = this.m_selectedElementIndex; this.m_selectedElementIndex = index; if (this.m_lastSelectedElementIndex == this.m_selectedElementIndex) { if (this.m_alwaysDispatchSelectedChangeEvent) { this.DispatchElementSelectChangedEvent(); } } else { if (this.m_lastSelectedElementIndex >= 0) { CUIListElementScript elemenet = this.GetElemenet(this.m_lastSelectedElementIndex); if (elemenet != null) { elemenet.ChangeDisplay(false); } } if (this.m_selectedElementIndex >= 0) { CUIListElementScript script2 = this.GetElemenet(this.m_selectedElementIndex); if (script2 != null) { script2.ChangeDisplay(true); if (script2.onSelected != null) { script2.onSelected(); } } } if (isDispatchSelectedChangeEvent) { this.DispatchElementSelectChangedEvent(); } } }