Having trouble with getting a 2nd event to work

I am having trouble with getting a 2nd event I created to work. I just learned how to create my own events a few days ago, so maybe there is something I am not understanding about creating events? I thought that maybe I needed to create another delegate just for the onGameLevelIncrease, but that didn’t seem to do anything. Thanks in advance for any help!

I have two scripts
1: EventManager
2: HudScript

In the EventManager I created this event
1: onCoinCountIncrease

That works fine, no errors.

Then I added another event
2: onGameLevelIncrease

I then get this error:
Assets/Scripts/ObjectScripts/HudScript.cs(15,53): error CS0103: The name `onGameLevelIncrease’ does not exist in the current context

It complains about this line here in the HudScript
EventManager.onGameLevelIncrease += onGameLevelIncrease;

Code Below.

public class EventManager : MonoBehaviour 
{
	
	public delegate void PlayerStatsHandler(int count);
	public static event PlayerStatsHandler onCoinCountIncrease;
	public static event PlayerStatsHandler onGameLevelIncrease;

	public GameManager gameManager;
	
	public int newCoinCount;
	public int currentCoinCount;
	public int newGameLevel;
	public int currentGameLevel;

	void Start () 
	{
	gameManager = GameObject.Find("ScriptHolder").GetComponent<GameManager>();
	currentCoinCount = gameManager.coinCountCollected;
	currentGameLevel = gameManager.gameLevel;
	}

	void Update () 
	{
	newCoinCount = gameManager.coinCountCollected;
	if (newCoinCount != currentCoinCount)
		{
			currentCoinCount = newCoinCount;
			onCoinCountIncrease(currentCoinCount);
		}
	//code for onGameLevelIncrease event
	newGameLevel = gameManager.gameLevel;
	if (newGameLevel != currentGameLevel)
		{
			currentGameLevel = newGameLevel;
			onGameLevelIncrease(currentGameLevel);
		}
		
	}

}
public class HudScript : MonoBehaviour 
{
	void OnEnable()
	{
		EventManager.onCoinCountIncrease += onCoinCountIncrease;
		EventManager.onGameLevelIncrease += onGameLevelIncrease;
	}
	
	void OnDisable()
	{
		EventManager.onCoinCountIncrease -= onCoinCountIncrease;
		EventManager.onGameLevelIncrease -= onGameLevelIncrease;
	}
}

Please use code tags when posting code.

–Eric

Ah! That’s cool, didn’t know about code tags. Thanks!

Took a look again and figured it out for anyone new to events and that may not know this.

I didn’t realize that if I subscribe to an event, I need to have the event in the script or else I run into an error.

Here’s the rest of my HudScript: I didn’t have “void onGameLevelIncrease(int count)” in there originally. After I put that in, the error no longer showed up.

	void onCoinCountIncrease(int count)
	{
		labelCoinCount.text = "Coin Count: " + count.ToString();
		labelCoinCount.Commit();
	}
	
	void onGameLevelIncrease(int count)
	{
	}