unity – Ho should I make the fade out/in to continue nonstop?


using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FadeInOutSaveGameText : MonoBehaviour
{
    public Animator animator;

    private bool hasFade = false;

    // Start is called before the first frame update
    void Start()
    {
      
    }

    public void FadeOut()
    {
        animator.SetTrigger("FadeOut");
    }

    public void FadeIn()
    {      
        animator.SetTrigger("FadeIn");
    }

    // Update is called once per frame
    void Update()
    {
        if(Input.GetKeyDown(KeyCode.I))
        {
            FadeOut();
        }

        if(Input.GetKeyDown(KeyCode.O))
        {
            FadeIn();
        }

    }
}

Now I’m using two keys for it. but I want to add two options to use either in the Update or startcoroutine to make the fade out/in nonstop. So it will continue fade out/in all the time when the game is running or when setting a flag to true.