Class AchievementConditionNodeGui
Draws one node of an authored condition tree — its header, its own fields, what is wrong with it, and the children hanging off it — and recurses into those children.
Inherited Members
Namespace: Serenity.Achievements.Infrastructure.Editor
Assembly: Serenity.UnityAchievements.Infrastructure.Editor.dll
Syntax
public static class AchievementConditionNodeGui
Remarks
Everything is read from and written through the node's UnityEditor.SerializedProperty rather
than the managed object behind it, so a nested [SerializeReference] edit is an ordinary
serialized edit: undo works, a prefab override is recorded, and a second inspector on the same
asset repaints. The writes themselves live in
AchievementConditionNodeWriter; this class only decides when to ask for one.
No UnityEditor.EditorGUI.indentLevel is touched anywhere. Nesting is shown by the box each node draws itself in, and mixing an indent level with the explicit rects the header row needs is how a foldout ends up drawn a level to the right of the control it belongs to.
Methods
Draw(SerializedProperty, AchievementConditionEditContext, int)
Draws one node and everything under it.
Declaration
public static void Draw(SerializedProperty nodeProperty, AchievementConditionEditContext context, int depth)
Parameters
| Type | Name | Description |
|---|---|---|
| SerializedProperty | nodeProperty | The managed-reference property holding the node. |
| AchievementConditionEditContext | context | What the drawer was given to write with. |
| int | depth | How deep this node sits, counting the root as one. |
DrawPickNodeButton(SerializedProperty, AchievementConditionEditContext, string)
Draws a button that fills an empty node slot with a picked condition type.
Declaration
public static void DrawPickNodeButton(SerializedProperty nodeProperty, AchievementConditionEditContext context, string buttonLabel)
Parameters
| Type | Name | Description |
|---|---|---|
| SerializedProperty | nodeProperty | The empty managed-reference property to fill. |
| AchievementConditionEditContext | context | What the drawer was given to write with. |
| string | buttonLabel | The button's caption. |
HeaderLabelOf(AchievementCondition)
The one line a node's foldout header carries: what it is, and what it demands.
Declaration
public static string HeaderLabelOf(AchievementCondition node)
Parameters
| Type | Name | Description |
|---|---|---|
| AchievementCondition | node | The node to describe. May be |
Returns
| Type | Description |
|---|---|
| string | The header text. |
OwnComplaintOf(AchievementCondition)
What is wrong with this node itself, or null when nothing is.
Declaration
public static string OwnComplaintOf(AchievementCondition node)
Parameters
| Type | Name | Description |
|---|---|---|
| AchievementCondition | node | The node to ask. May be |
Returns
| Type | Description |
|---|---|
| string | The message, or |
Remarks
Validate() reports a child's problem through its parent, so drawing it at every node would repeat one broken leaf all the way up to the root. A node whose complaint is really a child's stays quiet and lets the child say it, where the author can actually fix it.