EnemyBase.StartOrUpdateCoroutine C# (CSharp) Method

StartOrUpdateCoroutine() private method

A helper method that updates or starts the Flash coroutine.
private StartOrUpdateCoroutine ( StatusEffects enemyState, float duration ) : void
enemyState StatusEffects The coroutine to update
duration float The duration of the coroutine
return void
    private void StartOrUpdateCoroutine(StatusEffects enemyState, float duration)
    {
        if (!this.activeStatusFlashCoroutineEndTimes.ContainsKey(enemyState) ||
            this.activeStatusFlashCoroutineEndTimes[enemyState] < Time.time)
        {
            this.activeStatusFlashCoroutineEndTimes[enemyState] = Time.time + duration;
            return;
        }
        this.activeStatusFlashCoroutineEndTimes[enemyState] = Time.time + duration;
    }