1 Star 0 Fork 0

XTST/UnityGameFramework

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
DebuggerComponent.OperationsWindow.cs 2.66 KB
一键复制 编辑 原始数据 按行查看 历史
Jiang Yin 提交于 2019-01-09 22:03 +08:00 . 完善类命名
//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2019 Jiang Yin. All rights reserved.
// Homepage: http://gameframework.cn/
// Feedback: mailto:jiangyin@gameframework.cn
//------------------------------------------------------------
using UnityEngine;
namespace UnityGameFramework.Runtime
{
public sealed partial class DebuggerComponent : GameFrameworkComponent
{
private sealed class OperationsWindow : ScrollableDebuggerWindowBase
{
protected override void OnDrawScrollableWindow()
{
GUILayout.Label("<b>Operations</b>");
GUILayout.BeginVertical("box");
{
ObjectPoolComponent objectPoolComponent = GameEntry.GetComponent<ObjectPoolComponent>();
if (objectPoolComponent != null)
{
if (GUILayout.Button("Object Pool Release", GUILayout.Height(30f)))
{
objectPoolComponent.Release();
}
if (GUILayout.Button("Object Pool Release All Unused", GUILayout.Height(30f)))
{
objectPoolComponent.ReleaseAllUnused();
}
}
ResourceComponent resourceCompoent = GameEntry.GetComponent<ResourceComponent>();
if (resourceCompoent != null)
{
if (GUILayout.Button("Unload Unused Assets", GUILayout.Height(30f)))
{
resourceCompoent.ForceUnloadUnusedAssets(false);
}
if (GUILayout.Button("Unload Unused Assets and Garbage Collect", GUILayout.Height(30f)))
{
resourceCompoent.ForceUnloadUnusedAssets(true);
}
}
if (GUILayout.Button("Shutdown Game Framework (None)", GUILayout.Height(30f)))
{
GameEntry.Shutdown(ShutdownType.None);
}
if (GUILayout.Button("Shutdown Game Framework (Restart)", GUILayout.Height(30f)))
{
GameEntry.Shutdown(ShutdownType.Restart);
}
if (GUILayout.Button("Shutdown Game Framework (Quit)", GUILayout.Height(30f)))
{
GameEntry.Shutdown(ShutdownType.Quit);
}
}
GUILayout.EndVertical();
}
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/XTST/UnityGameFramework.git
git@gitee.com:XTST/UnityGameFramework.git
XTST
UnityGameFramework
UnityGameFramework
master

搜索帮助