Beispiel #1
0
    private IEnumerator DamageFlash()
    {
        m_IsFlashing = true;

        float flashDelay   = .1f;
        Color flashColor   = Color.red;
        int   numOfFlashes = 1;

        for (int i = 0; i < numOfFlashes; i++)
        {
            m_Graphics.SetColor(flashColor);
            yield return(new WaitForSeconds(flashDelay));

            m_Graphics.SetColor(Color.white);
            yield return(new WaitForSeconds(flashDelay));
        }

        m_IsFlashing = false;
    }