private void DrawSceneItem(iScrollView scrollView)
    {
        Object[] obj = GameObject.FindObjectsOfType <HierarchyItemPin>();
        for (int i = obj.Length - 1; i >= 0; --i)
        {
            var o = obj[i];

            HierarchyBoostPinItem pinItem = new HierarchyBoostPinItem();
            pinItem.size            = new Vector2(18, 18);
            pinItem.referenceObject = o;
            pinItem.text            = o.name;
            pinItem.view            = scrollView;

            //iButton btnScene = new iButton();
            //btnScene.size = new Vector2(24, 24);
            //btnScene.text = o.name;
            //btnScene.OnClicked = (sender) =>
            //{
            //    Selection.activeObject = o;
            //    EditorGUIUtility.PingObject(Selection.activeObject);
            //    if(window != null)
            //    {
            //        window.Close();
            //    }
            //};

            scrollView.AddChild(pinItem);
        }
    }
Beispiel #2
0
    private void DrawSceneItem(iScrollView scrollView)
    {
        for (int i = -1, j = icons.Count; i < j; ++i)
        {
            string path = i == -1 ? "None" : icons[i];
            HierarchyBoostIconItem iconItem = new HierarchyBoostIconItem();
            iconItem.size = new Vector2(18, 18);
            iconItem.text = path;
            iconItem.path = path;

            scrollView.AddChild(iconItem);
        }
    }
Beispiel #3
0
    private void OnEnable()
    {
        if (EditorApplication.isCompiling)
        {
            return;
        }

        var scrollView = new iScrollView();

        scrollView.autoSizeMode = iScrollViewAutoSize.HORIZONTAL;
        scrollView.direction    = iScrollViewDirection.VERTICAL;
        scrollView.size         = new Vector2(200, 200);
        scrollView.padding      = new iPadding(4, 4, 24, 4, 4);
        for (int i = 0; i < 20; ++i)
        {
            var btn = new iButton();
            btn.text = "Index : " + i;
            btn.size = new Vector2(25, 25);

            scrollView.AddChild(btn);
        }

        var checkBox = new iCheckBox();

        checkBox.text = "Hello World";
        checkBox.RelativePosition(iRelativePosition.BOTTOM_OF, scrollView);
        checkBox.size      = new Vector2(100, EditorGUIUtility.singleLineHeight);
        checkBox.OnChanged = (sender) =>
        {
            iCheckBox cb = (iCheckBox)sender;
            Debug.Log("CheckBox: " + cb.isChecked);
        };

        var dd = new iDropDown();

        dd.AddOption("Value 1", 1);
        dd.AddOption("Value 2", 2);
        dd.AddOption("Value 3", 3);
        dd.AddOption("Value 4", 3);
        dd.RelativePosition(iRelativePosition.BOTTOM_OF, checkBox);
        dd.OnChanged = (sender) =>
        {
            iDropDown d = (iDropDown)sender;
            Debug.Log("Dropdown: " + d.selectedItem + ":" + d.selectedObject);
        };

        AddChild(scrollView);
        AddChild(checkBox);
        AddChild(dd);
    }
Beispiel #4
0
    private void DrawSceneItem(iScrollView scrollView)
    {
        for (int i = 0; i < SceneManager.sceneCountInBuildSettings; ++i)
        {
            string scene = SceneUtility.GetScenePathByBuildIndex(i);

            if (!File.Exists(scene))
            {
                continue;
            }

            iSceneNavigationItem sceneItem = new iSceneNavigationItem();
            sceneItem.size = new Vector2(18, 18);
            sceneItem.text = Path.GetFileNameWithoutExtension(scene);
            sceneItem.path = scene;


            scrollView.AddChild(sceneItem);
        }
    }