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); } }
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); } }
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); }
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); } }
private void InitializeUI() { iBox background = new iBox(); background.size = windowRect.size - new Vector2(16, 16); background.RelativePosition(iRelativePosition.CENTER_Y_OF, windowRect); background.RelativePosition(iRelativePosition.CENTER_X_OF, windowRect); iScrollView scrollView = new iScrollView(); scrollView.size = background.size - new Vector2(16, 16); scrollView.padding = new iPadding(0, 0, 0, 0, 4f); scrollView.autoSizeMode = iScrollViewAutoSize.HORIZONTAL; scrollView.RelativePosition(iRelativePosition.CENTER_X_OF, background); scrollView.RelativePosition(iRelativePosition.CENTER_Y_OF, background); DrawSceneItem(scrollView); RegisterGUI(background, scrollView); }