Last active
April 28, 2020 08:51
-
-
Save Dssdiego/efd53d4359d783089ce150ada9ff1777 to your computer and use it in GitHub Desktop.
Logs an [IntVariable](https://gist.github.com/Dssdiego/36f331c0460a5187f5ed7a74418d1ed3) to the console
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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