Code Monkey home page Code Monkey logo

smart-hierarchy's People

Contributors

neon-age avatar sa-barnaby avatar xincger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smart-hierarchy's Issues

Deleting script cause overflow

When deleting a script that is attached to a gameobject in the hierarchy, it cause a null reference exception and force you to restart unity.
Of course you are really not forced to restart if you disable and enable smart hierarchy from preferences.

Really good asset btw.
Captura de pantalla 2020-12-12 004310

"Priorized Types" doesn't always work

Sometimes cameras show the Audio Listener icon in the hierarchy, even though camera is a priorized type in the preferences, and is above the Listener component on the object. This usually resolves automatically after a while, like when reloading the scene.
Screenshot 2021-02-10 104432

NullReferenceException in Unity 2022.1

I am getting some errors when adding this package to a Unity 2022.1 project. Would love to get this to work since I have used it before in older projects and it was always so nice :)

image

Edit: it seems the issue has been fixed here, this does work for me.

345e17e

Any ways to remove serialization errors on builds?

I get these warnings for each Hierarchy Collection in my WebGL build;

A scripted object (probably AV.Hierarchy.Collection?) has a different serialization layout when loading. (Read 32 bytes but expected 40 bytes) Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
Followed by warning;
The referenced script on this Behaviour (Game Object '*GOName*') is missing!

Normally I would just ignore these, but as it's WebGL it seems to create other issues down the line.

NullReferenceException when right clicking in the Hierarchy window

Versions

  • Unity: 2020.3.20f1.
  • Smart Hierarchy: 0.3.1.

Repro steps

  • Create new scene.
  • Open the scene.
  • Right click in the Hierarchy window.
  • Context menu doesn't open and an exception is thrown.

Exception

NullReferenceException: Object reference not set to an instance of an object
AV.Hierarchy.GenericMenuUtil.GetItems (UnityEditor.GenericMenu menu) (at Library/PackageCache/[email protected]/Reflected/GenericMenuUtil.cs:21)
AV.Hierarchy.CopyPasteCommands.<OnInitialize>g__ReplaceMenuFunctions|6_2 (UnityEditor.GenericMenu menu) (at Library/PackageCache/[email protected]/Base/Commands/CopyPasteCommands.cs:28)
AV.Hierarchy.CopyPasteCommands+<>c.<OnInitialize>b__6_0 (UnityEditor.GenericMenu menu, UnityEngine.GameObject o) (at Library/PackageCache/[email protected]/Base/Commands/CopyPasteCommands.cs:21)
UnityEditor.SceneManagement.SceneHierarchyHooks.AddCustomGameObjectContextMenuItems (UnityEditor.GenericMenu menu, UnityEngine.GameObject gameObject) (at <83a38f5397d94e36a22efa3369c82390>:0)
UnityEditor.SceneHierarchy.CreateGameObjectContextClick (UnityEditor.GenericMenu menu, System.Int32 contextClickedItemID) (at <83a38f5397d94e36a22efa3369c82390>:0)
UnityEditor.SceneHierarchy.ContextClickOutsideItems () (at <83a38f5397d94e36a22efa3369c82390>:0)
UnityEditor.IMGUI.Controls.TreeViewController.HandleUnusedEvents () (at <83a38f5397d94e36a22efa3369c82390>:0)
UnityEditor.IMGUI.Controls.TreeViewController.OnGUI (UnityEngine.Rect rect, System.Int32 keyboardControlID) (at <83a38f5397d94e36a22efa3369c82390>:0)
UnityEditor.SceneHierarchy.DoTreeView (System.Single searchPathHeight) (at <83a38f5397d94e36a22efa3369c82390>:0)
UnityEditor.SceneHierarchy.OnGUI (UnityEngine.Rect rect) (at <83a38f5397d94e36a22efa3369c82390>:0)
UnityEditor.SceneHierarchyWindow.DoSceneHierarchy () (at <83a38f5397d94e36a22efa3369c82390>:0)
UnityEditor.SceneHierarchyWindow.OnGUI () (at <83a38f5397d94e36a22efa3369c82390>:0)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <83a38f5397d94e36a22efa3369c82390>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <83a38f5397d94e36a22efa3369c82390>:0)
UnityEditor.DockArea.OldOnGUI () (at <83a38f5397d94e36a22efa3369c82390>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.EventDispatchUtilities.PropagateEvent (UnityEngine.UIElements.EventBase evt) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToRegularTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.MouseEventDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel iPanel) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <4c8a9874288b4fb78fa7fdbcd8065b00>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <00a477ed1abf4030be646c3244bd3667>:0)

