public void Register(base_chunk chunk) { if (_chunks.Contains(chunk)) { return; } _chunks.Add(chunk); }
void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.layer == game_variables.Instance.LayerPlayer) { // promote SetState(0); } else if (other.gameObject.layer == game_variables.Instance.LayerChunk) { base_chunk temp = other.GetComponent <base_chunk>(); if (!_neighbours.Contains(temp)) { _neighbours.Add(temp); } } }