Esempio n. 1
0
    static public void CreateSelectionsNodeOfMenu( )
    {
        ISelectionsCtrl sel = GameObject.FindObjectOfType(typeof(ISelectionsCtrl)) as ISelectionsCtrl;

        if (sel == null)
        {
            DrawObjectsTab.CreateGUISelectionsCtrl();
        }

        Transform parentNodeTra = (Selection.activeGameObject != null) ? Selection.activeGameObject.transform : null;

        SelectionsNode node       = ViNoToolUtil.AddViNodeGameObject <SelectionsNode>("Selections", parentNodeTra);
        ViNode         childNode1 = ViNoToolUtil.AddViNodeGameObject <ViNode>("Selected1", node.transform);
        ViNode         childNode2 = ViNoToolUtil.AddViNodeGameObject <ViNode>("Selected2", node.transform);

        DialogPartNode dlg1 = CreateDialogNode("name", "Selected 1");           //ViNoToolUtil.AddViNodeGameObject<DialogPartNode>( "Dialog" , childNode1.transform );

        dlg1.transform.parent = childNode1.transform;

        DialogPartNode dlg2 = CreateDialogNode("name", "Selected 2");           //ViNoToolUtil.AddViNodeGameObject<DialogPartNode>( "Dialog" , childNode2.transform );

        dlg2.transform.parent = childNode2.transform;

        node.units               = new SelectionsNode.SelectUnit [2];
        node.units[0]            = new SelectionsNode.SelectUnit();
        node.units[0].targetNode = childNode1;
        node.units[0].text       = "Selection 1";
        node.units[0].index      = 0;

        node.units[1]            = new SelectionsNode.SelectUnit();
        node.units[1].targetNode = childNode2;
        node.units[1].text       = "Selection 2";
        node.units[1].index      = 1;

        EditorGUIUtility.PingObject(node.gameObject);
    }