[Fixed] Critical Build Errors

I tried building for x64 Windows, but got 7 Errors that would prevent it.

The error message was always a variation of this:

Library\PackageCache\com.av.smart-hierarchy@94113c3d21\Base\HierarchySettingsProvider.cs(8,26): error CS0234: The type or namespace name 'EditorGUI' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)

After removing Smart Hierarchy the build process did complete as it should.

Screenshot of the Console:
Screenshot 2020-11-11 182659

Multiple Warnings during Play

I'm working with Bolt on UI elements for my game, and some of the canvas elements seem to cause warning messages like this:

Parent of RectTransform is being set with parent property. Consider using the SetParent method instead, with the worldPositionStays argument set to false. This will retain local orientation and scale rather than world orientation and scale, which can prevent common UI scaling issues.
UnityEngine.Transform:set_parent(Transform)
AV.Hierarchy.DetachOnBuildProcess:OnProcessScene(Scene, BuildReport) (at Library/PackageCache/com.av.smart-hierarchy@5a8cc0892c/Base/DetachOnBuildProcess.cs:45)
UnityEditor.Build.BuildPipelineInterfaces:OnSceneProcess(Scene, BuildReport)

[Fixed] Unacceptably poor performance with HUGE hierarchies

This is caused by TreeView.FindItem() which goes throw whole hierarchy many-many times for each instanceId.

There is no optimal optimization for this method, so instead we better get all TreeView items and go throw each visible element manually.

USS unit warnings on import

Shows numerous warnings on import (Unity 2020.1.14f1), e.g.

StyleSheet import: type=Validation, code=InvalidProperty file=Packages/com.av.smart-hierarchy/UI/preferences-style.uss:3 Expected (<length> | <percentage>) but found '6' padding-left: 6 -> Property expects a unit. Did you forget to add px or %?

StyleSheet import: type=Validation, code=InvalidProperty file=Packages/com.av.smart-hierarchy/UI/popup-window.uss:21 Unknown property '-unity-slice' (did you mean '-unity-slice-top'?) -unity-slice: 1

Reducing visual noise ๐Ÿ‘

So I've tried to set MeshFilter as a prioritized type over MeshRenderer, and it started to look so much easier for the eye!

image

And now I'm thinking to add some features to help reduce this visual noise created by some of the icons:

  • "Prefer/Ignore" enum for Types Priority.
  • Custom Icons for Types (ex. SpriteRenderer with Sprite icon).
  • Support per-gameobject "Gizmo" icon.

Another idea that comes to my mind is "Compound Components (?)"
image
Not sure if it's a good idea, as it might create confusion/distraction or result in even more noise..

What do you think?

Preferences UI doesn't work when plugin is located in Assets

I just downloaded a zip of the repo to test the latest changes and dragged the folder into my Unity project, but it created an error in the console.
The Menu entry in the preferences exists, but when i select it this error pops up.
I previously used the package manager, and modified the cache files to update it locally, so i didn't run into the issue before.

NullRef when components are missing

TypesPriority.SelectPrioritizedComponents() throws a Null Ref if an object in the hierarchy has a missing component

