예제 #1
0
        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);
        }
예제 #2
0
 private void OnApplicationQuit()
 {
     foreach (IZDisposable disposable in _disposables)
     {
         if (disposable.DisposeOnApplicationQuit())
         {
             ZDebug.Log(disposable.GetType() + " has been disposed");
         }
     }
 }
예제 #3
0
 public void DisposeAll()
 {
     foreach (IZDisposable disposable in _disposables)
     {
         if (disposable.Dispose())
         {
             ZDebug.Log(disposable.GetType() + " has been disposed");
         }
     }
 }
예제 #4
0
        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);
            }
        }
예제 #5
0
    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);
    }
예제 #6
0
    // 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);
    }
예제 #7
0
 public void MethodC(string value, int value2)
 {
     ZDebug.Log("MethodB: " + value + " -- " + value2);
 }
예제 #8
0
 public void MethodB(string value)
 {
     ZDebug.Log("MethodB: " + value);
 }
예제 #9
0
 public void MethodA()
 {
     ZDebug.Log("MethodA");
 }
예제 #10
0
 /// <summary>
 /// Force instance to be initialized
 /// </summary>
 public virtual void Init()
 {
     ZDebug.Log(typeof(T) + " is ready");
 }
예제 #11
0
파일: GameEntry.cs 프로젝트: memsyi/ZFrame
 void Show()
 {
     ZDebug.Log("Start!");
 }