public void ClearIndicates() { if (indicating) { foreach (Transform child in transform) { IndicatableS script = child.GetComponentInChildren(typeof(IndicatableS)) as IndicatableS; if (script != null) { script.IndicateOff(); } } indicating = false; } }
public void IndicateOne() { if (!indicating) { ClearIndicates(); foreach (Transform child in transform) { IndicatableS script = child.GetComponentInChildren(typeof(IndicatableS)) as IndicatableS; if (script != null && script.Indicatable()) { script.IndicateOn(); indicating = true; break; } } } }