private void Init() { button = new iButton(); button.OnClicked = (sender) => { Selection.activeObject = referenceObject; EditorGUIUtility.PingObject(Selection.activeObject); if (HierarchyBoostPinWindow.window != null) { HierarchyBoostPinWindow.window.Close(); } }; unPin = new iButton(); unPin.style = new GUIStyle(); unPin.LoadBuiltInIcon("CollabDeleted Icon"); unPin.OnClicked = (sender) => { GameObject.DestroyImmediate(referenceObject); view.RemoveChild(this); }; icon = new iBox(); icon.size = new Vector2(18, 18); icon.style = new GUIStyle(); icon.LoadBuiltInIcon("GameObject Icon"); label = new iLabel(); }
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); }
private void Init() { button = new iButton(); button.OnClicked = (sender) => { foreach (var obj in Selection.gameObjects) { var icon = obj.GetComponent <HierarchyIconBoost>(); if (path != "None") { if (icon == null) { icon = obj.AddComponent <HierarchyIconBoost>(); icon.hideFlags = HideFlags.HideInInspector; } icon.content = EditorGUIUtility.IconContent(path); } else { if (icon != null) { GameObject.DestroyImmediate(icon); } } } EditorApplication.RepaintHierarchyWindow(); }; icon = new iBox(); icon.size = new Vector2(16, 16); icon.style = new GUIStyle(); if (path != "None") { icon.LoadBuiltInIcon(path); } label = new iLabel(); }
private void Init() { button = new iButton(); button.OnClicked = (sender) => { if (EditorSceneManager.SaveModifiedScenesIfUserWantsTo(new Scene[] { SceneManager.GetActiveScene() })) { EditorSceneManager.OpenScene(path); if (iSceneNavigation.window != null) { iSceneNavigation.window.Close(); } } }; icon = new iBox(); icon.size = new Vector2(16, 16); icon.style = new GUIStyle(); icon.LoadBuiltInIcon("SceneAsset Icon"); label = new iLabel(); }