Exemplo n.º 1
0
    /// <summary>
    /// Initializer for the <see cref="PopupWindow"/> when failed at exporting a <see cref="ClickableElement"/>
    /// </summary>
    /// <param name="focusElem"></param>
    /// <param name="type"></param>
    public static void InitExport(ClickableElement elem)
    {
        var foo = senderEditor;

        PopupType = typeOfPopup.FailedExport;

        exportingElem = elem;

        PopupWindow window = ScriptableObject.CreateInstance <PopupWindow>();

        window.titleContent = new GUIContent("Export");
        window.position     = new Rect(senderEditor.position.center.x - width / 2, senderEditor.position.center.y - height / 2, width, height);

        window.ShowModalUtility();
    }
Exemplo n.º 2
0
    /// <summary>
    /// Initializer for the <see cref="PopupWindow"/> when we want to show a warning to the user
    /// </summary>
    public static void InitWarningPopup(string text)
    {
        var foo = senderEditor;

        warningText = text;

        PopupType = typeOfPopup.Warning;

        PopupWindow window = ScriptableObject.CreateInstance <PopupWindow>();

        window.titleContent = new GUIContent("Warning");
        window.position     = new Rect(senderEditor.position.center.x - width / 2, senderEditor.position.center.y - height / 2, width, height);

        window.ShowModalUtility();
    }
Exemplo n.º 3
0
    /// <summary>
    /// Initializer for the <see cref="PopupWindow"/> when deleting a <see cref="GUIElement"/>
    /// </summary>
    /// <param name="focusedElems"></param>
    /// <param name="type"></param>
    public static void InitDelete(params GUIElement[] focusedElems)
    {
        var foo = senderEditor;

        PopupType = typeOfPopup.Delete;

        elems      = new List <GUIElement>(focusedElems);
        typeOfElem = elems[0]?.GetTypeString();

        PopupWindow window = ScriptableObject.CreateInstance <PopupWindow>();

        window.ShowModalUtility();

        window.titleContent = new GUIContent("Delete");
        window.position     = new Rect(senderEditor.position.center.x - width / 2, senderEditor.position.center.y - height / 2, width, height);
    }