Пример #1
0
    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();
    }
Пример #2
0
    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();
    }
Пример #3
0
    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();
    }