8

Unity3D研究院编辑器之监听Unity编辑器关闭事件(三十一)

 3 years ago
source link: https://www.xuanyusong.com/archives/4578
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Unity3D研究院编辑器之监听Unity编辑器关闭事件(三十一)

以前就想要这个功能,想让美术或者策划在关闭unity的时候做一些检查的操作。

using UnityEditor;
public class Test
    [InitializeOnLoadMethod]
    static void InitializeOnLoadMethod()
        EditorApplication.wantsToQuit -= Quit;
        EditorApplication.wantsToQuit += Quit;
    static bool Quit()
        EditorUtility.DisplayDialog("我就是不让你关闭unity", "我就是不让你关闭unity", "呵呵");
        return false; //return true表示可以关闭unity编辑器

Unity3D研究院编辑器之监听Unity编辑器关闭事件(三十一) - 雨松MOMO程序研究院 - 1

作者:雨松MOMO
专注移动互联网,Unity3D游戏开发
捐 赠写博客不易,如果您想请我喝一杯星巴克的话?就进来看吧!

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK