Beispiel #1
0
    //Graphic change and bool lock for getting damage for set duration
    private IEnumerator Invulnerable()
    {
        invulnerabilityGraphics.SetInvulnerable();
        invulnerable = true;

        yield return(new WaitForSeconds(invulnerableDuration));

        invulnerable = false;
        invulnerabilityGraphics.SetStandard();
    }
Beispiel #2
0
    //Graphic change and bool lock for getting damage for set duration.
    private IEnumerator Invulnerable()
    {
        int originalLayer = gameObject.layer;

        invulnerabilityGraphics.SetInvulnerable();
        gameObject.layer = 0;

        yield return(new WaitForSeconds(invulnerableDuration));

        gameObject.layer = originalLayer;
        invulnerabilityGraphics.SetStandard();
    }