Пример #1
0
/*    protected static void ConvertToZeroAnchor(RectTransform rect)
 *  {
 *      Vector2 localPosPre = rect.localPosition;
 *      rect.anchorMax = new Vector2(0, 0);
 *      rect.anchorMin = new Vector2(0, 0);
 *      rect.pivot = new Vector2(0, 0);
 *      rect.localPosition = localPosPre - new Vector2(rect.sizeDelta.x / 2, 0);
 *  }*/

    public static void ChangeScreensAll(bool onScreen)
    {
        starVisScreen.ChangeScreen(onScreen);
        starScanScreen.ChangeScreen(onScreen);
        sysJumpScreen.ChangeScreen(onScreen);
        planetJumpScreen.ChangeScreen(onScreen);
    }
Пример #2
0
    private IEnumerator Scanning(float time)
    {
        systemScanning  = true;
        buttonText.text = "SCANNING";

        float buttonBgWidth = 0;

        float timeElapsed = 0;
        float timePerc    = 0;

        while (timeElapsed < time)
        {
            timePerc = timeElapsed / time;

            buttonBgWidth          = timePerc * buttonBgWidthMax;
            buttonBgRect.sizeDelta = new Vector2(buttonBgWidth, 0);

            buttonBgImg.color = Color.Lerp(buttonBgColMin, buttonBgColMax, timePerc);

            timeElapsed += 0.01f;
            yield return(new WaitForSeconds(0.01f));
        }

        starVisScreen.DrawVisualisations(World.GetLocation().sys);
        starVisScreen.ChangeScreen(true);

        World.Star currStar = World.GetLocation().sys.star;

        topContainer.SetActive(true);
        topOutline.enabled = false;

        Write(currStar.type, typeText);
        yield return(new WaitForSeconds(1.1f));

        Write(currStar.temperature + "K", tempText);
        yield return(new WaitForSeconds(0.8f));

        Write(currStar.type, descTypeText);
        yield return(new WaitForSeconds(0.6f));

        Write(currStar.description, descText);

        systemScanned = true;

        systemScanning  = false;
        buttonText.text = "SCANNED";
    }