private void OnDisable()
 {
     if (globalMap != null)
     {
         globalMap.MapInterfaceDisabled();
     }
     UIExpeditionObserver.DisableObserver();
 }
Beispiel #2
0
 public void StartMission()
 {
     stage = ExpeditionStage.OnMission;
     changesMarkerValue++;
     GlobalMapCanvasController.needExpeditionsRedraw = true;
     UIExpeditionObserver.Refresh();
     expeditionsLaunched++;
 }
Beispiel #3
0
 public static UIExpeditionObserver GetObserver()
 {
     if (_currentObserver == null)
     {
         _currentObserver = Instantiate(Resources.Load <GameObject>("UIPrefs/expeditionPanel"),
                                        UIController.GetCurrent().GetCurrentCanvasTransform()).GetComponent <UIExpeditionObserver>();
     }
     return(_currentObserver);
 }
Beispiel #4
0
 public static UIExpeditionObserver GetObserver()
 {
     if (_observer == null)
     {
         _observer = GameObject.Instantiate(Resources.Load <GameObject>("UIPrefs/expeditionPanel"),
                                            UIController.current.mainCanvas).GetComponent <UIExpeditionObserver>();
     }
     return(_observer);
 }
 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();
     }
 }
Beispiel #6
0
 public void SelectItem(int index)
 {
     switch (mode)
     {
         case InfoMode.Expeditions:
             {
                 UIExpeditionObserver.Show(observerPanel.GetComponent<RectTransform>(), SpriteAlignment.TopLeft, Expedition.expeditionsList[index], false);
                 activeObserver = UIExpeditionObserver.GetObserver().gameObject;
                 break;
             }
         case InfoMode.Crews:
             {
                 UICrewObserver.Show(observerPanel.GetComponent<RectTransform>(), SpriteAlignment.TopLeft, Crew.crewsList[index], false);
                 activeObserver = UICrewObserver.GetObserver().gameObject;
                 break;
             }
         case InfoMode.Artifacts:
             UIArtifactPanel.Show(observerPanel.GetComponent<RectTransform>(), SpriteAlignment.TopLeft, Artifact.artifactsList[index], false);
             activeObserver = UIArtifactPanel.GetObserver().gameObject;
             break;
     }
     if (activeObserver != null) activeObserver.transform.SetAsLastSibling();
 }