Once the slider has reached maximum value: set Level Complete UI (Active)

Hello, I am currently making a game where you collect items and it fills a progress bar. Unfortunately, I cannot seem to figure out a script that sets my Level Complete UI canvas to “Active” when the Progress bar is = to max value. Assistance would be greatly appreciated.

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

public class ProgressBar : MonoBehaviour
{
    public Slider slider;
    public GameObject LevelCompleteUI;

    public void SetMaxProgress (int progress)
    {
        slider.maxValue = progress;
        slider.value = progress;
    }

    public void SetProgress (int progress)
    {
        slider.value = progress;
    }
}

Thank you! :slight_smile: <3 I had modified the code a bit since me posting it. Your suggestion worked! Here is the code for everyone following this question. Remember to assign everything in the Inspector.

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

public class ProgressBar : MonoBehaviour
{
    public Slider ProgressSlider;
    public GameObject LevelCompleteUI;

    public void SetMaxProgress (int progress)
    {
        ProgressSlider.maxValue = progress;
        ProgressSlider.value = progress;
    }

    public void SetProgress (int progress)
    {
        ProgressSlider.value = progress;

        if (ProgressSlider.value >= ProgressSlider.maxValue)
        {
            LevelCompleteUI.SetActive(true);
        }
    }
}