How to link scripts

I am creating a traffic system where the pedestrians would respond to the traffic lights via collider trigger. The message “STOP” would be displayed with the green light, otherwise the “GO” message would be displayed.

However, the codes I used to perform the above showed that no matter what color the lights are, the message “STOP” is always displayed.

I believe that the issue is the absence of the linkage of my traffic light control script and the trigger script. I would require help in linking them. Thanks in advance.

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

public class TrafficLights : MonoBehaviour
{
   
    [SerializeField] EMode mode = EMode.Red;
    public EMode Mode => mode;
 
    public enum EMode : byte { Red=0, Yellow=1, Green=2 }

  
}

Above is the trigger script.

using JetBrains.Annotations;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TrafficLightControl : MonoBehaviour {
//-----------------------------------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------------------------------

    public bool direction1 = true;

    public Renderer objRenderer;
    public int mode;
    float delay;
    
//-----------------------------------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------------------------------
private void Start()
{
    objRenderer = GetComponent<Renderer>();
        
    mode = 0;
    objRenderer.materials[1].SetTextureOffset("_MainTex", new Vector2(0.0f, 0.0f));
    if(direction1)
    {
        mode = 2;
        objRenderer.materials[1].SetTextureOffset("_MainTex", new Vector2(0.0625f * 2.0f, 0.0f));
    }
    delay = 10.0f;
}
//-----------------------------------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------------------------------
void Update()
{
    if(mode == 0)
    {    
        delay -= Time.deltaTime;
        if(delay < 0.0f)
        {
            delay = 3.0f;
            objRenderer.materials[1].SetTextureOffset("_MainTex", new Vector2(0.0625f * 1.0f, 0.0f));                
            mode = 1;
                
        }
    }
    else if(mode == 1)
    {    
        delay -= Time.deltaTime;
        if(delay < 0.0f)
        {
            delay = 13.0f;
            objRenderer.materials[1].SetTextureOffset("_MainTex", new Vector2(0.0625f * 2.0f, 0.0f));                
            mode = 2;
        }
    }
    else if(mode == 2)
    {    
        delay -= Time.deltaTime;
        if(delay < 0.0f)
        {
            delay = 1.0f;
            objRenderer.materials[1].SetTextureOffset("_MainTex", new Vector2(0.0625f * 3.0f, 0.0f));                
            mode = 3;
        }
    }
    else if(mode == 3)
    {    
        delay -= Time.deltaTime;
        if(delay < 0.0f)
        {
            delay = 15.0f;
            objRenderer.materials[1].SetTextureOffset("_MainTex", new Vector2(0.0625f * 0.0f, 0.0f));                
            mode = 0;
                
                          
            }
    }
            
}
//-----------------------------------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------------------------------
}

Above is the traffic lights control script.