Class DependencyNode
Represents a node in a dependency tree for reporting issues in the UI. This is used to represent call trees, and dependencies between assets, assemblies, or packages.
Inherited Members
Namespace: Unity.ProjectAuditor .Editor
Assembly: Unity.ProjectAuditor.Editor.dll
Syntax
public abstract class DependencyNode
Fields
Location
The location represented by this node
Declaration
public Location Location
Field Value
Type | Description |
---|---|
Location |
PerfCriticalContext
Whether this node forms part of a performance-critical context
Declaration
public bool PerfCriticalContext
Field Value
Type | Description |
---|---|
bool |
Remarks
If the node represents part of a code call stack, perfCriticalContext is true if that callstack includes a known update method (for example, a MonoBehaviour.Update())
m_Children
A list of this node's children in the dependency tree
Declaration
protected List<DependencyNode> m_Children
Field Value
Type | Description |
---|---|
List<Dependency |
Properties
HasChildren
Checks whether this node has at least one valid child
Declaration
public bool HasChildren { get; }
Property Value
Type | Description |
---|---|
bool | True if the node has at least one valid child. Otherwise, returns false. |
HasValidChildren
Checks whether this node has a valid list of children
Declaration
public bool HasValidChildren { get; }
Property Value
Type | Description |
---|---|
bool | True if the node has a valid list of children. Otherwise, returns false. |
Name
This node's name
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
string |
NumChildren
Gets the number of children that this node has
Declaration
public int NumChildren { get; }
Property Value
Type | Description |
---|---|
int | The number of children. |
PrettyName
A prettified, UI-friendly version of this node's name
Declaration
public string PrettyName { get; }
Property Value
Type | Description |
---|---|
string |
Methods
AddChild(DependencyNode)
Adds a child to this node
Declaration
public void AddChild(DependencyNode child)
Parameters
Type | Name | Description |
---|---|---|
Dependency |
child | The node to add as a child of this one. |
AddChildren(DependencyNode[])
Adds multiple children to this node
Declaration
public void AddChildren(DependencyNode[] children)
Parameters
Type | Name | Description |
---|---|---|
Dependency |
children | An array of nodes to add as children of this one. |
GetChild(int)
Gets a child node with the specified index
Declaration
public DependencyNode GetChild(int index = 0)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index into the node's child list (defaults to 0) |
Returns
Type | Description |
---|---|
Dependency |
The child node with the given index |
GetName()
Gets the node's "raw" name
Declaration
public abstract string GetName()
Returns
Type | Description |
---|---|
string | The node's name |
GetPrettyName()
Gets the node's "pretty" name, suitable for UI display
Declaration
public abstract string GetPrettyName()
Returns
Type | Description |
---|---|
string | The node's prettified name |
IsPerfCritical()
Gets whether this node represents a performance-critical issue
Declaration
public abstract bool IsPerfCritical()
Returns
Type | Description |
---|---|
bool | True if the issue is performance critical. Otherwise, returns false. |
SortChildren()
Sorts this node's children by their prettyName, in ascending alphabetical order.
Declaration
public void SortChildren()