using UnityEngine; using UnityEngine.UI; using UnityEngine.Serialization; using System; using System.Text; using System.Collections; using System.Collections.Generic; using Random = UnityEngine.Random; public class ManaLog : MonoBehaviour { #region 变量 private static bool Lock; private static Text Lab; private static List TextList; #endregion private void Awake() { Lab = ManaReso.Get("E_ScrrLab"); Initializer.RegistValue += RegistValue; } private static void RegistValue() { TextList = new List(); } public static void Log(string message) { if (Lab) { if (Lock) { TextList.Add('\n' + message); } else { Lab.text += '\n' + message; } } } public static void Throw(string message = "Exception") { Lab.text += string.Format("\n{0}", message); } public static void LockBtn() { if (Lock) { for (int i = 0; i < TextList.Count; i++) { Lab.text += TextList[i]; } ManaReso.SetText("E_LockLab", "固定"); } else { ManaReso.SetText("E_LockLab", "解锁"); } Lock = !Lock; } }