void OrganizeEnters() { Entrance[] all_enter = GameObject.FindObjectsOfType <Entrance>(); Entrance[] order_enter = new Entrance[all_enter.Length]; foreach (Entrance runner in all_enter) { order_enter[runner.num_ent] = runner; } entries.Clear(); foreach (Entrance runner in order_enter) { AddEnt(runner); } }
public void AddEnt(Entrance new_en) { LinkedListNode <Connection> runner; RemoveEnt(); runner = exits.First; while (runner != null) { if (runner.Value.SamePortal(new_en)) { return; } runner = runner.Next; } new_en.num_ent = entries.Count; new_en.connect_to = entries.Last.Value; entries.AddLast(new Connection(new_en, entries.Count)); }