1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- 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<string> TextList;
- #endregion
- private void Awake()
- {
- Lab = ManaReso.Get<Text>("E_ScrrLab");
- Initializer.RegistValue += RegistValue;
- }
- private static void RegistValue()
- {
- TextList = new List<string>();
- }
- 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<color=red>{0}</color>", 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;
- }
- }
|