Changing texture after 3s,4s and 5s

Hi. How to write code that change texture after 3, 4 and 5s. I mean something like that:

Timer is counting time.

If time is 0:30 show texture on screen with text(tips in game). I’ve got 10 textures in folder Textures. The texture should be background of the tip.
The Texture is fading after 3s. Then comes next tip with new texture and it fade after 4s. Next fade after 5s, etc. How to do it?

I tried something like:

Timer currTimer;
Texture2D background1;
Texture2D background2;
[...]
    
and then
curTimer = new Timer();
curTimer.Enabled = true;
curTimer.Interval = 100 //checking time after 0.1s
    
and then
    
void Start()
   {
   if (Timer == "30000")
   {
void OnGUI()
   {
   GUI.DrawTexture(rect(200,150, 0,0), "background");
   GUI.Text("To run faster press Shift");
   }

But it doesn’t work(errors). Any ideas?

Hello. If you don’t need an exact time period you can use usual Unity’s Update void.It will have a little time’s epsilon.

        float startTime;
        private Texture2D targetTexture;
        public string textureName = "background";
        public int CountOfTextures = 10;
        private int textureIndex = 0;
        public int period = 3;
        private Rect rect = new Rect(200, 150, 0, 0);      
        void Start()
        {
            LoadTexture();
            startTime = Time.time;
        }
    
        void Update()
        {
            if (startTime + period < Time.time)
            {
                startTime = Time.time;
                textureIndex++;
                period++;
                if (textureIndex == CountOfTextures - 1)
                {
                    textureIndex = 0;
                    period = 3;
                }
                LoadTexture();
            }
        }
    
        private void LoadTexture()
        {
            targetTexture = Resources.Load(textureName + textureIndex) as Texture2D;
            rect.width = targetTexture.width;
            rect.height = targetTexture.height;
        }
    
        void OnGUI()
        {
            GUI.DrawTexture(rect, targetTexture);
            GUI.Label(rect, "To run faster press Shift");
        }

Or you can make an array of background textures and change index of element of the array at the needed time.

Thanks.