12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using System;
- using UnityEngine;
- namespace SC.XR.Unity {
- public class DebugMy {
- static string Tag ;
- public static bool isShowNormalLog = false;
- public static bool isShowErrorLog = true;
- public static void Log(string msg, object o, bool current = false,bool all = false) {
- if(all == true) {
- isShowNormalLog = true;
- }
- if(isShowNormalLog == false && current == false)
- return;
-
- Tag = "[ FrameCount:" + Time.frameCount + " ]";
- if(o == null) {
- if(Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.WindowsEditor) {
- Debug.Log(Tag + msg);
- } else {
- Console.WriteLine(Tag + msg);
- }
- } else {
- if(Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.WindowsEditor) {
- Debug.Log(Tag + "[" + o.GetType().ToString() + "]: " + msg);
- } else {
- Console.WriteLine(Tag + "[" + o.GetType().ToString() + "]: " + msg);
- }
- }
- }
- public static void LogError(string msg, object o) {
- if(isShowErrorLog == false)
- return;
- Tag = "[ FrameCount:" + Time.frameCount + " ]";
- if(o == null) {
- if(Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.WindowsEditor) {
- Debug.Log(Tag + msg);
- } else {
- Console.WriteLine(Tag + msg);
- }
- } else {
- if(Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.WindowsEditor) {
- Debug.Log(Tag + "[" + o.GetType().ToString() + "]: " + msg);
- } else {
- Console.WriteLine(Tag + "[" + o.GetType().ToString() + "]: " + msg);
- }
- }
- }
- }
- }
|