NullReferenceException: Object reference not set to an instance of an object
AV.Hierarchy.TypesPriority+<SelectPrioritizedComponents>d__4.MoveNext () (at Library/PackageCache/com.av.smart-hierarchy@41ed90624a/Base/TypesPriority.cs:66)
System.Collections.Generic.LargeArrayBuilder`1[T].AddRange (System.Collections.Generic.IEnumerable`1[T] items) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Collections.Generic.EnumerableHelpers.ToArray[T] (System.Collections.Generic.IEnumerable`1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
AV.Hierarchy.Components.ChooseMainComponent (UnityEngine.Component[] components) (at Library/PackageCache/com.av.smart-hierarchy@41ed90624a/Components/Components.cs:70)
AV.Hierarchy.Components..ctor (UnityEngine.GameObject instance) (at Library/PackageCache/com.av.smart-hierarchy@41ed90624a/Components/Components.cs:28)
AV.Hierarchy.ViewItem..ctor (UnityEngine.GameObject instance) (at Library/PackageCache/com.av.smart-hierarchy@41ed90624a/Base/ViewItem.cs:47)
AV.Hierarchy.SmartHierarchy.GetInstanceViewItem (System.Int32 id, UnityEngine.GameObject instance, UnityEngine.Rect rect, AV.Hierarchy.ViewItem& item) (at Library/PackageCache/com.av.smart-hierarchy@41ed90624a/Base/SmartHierarchy.cs:244)
AV.Hierarchy.SmartHierarchy.OnItemGUI (System.Int32 id, UnityEngine.Rect rect) (at Library/PackageCache/com.av.smart-hierarchy@41ed90624a/Base/SmartHierarchy.cs:145)
AV.Hierarchy.SmartHierarchy.OnItemCallback (System.Int32 id, UnityEngine.Rect rect) (at Library/PackageCache/com.av.smart-hierarchy@41ed90624a/Base/SmartHierarchy.cs:121)
AV.Hierarchy.SmartHierarchy.OnHierarchyItemGUI (System.Int32 id, UnityEngine.Rect rect) (at Library/PackageCache/com.av.smart-hierarchy@41ed90624a/Base/SmartHierarchy.cs:104)
UnityEditor.SceneHierarchy.OnRowGUICallback (System.Int32 instanceID, UnityEngine.Rect rect) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.IMGUI.Controls.TreeViewController.DoItemGUI (UnityEditor.IMGUI.Controls.TreeViewItem item, System.Int32 row, System.Single rowWidth, System.Boolean hasFocus) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.IMGUI.Controls.TreeViewController.IterateVisibleItems (System.Int32 firstRow, System.Int32 numVisibleRows, System.Single rowWidth, System.Boolean hasFocus) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.IMGUI.Controls.TreeViewController.OnGUI (UnityEngine.Rect rect, System.Int32 keyboardControlID) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.SceneHierarchy.DoTreeView (System.Single searchPathHeight) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.SceneHierarchy.OnGUI (UnityEngine.Rect rect) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.SceneHierarchyWindow.DoSceneHierarchy () (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.SceneHierarchyWindow.OnGUI () (at <a8e33794c0064f2aa201ade069162226>:0)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <9577ac7a62ef43179789031239ba8798>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <9577ac7a62ef43179789031239ba8798>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <9577ac7a62ef43179789031239ba8798>:0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.HostView.Invoke (System.String methodName) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEditor.DockArea.OldOnGUI () (at <a8e33794c0064f2aa201ade069162226>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

SetActive can't be undone

When disabling an object with the "set active" toggle in the hierarchy window, it can't be re-enabled with undo.

No Stadia support โ€” fix for "can't add Editor script"

image

This is a temp solution to avoid "can't add Editor script" error on MonoBehaviours.

Will be eventually fixed with re-organization and splitting assemblies into:

Assemblies
AV.Hierarchy.Core Base folder, references Unity assemblies.
AV.Hierarchy.Runtime MonoBehaviours, references Core.
AV.Hierarchy Root, Editor-only, references Core and Runtime.

But it will introduce new conflicts, so firstly these dev branches need to be merged into master:

  • hide-scene-visibility
  • view-items-refactoring
  • components-toolbar
  • reorganization

Hope there is no developers that actually rely on Stadia ๐Ÿ˜…

No update after unmaximize

If you maximize and unmaximize any other window - icons will disappear. They of course appear again when you focus on the hierarchy window.

HelpBox not found?

Unity 2019.4

Library\PackageCache\com.av.smart-hierarchy@f460c32a86\Collections\CollectionEditor.cs(180,41): error CS0246: The type or namespace name 'HelpBox' could not be found (are you missing a using directive or an assembly reference?)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.