Dssdiego
4/28/2020 - 8:47 AM

IntLogger

Logs an IntVariable to the console

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);
        }
    }
}