public void ShowEnableEffect(GameObject effect, MainUI.UIType funcType) { if (m_btnEnableEffect != null) { Destroy(m_btnEnableEffect); } LocalSysButton btnComponent = null;// = btnArray.Single(P => P.ButtonFunc == funcType); for (int i = 0; i < btnArray.Count; i++) { if (btnArray[i].ButtonFunc == funcType) { btnComponent = btnArray[i]; } } if (btnComponent != null) { m_btnEnableEffect = Instantiate(effect) as GameObject; m_btnEnableEffect.transform.parent = btnComponent.transform; m_btnEnableEffect.transform.localScale = Vector3.one; m_btnEnableEffect.transform.localPosition = Vector3.zero; } }
public void RemoveFuntionButton(MainUI.UIType BtnType, MainBtnArea btnPos)//移除按钮 { if (!MyBtnEneble) { return; } switch (btnPos) { case MainBtnArea.TopLeft: if (SysButtonPanel_TopLeft.ContainsButton(BtnType)) { SysButtonPanel_TopLeft.RemoveButton(BtnType); } break; case MainBtnArea.TopRight: if (SysButtonPanel_TopRight.ContainsButton(BtnType)) { SysButtonPanel_TopRight.RemoveButton(BtnType); } break; case MainBtnArea.bottomRight: if (SysButtonPanel_BottomRight.ContainsButton(BtnType)) { SysButtonPanel_BottomRight.RemoveButton(BtnType); } break; default: break; } }
public bool ContainsButton(MainUI.UIType ButtonType) { foreach (LocalSysButton child in btnArray) { if (child.ButtonFunc == ButtonType) { return(true); } } return(false); }
public void RemoveButton(MainUI.UIType sysBtnType)//移除功能按钮 { foreach (LocalSysButton child in btnArray) { if (child.ButtonFunc == sysBtnType) { btnArray.Remove(child); child.DestroyMyself(); ResetBtnPosition(); break; } } }
public void StopBtnAnimation(MainUI.UIType buttonType) { btnArray.ApplyAllItem(P => P.StopBtnAnim(buttonType)); }
public void PlayBtnAnimation(MainUI.UIType buttonType) { //TraceUtil.Log("播放按钮动画:"+buttonType+","+btnArray.Count); btnArray.ApplyAllItem(P => P.PlayBtnAnim(buttonType)); }
public void HideBtnEffect(MainUI.UIType buttonType) { btnArray.ApplyAllItem(P => P.HideBtnEff(buttonType)); }