void LobbyButton_Click(dfControl control, dfMouseEventArgs mouseEvent) { if (Slot1.GetComponent <BrainPanelState>().InUse || Slot2.GetComponent <BrainPanelState>().InUse || Slot3.GetComponent <BrainPanelState>().InUse || Slot4.GetComponent <BrainPanelState>().InUse) { Application.LoadLevel("Lobby scene"); } else { _dialog.ShowDialog("You must select at least one brain to use in battle before you can start fighting!" + "\n\nTo select a brain, simply drag it down to an empty slot in the 'Selected brains' panel."); } }
void slot1_DragDrop(dfControl control, dfDragEventArgs dragEvent) { dfPanel panel = control as dfPanel; BrainPanelState brainPanel = panel.GetComponent <BrainPanelState>(); if (draggedBrain != null) { if (draggedBrain.ChampionGene == null) { _dialog.ShowDialog("This brain has not been trained yet and cannot be used in battle mode."); brainPanel.Refresh(); return; } brainPanel.AddBrain(draggedBrain); BattleButton.Enable(); } }