Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using TMPro;
- using UnityEngine;
- using UnityEngine.UI;
- public class DebugUI : MonoBehaviour
- {
- // Singleton
- public static DebugUI instance;
- [SerializeField] Text debuginfo;
- void Awake()
- {
- instance = this;
- }
- void Start()
- {
- instance.debuginfo.text = "Debug";
- }
- public static void SetDebugText (string text)
- {
- instance.debuginfo.text = text;
- }
- public static void AddDebugText (string text)
- {
- instance.debuginfo.text += text;
- }
- public static void AddDebugLine (string text)
- {
- instance.debuginfo.text += text + "\n";
- }
- public static void CleanDebugText()
- {
- instance.debuginfo.text = "";
- }
- public static void EnableDebugText()
- {
- instance.debuginfo.enabled = true;
- }
- public static void DisableDebugText()
- {
- instance.debuginfo.enabled = false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement