/// <summary> /// 子面板切换 /// </summary> /// <param name="state"></param> private void PanelOnChange(WarshipPanelState state, MsgWarshipPanelState data = null) { m_CurrentState = state; switch (state) { case WarshipPanelState.Main: break; case WarshipPanelState.ModMainShip: case WarshipPanelState.ModMainWeapon: UIManager.Instance.OpenPanel(UIPanel.WarshipModPanel, data); break; case WarshipPanelState.ListWeapon: UIManager.Instance.OpenPanel(UIPanel.WarshipListPanel, data); break; case WarshipPanelState.ListMod: UIManager.Instance.OpenPanel(UIPanel.WarshipChipPanel, data); break; case WarshipPanelState.ListReformer: UIManager.Instance.OpenPanel(UIPanel.WarshipReformerPanel, data); break; case WarshipPanelState.ListEquip: switch ((EquipmentL1)data.CurrentEquipmentData.ContainerPOS + 1) { case EquipmentL1.Processor: UIManager.Instance.OpenPanel(UIPanel.WarshipProcessorPanel, data); break; case EquipmentL1.Armor: UIManager.Instance.OpenPanel(UIPanel.WarshipArmorPanel, data); break; case EquipmentL1.Reactor: UIManager.Instance.OpenPanel(UIPanel.WarshipReactorPanel, data); break; case EquipmentL1.AuxiliaryUnit: UIManager.Instance.OpenPanel(UIPanel.WarshipAuxiliaryUnitPanel, data); break; case EquipmentL1.Nanobot: UIManager.Instance.OpenPanel(UIPanel.WarshipNanobotPanel, data); break; case EquipmentL1.SignalGenerator: UIManager.Instance.OpenPanel(UIPanel.WarshipSignalGeneratorPanel, data); break; default: break; } break; } }
public void OnRefresh(object msg) { MsgWarshipPanelState data = msg as MsgWarshipPanelState; m_BeforeState = data.BeforeState; m_CurrentState = data.State; m_CurrentShip = data.CurrentShip; uint count = 0; uint modPosId = 0; switch (m_CurrentState) { case WarshipPanelState.ModMainShip: count = m_CurrentShip.GetGeneralModContainer().GetCurrentSizeMax() + m_CurrentShip.GetExclusivelyModContainer().GetCurrentSizeMax(); modPosId = (uint)m_CurrentShip.GetConfig().ModPosition; break; case WarshipPanelState.ModMainWeapon: m_CurrentWeapon = data.CurrentWeaponData.Data; m_WeaponContainerUID = data.CurrentWeaponData.ContainerUID; m_WeaponContainerPOS = data.CurrentWeaponData.ContainerPOS; count = data.CurrentWeaponData.Data.GetGeneralModContainer().GetCurrentSizeMax() + data.CurrentWeaponData.Data.GetExclusivelyModContainer().GetCurrentSizeMax(); modPosId = (uint)data.CurrentWeaponData.Data.GetConfig().ModPosition; break; } SendViewerChange(); // SetTips(); CheckModBtnCount(count, modPosId); if (data.CurrentModData != null) { //SelectMod(data.CurrentModData.ContainerUID, data.CurrentModData.ContainerPOS); } else { //SelectMod(m_ModCellList[0]); } State.SetTipData(null); EventSystem.current.SetSelectedGameObject(null); }