Table of Contents

Class SpiralNode<T>

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

T

The 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

int

Next

The next node in the spiral chain (clockwise or counter-clockwise).

public ISpiralNode Next { get; set; }

Property Value

ISpiralNode

Previous

The previous node in the spiral chain.

public ISpiralNode Previous { get; set; }

Property Value

ISpiralNode

Methods

Initialize(Vector3, int)

Initialises this node's position and index within the spiral.

public void Initialize(Vector3 position, int index)

Parameters

position Vector3

Local position assigned to this node.

index int

Zero-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

coordinate Vector2Int

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

data T

The new data to display.