Exemple #1
0
 public static void DeselectPlanet()
 {
     if (selectedPlanet != null)
     {
         LeverScript lever = LeverScript.GetInstance();
         lever.SetThrottle(lever.GetDefaultThrottle());
         PlanetDisplay disp = PlanetDisplay.GetInstance();
         if (disp.GetViewTarget() == selectedPlanet.transform)
         {
             disp.SetVisible(false);
             disp.SetViewTarget(null);
             disp.GetTravelInteractable().SetExeString("");
         }
         selectedPlanet.Highlight("none");
         selectedPlanet = null;
     }
 }
Exemple #2
0
    public void PointerClick()
    {
        if (selectedPlanet == this)
        {
            LeverScript lever = LeverScript.GetInstance();
            lever.SetThrottle(lever.GetDefaultThrottle());
            PlanetDisplay disp = PlanetDisplay.GetInstance();
            if (disp.GetViewTarget() == transform)
            {
                disp.SetVisible(false);
                disp.SetViewTarget(null);
                disp.GetTravelInteractable().SetExeString("");
            }

            selectedPlanet = null;

            Highlight("none"); // disables highlights
        }
        else
        {
            LeverScript.GetInstance().SetThrottle(0.0f);
            PlanetDisplay disp = PlanetDisplay.GetInstance();
            disp.SetVisible(true);
            disp.SetViewTarget(transform);
            disp.UpdateInfo(data.title, data.creator, data.description, data.year, data.des_tag, data.image);
            disp.GetTravelInteractable().SetExeString(ExecutableSwitch.GetFullPath(data.executable + ".exe", data.executable, data.year));

            if (selectedPlanet != null)
            {
                selectedPlanet.Highlight("none");
            }
            selectedPlanet = this;

            Highlight("selected");
        }
    }