Ejemplo n.º 1
0
    /// <summary>
    /// Helper function for menu creation.
    /// </summary>

    static void AddPanel(object obj)
    {
        GameObject go = obj as GameObject;

        if (go.GetComponent <UIWidget>() != null)
        {
            go = go.transform.parent.gameObject;
        }
        UIPanel panel = NGUISettings.AddPanel(go);

        Selection.activeGameObject = panel.gameObject;
    }
Ejemplo n.º 2
0
    static void AddScrollView()
    {
        UIPanel panel = NGUISettings.AddPanel(SelectedRoot());

        if (panel == null)
        {
            panel = NGUIEditorTools.SelectedRoot(true).GetComponent <UIPanel>();
        }
        panel.clipping             = UIDrawCall.Clipping.SoftClip;
        panel.name                 = "Scroll View";
        Selection.activeGameObject = panel.gameObject;
    }
Ejemplo n.º 3
0
    /// <summary>
    /// Helper function for menu creation.
    /// </summary>

    static void AddScrollView(object obj)
    {
        GameObject go = obj as GameObject;

        if (go.GetComponent <UIWidget>() != null)
        {
            go = go.transform.parent.gameObject;
        }
        UIPanel panel = NGUISettings.AddPanel(go);

        panel.clipping = UIDrawCall.Clipping.SoftClip;
        panel.gameObject.AddComponent <UIScrollView>();
        panel.name = "Scroll View";
        Selection.activeGameObject = panel.gameObject;
    }
Ejemplo n.º 4
0
    static void AddCustomScrollView()
    {
        GameObject go       = NGUIEditorTools.SelectedRoot(true);
        GameObject svParent = new GameObject("Scroll View Parent");

        svParent.transform.SetParent(go.transform);

        UIPanel panel = NGUISettings.AddPanel(SelectedRoot());

        if (panel == null)
        {
            panel = NGUIEditorTools.SelectedRoot(true).GetComponent <UIPanel>();
        }
        panel.clipping = UIDrawCall.Clipping.SoftClip;
        panel.name     = "Scroll View";
        panel.gameObject.AddComponent <UIScrollView>();
        Selection.activeGameObject = panel.gameObject;

        //panel.gameObject.AddComponent<Air2000.ScrollViewScale>();

        panel.transform.SetParent(svParent.transform);
    }
Ejemplo n.º 5
0
    static void AddPanel()
    {
        UIPanel panel = NGUISettings.AddPanel(SelectedRoot());

        Selection.activeGameObject = (panel == null) ? NGUIEditorTools.SelectedRoot(true) : panel.gameObject;
    }