Esempio n. 1
0
    // Update redraws the selection UI
    virtual public void Update()
    {
        RefreshReference();

        game = Game.Get();

        float scrollPos = -14.5f * UIScaler.GetPixelsPerUnit();

        if (scrollArea != null && !scrollArea.ObjectDestroyed())
        {
            scrollPos = scrollArea.GetScrollPosition();
        }
        Clean();

        AddScrollArea();

        float offset = 0;

        offset = DrawComponentSelection(offset);

        offset = AddSubComponents(offset);

        offset = AddSource(offset);

        offset = AddComment(offset);

        scrollArea.SetScrollSize(offset);
        scrollArea.SetScrollPosition(scrollPos);

        UIElement ui = new UIElement(Game.EDITOR);

        ui.SetLocation(0, 0, 1, 1);
        ui.SetText("<b>⇦</b>", Color.cyan);
        ui.SetTextAlignment(TextAnchor.LowerCenter);
        ui.SetButton(delegate { QuestEditorData.Back(); });
        ui.SetBGColor(Color.black);
        new UIElementBorder(ui, Color.cyan);

        AddTitle();
    }
Esempio n. 2
0
    // Update redraws the selection UI
    virtual public void Update()
    {
        Clean();

        // Back button is common to all components
        TextButton tb = new TextButton(new Vector2(0, 29), new Vector2(3, 1), "Back", delegate { QuestEditorData.Back(); });

        tb.button.GetComponent <UnityEngine.UI.Text>().fontSize = UIScaler.GetSmallFont();
        tb.ApplyTag("editor");
    }