How to link the collider with the phases of traffic lighting

I am creating a traffic system where pedestrians would respond to the traffic lights. Currently, I am trying to sync the collider with my traffic lighting sequence but I have not been successful. Once the collider is triggered, the message “STOP” is displayed for a red light and “GO” for a green light as the pedestrian walks. I would need help to sync my codes and correct them. Thanks.

Character Navigation Controller Script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.VFX;

public class CharacterNavigationController : MonoBehaviour
{
    public float movementSpeed = 1;
    public float rotationSpeed = 120;
    public float stopDistance = 2f;
    public Vector3 destination;
    public Animator animator;
    public bool reachedDestination;
    public int mode;
    

    private Vector3 lastPosition;
    Vector3 velocity;
        
    private void Awake()
    {
        movementSpeed = Random.Range(0.5f, 2f);
        animator      = GetComponent<Animator>();
    }

    //Update is called once per frame
    void Update()
    {

        if(transform.position != destination)
        {
            Vector3 destinationDirection = destination - transform.position;
            destinationDirection.y = 0;
            float destinationDestance = destinationDirection.magnitude;
            if (destinationDestance >= stopDistance)
            {
                reachedDestination = false;
                Quaternion targetRotation = Quaternion.LookRotation(destinationDirection);
                transform.rotation = Quaternion.RotateTowards(transform.rotation, targetRotation, rotationSpeed * Time.deltaTime);
                transform.Translate(Vector3.forward * movementSpeed * Time.deltaTime);
            }
            else
            {
                reachedDestination = true;
            }

            velocity = (transform.position - lastPosition) / Time.deltaTime;
            velocity.y = 0;
            var velocityMagnitude = velocity.magnitude;
            velocity = velocity.normalized;
            var fwdDotProduct = Vector3.Dot(transform.forward, velocity);
            var rightDotProduct = Vector3.Dot(transform.right, velocity);

            animator.SetFloat("Horizontal", rightDotProduct);
            animator.SetFloat("Vertical", fwdDotProduct);
           
        }

        lastPosition = transform.position;
    }

    public void SetDestination(Vector3 destination)
    {
        this.destination = destination;
        reachedDestination = false;
    }

    void OnTriggerEnter(Collider other)
    {
        if (other.TryGetComponent<TrafficLights>(out var trafficLights))
        {
            if ( trafficLights.State!=TrafficLights.EState.Green)
            {
                print("STOP");
            }
            else
            {
                print("GO");
            }
        }
    }



}

Traffic Light Control 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;
                
                          
            }
    }
            
}
//-----------------------------------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------------------------------
}


Collider Script

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

public class TrafficLights : MonoBehaviour
{
    public TrafficLightControl modeRef;
    [SerializeField] EMode mode = EMode.Red;
    public EMode Mode => mode;

    public enum EMode : byte { Red=0, Yellow=1, Green=2 }
    string LightMode;

    private void Update()
    {
        int state = modeRef.mode;
        LightMode = (EMode)state.ToString();
        Debug.Log(LightMode);
    }
}