Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Editor/HierarchyData.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using UnityEditor;
using UnityEditor;
using UnityEngine;

namespace Febucci.HierarchyData
Expand All @@ -11,6 +11,8 @@ public class HierarchyData : ScriptableObject

public bool drawActivationToggle = true;

public bool drawScriptMark = true;

#region Icons Data

[System.Serializable]
Expand Down Expand Up @@ -137,4 +139,4 @@ private void OnValidate()
HierarchyDrawer.Initialize();
}
}
}
}
30 changes: 27 additions & 3 deletions Editor/HierarchyDrawer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
Expand Down Expand Up @@ -341,10 +341,10 @@ static void RetrieveDataFromScene()
sceneGameObjects.Clear();
iconsPositions.Clear();

var prefabStage = UnityEditor.Experimental.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage();
var prefabStage = UnityEditor.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage();
if (prefabStage != null)
{
var prefabContentsRoot = UnityEditor.Experimental.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage().prefabContentsRoot;
var prefabContentsRoot = UnityEditor.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage().prefabContentsRoot;

AnalyzeGoWithChildren(
go: prefabContentsRoot,
Expand Down Expand Up @@ -629,6 +629,30 @@ static void DrawCore(int instanceID, Rect selectionRect)

#endregion

#region DrawScriptMark
if (data.drawScriptMark)
{
void DrawQuad(Rect position, Color color)
{
Texture2D texture = new Texture2D(1, 1);
texture.SetPixel(0, 0, color);
texture.Apply();
GUI.skin.box.normal.background = texture;
GUI.Box(position, GUIContent.none);
}

temp_iconsDrawedCount++;

go = EditorUtility.InstanceIDToObject(instanceID) as GameObject;
var comp = go.GetComponent<UnityEngine.MonoBehaviour>();
if (comp == null)
return;

var r = new Rect(selectionRect.xMax - 16 * (temp_iconsDrawedCount + 1) - 2, selectionRect.yMin, 12, 12);
DrawQuad(r, Color.grey);
}
#endregion

#region Drawing Icon

if (data.icons.enabled)
Expand Down