using LAViD.Unity.Utils; using System.Collections.Generic; using UnityEngine.UI; namespace LAViD.VLibras.Utils { public class VisualLogger : PlayerLogger { private Text textObj; public int maximumLines = 20; private List logs = new List(); protected override void Start() { base.Start(); this.textObj = this.gameObject.GetComponent(); } protected override void write(string text) { this.logs.Insert(0, text); if (this.logs.Count > this.maximumLines) this.logs.RemoveAt(this.logs.Count - 1); this.textObj.text = string.Join("\n", this.logs.ToArray()); } } }