void OnTriggerStay(Collider other) { RailGenerator otherRailGenerator = other.GetComponentInParent <RailGenerator>(); if (otherRailGenerator != null) { Debug.LogFormat("this is {0} reporting that {1} has entered my trigger", name, otherRailGenerator.name); } }
public void RegisterOverlappingGenerator(RailGenerator overlappingGenerator) { if (!_overlappingGenerators.Contains(overlappingGenerator)) { _overlappingGenerators.Add(overlappingGenerator); } else { Debug.LogErrorFormat("{0} is already tracked in {1}'s list of overlapping generators. why are you trying to add it again?", overlappingGenerator.name, name); } }