Table of Contents

Interface ISpiralNode

Contract for a node in a doubly-linked spiral layout list. Each node knows its neighbours, its index in the spiral, and its 2D grid coordinate.

public interface ISpiralNode

Properties

Coordinate

2D grid coordinate of this node (used for layout-driven positioning).

Vector2Int Coordinate { get; set; }

Property Value

Vector2Int

GameObject

The GameObject backing this node.

GameObject GameObject { get; }

Property Value

GameObject

Index

Zero-based index of this node in the spiral sequence.

int Index { get; }

Property Value

int

Next

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

ISpiralNode Next { get; set; }

Property Value

ISpiralNode

Previous

The previous node in the spiral chain.

ISpiralNode Previous { get; set; }

Property Value

ISpiralNode

Methods

Initialize(Vector3, int)

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

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).

void UpdateCoordinate(Vector2Int coordinate)

Parameters

coordinate Vector2Int