public static T Instance() { if (instance == null) { instance = FindObjectOfType <T>(); if (FindObjectsOfType <T>().Length > 1) { ZDebug.Log("More than 1!"); } return(instance); } if (instance == null) { string instanceName = typeof(T).Name; ZDebug.Log("Instance Name: " + instanceName); GameObject instanceGO = GameObject.Find(instanceName); if (instanceGO == null) { instanceGO = new GameObject(instanceName); } instance = instanceGO.AddComponent <T>(); DontDestroyOnLoad(instanceGO); // 不会被释放 ZDebug.Log("Add New Singleton " + instance.name + " in Game!"); } else { ZDebug.Log("Already exist: " + instance.name); } return(instance); }
private void OnApplicationQuit() { foreach (IZDisposable disposable in _disposables) { if (disposable.DisposeOnApplicationQuit()) { ZDebug.Log(disposable.GetType() + " has been disposed"); } } }
public void DisposeAll() { foreach (IZDisposable disposable in _disposables) { if (disposable.Dispose()) { ZDebug.Log(disposable.GetType() + " has been disposed"); } } }
public void RemoveView(string name) { if (!HasView(name)) { ZDebug.Log(string.Format("Error in {0} View '{1}' don't registered.", this, name)); return; } lock (_views) { _views[name].Dispose(); _views.Remove(name); } }
IEnumerator Start() { // 这个GameManager需要自己实现 // yield return StartCoroutine (GameManager.Instance ().OnStart ()); ZConsole.Instance(); ZDebug.Init(); if (!APP_CONFIG.DEBUG) { ZDebug.DisplayType = ZDebug.OutputType.File; ZDebug.DisplayMethod = ZDebug.ConsoleLogMethod.Selected; } ZDebug.SelectType <App>(); ZDebug.Log("App Started!"); yield return(null); }
// int[] Arr=[3](1,2,3); void Start() { for (int i = 0; i < 10; i++) { C.Add(i); } Debuger.EnableLog = true; string b = string.Format("<Color=cyan>雨松MOMO{0}</Color>", a); Debuger.Log(b); EGDebug.enable = true; EGDebug.LogBold("zgh"); EGDebug.LogTitle("zz", 5, EGDebug.Color.blue); Debug.Log("1"); Debug.LogError("2"); Debug.LogWarning("2"); Debug.LogErrorFormat("3", a); EGDebug.LogList(C); EGDebug.Log("hh", EGDebug.Color.black); ZDebug.Log("GG", ZDebug.Color.yellow); ZDebug.LogError("zh", ZDebug.Color.cyan); }
public void MethodC(string value, int value2) { ZDebug.Log("MethodB: " + value + " -- " + value2); }
public void MethodB(string value) { ZDebug.Log("MethodB: " + value); }
public void MethodA() { ZDebug.Log("MethodA"); }
/// <summary> /// Force instance to be initialized /// </summary> public virtual void Init() { ZDebug.Log(typeof(T) + " is ready"); }
void Show() { ZDebug.Log("Start!"); }