Skip to content

Instantly share code, notes, and snippets.

@Dssdiego
Last active April 28, 2020 08:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dssdiego/efd53d4359d783089ce150ada9ff1777 to your computer and use it in GitHub Desktop.
Save Dssdiego/efd53d4359d783089ce150ada9ff1777 to your computer and use it in GitHub Desktop.
using UnityEngine;
namespace Architecture
{
public class IntLogger : MonoBehaviour
{
public IntVariable variable;
public string textBeforeVariable;
public string textAfterVariable;
private void Awake()
{
variable.OnChanged += OnChanged;
}
public void OnChanged(int newValue)
{
Debug.Log(textBeforeVariable + " " + newValue + " " + textAfterVariable);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment