/// <summary> /// 当被选中 /// </summary> /// <param UIName="ctrl"></param> public void OnSelected(CtrlHandler ctrl) { switch (ctrl) { case CtrlHandler.P1: currentButton1P = this; if (SelectedShow1P) { ILtButtonCtrl ltButtonCtrl = SelectedShow1P.GetComponent <ILtButtonCtrl>(); if (ltButtonCtrl != null) { ltButtonCtrl.OnSelected(); } } UpdateAdd1PList(); break; case CtrlHandler.P2: currentButton2P = this; if (SelectedShow2P != null) { ILtButtonCtrl ltButtonCtrl = SelectedShow2P.GetComponent <ILtButtonCtrl>(); if (ltButtonCtrl != null) { ltButtonCtrl.OnSelected(); } } UpdateAdd2PList(); break; } }
void UpdateREmove2PList() { if (this.CtrlType == SelecteType.All && CanBothSelecte == false) { if (s_List2P.Count > 0) { ButtonEx button = s_List2P[0]; if (button.SelecteLayer == this.SelecteLayer && !s_List2P.Contains(this)) { s_List2P.Add(this); } } } }