Skip to content

Instantly share code, notes, and snippets.

@unity3dcollege
Last active May 5, 2017 23:28
Show Gist options
  • Save unity3dcollege/e5b9ed2802c2932fe0565fd07e1cd754 to your computer and use it in GitHub Desktop.
Save unity3dcollege/e5b9ed2802c2932fe0565fd07e1cd754 to your computer and use it in GitHub Desktop.
using System;
using UnityEngine;
public class ScoreController
{
public event Action<int> OnScoreChanged = delegate { };
private int currentScore;
public void AddScore(int amountToAdd)
{
currentScore += amountToAdd;
OnScoreChanged(currentScore);
Debug.Log("New Score: " + currentScore);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment