public void Close() { CloseInfopanel(); ExploringMinigameUI.Disable(); gameObject.SetActive(false); UIController.SetActivity(true); }
public ExploringMinigameUI GetExploringMinigameController() { if (exploringMinigameController == null) { exploringMinigameController = Instantiate(Resources.Load <GameObject>("UIPrefs/ExploringMinigameInterface"), transform).GetComponent <ExploringMinigameUI>(); } return(exploringMinigameController); }
private void OnDisable() { if (subscribedToUpdate) { if (UIController.current != null) { UIController.current.statusUpdateEvent -= StatusUpdate; } subscribedToUpdate = false; } ExploringMinigameUI.ActivateIfEnabled(); }
public void StartButton() { if (chosenPoint != null) { if (chosenPoint.type == MapMarkerType.FlyingExpedition) { var e = (chosenPoint as FlyingExpedition).expedition; if (e.stage == Expedition.ExpeditionStage.WayIn) { e.EndMission(); } } else { var poi = chosenPoint as PointOfInterest; if (poi != null) { if (poi.workingExpedition == null || poi.workingExpedition.stage != Expedition.ExpeditionStage.OnMission) { // send expedition var ob = Expedition.GetObserver(); infoPanelWidth = infoPanel.activeSelf ? infoPanel.GetComponent <RectTransform>().rect.width : 0f; float pw = (Screen.width - infoPanelWidth) * 0.95f, ph = Screen.height * 0.75f, sz = ph; if (pw < ph) { sz = pw; } if (!ob.gameObject.activeSelf) { ob.gameObject.SetActive(true); } ob.SetPosition(new Rect(pw, Screen.height / 2f, sz, sz), SpriteAlignment.RightCenter, false); ob.Show(poi); } else { ExploringMinigameUI.ShowExpedition(poi.workingExpedition, true); CloseInfopanel(); return; } } else { sendExpeditionButton.SetActive(false); } } } else { CloseInfopanel(); } }
public void MinigameButton() { if (showingExpedition == null || showingExpedition.stage != Expedition.ExpeditionStage.OnMission) { RedrawWindow(); } else { ExplorationPanelUI.Deactivate(); UIController.SetActivity(false); ExploringMinigameUI.ShowExpedition(showingExpedition, false); gameObject.SetActive(false); } }
public void StartButton() { if (chosenPoint != null) { if (chosenPoint.type == MapMarkerType.FlyingExpedition) { var e = (chosenPoint as FlyingExpedition).expedition; if (e.stage == Expedition.ExpeditionStage.WayIn) { e.EndMission(); } } else { var poi = chosenPoint as PointOfInterest; if (poi != null) { if (poi.workingExpedition == null || poi.workingExpedition.stage != Expedition.ExpeditionStage.OnMission) { // send expedition var rt = infoPanel.GetComponent <RectTransform>(); infoPanelWidth = infoPanel.activeSelf ? rt.rect.width * rt.localScale.x : 0f; float pw = (Screen.width - infoPanelWidth) * 0.95f, ph = Screen.height * 0.75f, sz = ph; if (pw < ph) { sz = pw; } UIExpeditionObserver.Show(mapCanvas.GetComponent <RectTransform>(), new Rect(Vector2.zero, sz * Vector2.one), SpriteAlignment.Center, poi, true); } else { ExploringMinigameUI.ShowExpedition(poi.workingExpedition, true); CloseInfopanel(); return; } } else { sendExpeditionButton.SetActive(false); } } } else { CloseInfopanel(); } }