Example #1
0
        /// <summary>
        /// 屏幕截图
        /// </summary>
        private IEnumerator ScreenShot()
        {
            string path = "";

#if UNITY_ANDROID
            path = "/sdcard/DCIM/ScreenShots/";
#endif

#if UNITY_STANDALONE_WIN || UNITY_EDITOR
            path = Application.dataPath + "/ScreenShots/";
#endif

            if (path != "")
            {
                Main.m_Debug.IsEnableDebugger = false;
                yield return(YieldInstructioner.GetWaitForEndOfFrame());

                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }
                Texture2D texture = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false);
                texture.ReadPixels(new Rect(0, 0, Screen.width, Screen.height), 0, 0);
                texture.Apply();
                string name  = "ScreenShotImage_" + DateTime.Now.ToString("yyyyMMddhhmmss") + ".png";
                byte[] bytes = texture.EncodeToPNG();
                File.WriteAllBytes(path + name, bytes);
                Main.m_Debug.IsEnableDebugger = true;
            }
            else
            {
                Log.Warning("当前平台不支持截屏!");
                yield return(0);
            }
        }
Example #2
0
        private IEnumerator EndOfFrame()
        {
            while (enabled)
            {
                yield return(YieldInstructioner.GetWaitForEndOfFrame());

                _isOnce = false;
            }
        }
Example #3
0
        private IEnumerator EndOfFrame()
        {
            while (enabled)
            {
                yield return(YieldInstructioner.GetWaitForEndOfFrame());

                // Reset one-frame highlighting state after each HighlightingEffect in the scene has finished rendering
                once = false;
            }
        }
        /// <summary>
        /// 重新收集调试器游戏对象
        /// </summary>
        private IEnumerator CollectDebuggerGameObjects()
        {
            yield return(YieldInstructioner.GetWaitForEndOfFrame());

            Main.m_ReferencePool.Despawns(_gameObjects);
            GameObjectRoots.Clear();

            _gameObjectCaches.Clear();
            GlobalTools.GetRootGameObjectsInAllScene(_gameObjectCaches);
            for (int i = 0; i < _gameObjectCaches.Count; i++)
            {
                CollectDebuggerGameObject(_gameObjectCaches[i].transform, null);
            }
            CurrentGameObject        = null;
            IsShowGameObjectFiltrate = false;
        }