unity编辑器之自动提示订外卖
1、问题来源
2、先上代码
using UnityEngine; using System.Collections; using UnityEditor; [InitializeOnLoad] public class OrdLunch { static OrdLunch() { if (!EditorApplication.isPlayingOrWillChangePlaymode) { EditorApplication.update += ShowOrder; } } static void ShowOrder() { if (System.DateTime.Now.Hour == 11 && System.DateTime.Now.Minute == 0 && System.DateTime.Now.Second == 0) { if (EditorUtility.DisplayDialog("Order Lunch", "该订外卖了小兄弟!", "好的!", "取消")) { Application.OpenURL("https://www.ele.me/place/ws102f14udy7?latitude=22.555419&longitude=113.940784"); } } } }
3、使用方法