コード例 #1
0
 void Awake()
 {
     if (!LeverScript.GetInstance().RegisterLever(this))
     {
         Destroy(this);
     }
 }
コード例 #2
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;
     }
 }
コード例 #3
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");
        }
    }