Class SpiralNode<T>
- Namespace
- WitShells.DesignPatterns
Abstract MonoBehaviour implementation of ISpiralNode that carries
typed data payload T.
Subclass this to create spiral nodes that display game-specific content
(e.g. inventory items, skill icons, quest entries).
public abstract class SpiralNode<T> : MonoBehaviour, ISpiralNode
Type Parameters
TThe data type displayed or managed by this node.
- Inheritance
-
SpiralNode<T>
- Implements
Properties
Coordinate
2D grid coordinate of this node (used for layout-driven positioning).
public Vector2Int Coordinate { get; set; }
Property Value
- Vector2Int
Data
The data payload associated with this node.
public T Data { get; set; }
Property Value
- T
GameObject
The GameObject backing this node.
public GameObject GameObject { get; }
Property Value
- GameObject
Index
Zero-based index of this node in the spiral sequence.
public int Index { get; }
Property Value
Next
The next node in the spiral chain (clockwise or counter-clockwise).
public ISpiralNode Next { get; set; }
Property Value
Previous
The previous node in the spiral chain.
public ISpiralNode Previous { get; set; }
Property Value
Methods
Initialize(Vector3, int)
Initialises this node's position and index within the spiral.
public void Initialize(Vector3 position, int index)
Parameters
positionVector3Local position assigned to this node.
indexintZero-based index within the spiral.
UpdateCoordinate(Vector2Int)
Updates the node's logical coordinate (does not immediately change visual position).
public virtual void UpdateCoordinate(Vector2Int coordinate)
Parameters
coordinateVector2Int
UpdateNode(T)
Called by the layout container to refresh the node's visual representation
when its data changes.
public abstract void UpdateNode(T data)
Parameters
dataTThe new data to display.