forked from Unity-Technologies/UnityCsReference
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameObjectTreeViewItem.cs
More file actions
69 lines (61 loc) · 2.56 KB
/
Copy pathGameObjectTreeViewItem.cs
File metadata and controls
69 lines (61 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Unity C# reference source
// Copyright (c) Unity Technologies. For terms of use, see
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
using UnityEditor.IMGUI.Controls;
using UnityEngine;
using UnityEngine.SceneManagement;
namespace UnityEditor
{
internal class GameObjectTreeViewItem : TreeViewItem
{
int m_ColorCode;
Object m_ObjectPPTR;
Scene m_UnityScene;
// Lazy initialized together with icon.
bool m_LazyInitializationDone;
bool m_ShowPrefabModeButton;
Texture2D m_OverlayIcon;
Texture2D m_SelectedIcon;
public GameObjectTreeViewItem(int id, int depth, TreeViewItem parent, string displayName)
: base(id, depth, parent, displayName)
{
}
public override string displayName
{
get
{
// Lazy initilize displayName
if (base.displayName == null)
{
if (SubSceneGUI.IsUsingSubScenes())
{
var subSceneHeaderName = SubSceneGUI.GetSubSceneHeaderText((GameObject)objectPPTR);
if (subSceneHeaderName != null)
{
base.displayName = subSceneHeaderName;
return base.displayName;
}
}
if (m_ObjectPPTR != null)
displayName = objectPPTR.name;
else
displayName = "deleted gameobject";
}
return base.displayName;
}
set { base.displayName = value; }
}
virtual public int colorCode { get { return m_ColorCode; } set { m_ColorCode = value; } }
virtual public Object objectPPTR { get { return m_ObjectPPTR; } set { m_ObjectPPTR = value; } }
virtual public bool lazyInitializationDone { get { return m_LazyInitializationDone; } set { m_LazyInitializationDone = value; } }
virtual public bool showPrefabModeButton { get { return m_ShowPrefabModeButton; } set { m_ShowPrefabModeButton = value; } }
virtual public Texture2D overlayIcon { get { return m_OverlayIcon; } set { m_OverlayIcon = value; } }
virtual public Texture2D selectedIcon { get { return m_SelectedIcon; } set { m_SelectedIcon = value; } }
public bool isSceneHeader { get; set; }
public Scene scene
{
get { return m_UnityScene; }
set { m_UnityScene = value; }
}
}
} // UnityEditor