コード例 #1
0
    private void OnGUIBrief(float popupWidth, float popupHeight)
    {
        float y = 0;

        printTitle(level.name, ref y, popupWidth, titleStyle);

        float briefHeight     = popupHeight - (y + FOOTER_HEIGHT);
        Rect  briefRect       = new Rect(0, y, popupWidth, briefHeight);
        float briefTextHeight = getBriefTextHeight();
        Rect  briefViewRect   = new Rect(0, 0, popupWidth, briefTextHeight);

        using (GUI.ScrollViewScope scrollScope = new GUI.ScrollViewScope(briefRect, scrollPosition, briefViewRect, SCROLLBAR_NOT_VISIBLE, VERTICAL_SCROLLBAR_VISIBLE)) {
            scrollPosition = scrollScope.scrollPosition;
            GUI.Label(new Rect(5f, 0, popupWidth - 5f, briefTextHeight), level.brief.Replace("\\n", Environment.NewLine), textStyle);
        }

        // Time of day
        GUI.Label(new Rect(5f, popupHeight - (FOOTER_HEIGHT - 5f), popupWidth / 3f, FOOTER_HEIGHT - 10f), "Time: " + level.timeOfDay, subtitleStyle);

        // Previous stars
        int   stars  = PlayerPrefsData.GetLevelStars(level.id);
        float starsY = popupHeight - starFilled.height;

        drawStars(stars, ref starsY, popupWidth, -5f);

        // Random seed
        GUI.Label(new Rect(popupWidth * 2f / 3f - 5f, popupHeight - (FOOTER_HEIGHT - 5f), popupWidth / 3f, FOOTER_HEIGHT - 10f), level.randomSeedStr, subtitleStyleRight);
    }
コード例 #2
0
    public void fetchData(bool newRecord = false)
    {
        int stars = PlayerPrefsData.GetLevelStars(id);
        MissionStarAmount missionStarAmount = GetComponent <MissionStarAmount>();

        missionStarAmount.setStarAmount(stars, newRecord);
    }