/// <summary> /// Flashes the probe's emissive color from start color to end color in the specified time /// </summary> private void FlashColor(Color startColor, Color endColor, float seconds) { if (flashColorCoroutine != null) { StopCoroutine(flashColorCoroutine); } foreach (GameObject probe in GameObject.FindGameObjectsWithTag("Probe")) { Renderer renderer = probe.GetComponent <Renderer>(); foreach (Material material in renderer.materials) { flashColorCoroutine = materials.FlashColor(material, startColor, endColor, seconds); StartCoroutine(flashColorCoroutine); } } }