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 #2
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();
 }