public override void Initialization() { base.Initialization(); _assembliesPath = EditorApplication.applicationPath.Substring(0, EditorApplication.applicationPath.LastIndexOf("/")) + "/Data/Managed"; _assemblies.Add(typeof(Type).Assembly.Location); _assemblies.Add(typeof(Button).Assembly.Location); _assemblies.Add(typeof(Main).Assembly.Location); _assemblies.Add(typeof(DOTween).Assembly.Location); _assemblies.Add(_assembliesPath + "/UnityEditor.dll"); _assemblies.Add(_assembliesPath + "/UnityEngine/UnityEngine.dll"); _assemblies.Add(_assembliesPath + "/UnityEngine/UnityEngine.CoreModule.dll"); _assemblies.Add(GlobalTools.GetDirectorySameLevelOfAssets("/Library/ScriptAssemblies/Assembly-CSharp.dll")); _assemblies.Add(GlobalTools.GetDirectorySameLevelOfAssets("/Library/ScriptAssemblies/Assembly-CSharp-Editor.dll")); _namespace = "using System;\r\nusing System.Collections;\r\nusing System.Collections.Generic;\r\nusing UnityEngine;\r\nusing UnityEngine.UI;\r\nusing UnityEditor;\r\nusing HT.Framework;\r\nusing DG.Tweening;\r\n"; _code = "GlobalTools.LogInfo(\"Hello world!\");"; TextAsset asset = AssetDatabase.LoadAssetAtPath("Assets/HTFramework/Editor/Utility/Template/DynamicExecuterTemplate.txt", typeof(TextAsset)) as TextAsset; if (asset) { _codeTemplate = asset.text; } }
/// <summary> /// 初始化 /// </summary> public void OnInitialization() { _module = Module as ExceptionHandler; #if UNITY_EDITOR _module.IsHandler = false; #endif #if UNITY_STANDALONE_WIN _module.FeedbackProgramPath = GlobalTools.GetDirectorySameLevelOfAssets(_module.FeedbackProgramPath); _logPath = GlobalTools.GetDirectorySameLevelOfAssets("/Log"); if (!Directory.Exists(_logPath)) { Directory.CreateDirectory(_logPath); } #endif if (_module.IsHandler) { Application.logMessageReceived += Handler; if (_module.IsEnableMailReport) { _sender = new EmailSender(_module.SendMailbox, _module.SendMailboxPassword, _module.ReceiveMailbox, _module.Host, _module.Port); } } }
internal override void OnInitialization() { base.OnInitialization(); #if UNITY_EDITOR IsHandler = false; #endif #if UNITY_STANDALONE_WIN FeedbackProgramPath = GlobalTools.GetDirectorySameLevelOfAssets(FeedbackProgramPath); _logPath = GlobalTools.GetDirectorySameLevelOfAssets("/Log"); if (!Directory.Exists(_logPath)) { Directory.CreateDirectory(_logPath); } #endif if (IsHandler) { Application.logMessageReceived += Handler; if (IsEnableMailReport) { _sender = new EmailSender(SendMailbox, SendMailboxPassword, ReceiveMailbox, Host, Port); } } }
private static void CopyHotfixDll() { if (!EditorApplication.isPlayingOrWillChangePlaymode) { string sourcePath = GlobalTools.GetDirectorySameLevelOfAssets(SourceDllPath); if (File.Exists(sourcePath)) { File.Copy(sourcePath, GlobalTools.GetDirectorySameLevelOfAssets(AssetsDllPath), true); AssetDatabase.Refresh(); Log.Info("更新:Assets/Hotfix/Hotfix.dll"); } } }
public override void Initialization() { base.Initialization(); _logPath = GlobalTools.GetDirectorySameLevelOfAssets("/Log"); _bugExePath = GlobalTools.GetDirectorySameLevelOfAssets("/Bug.exe"); #if !UNITY_EDITOR if (!Directory.Exists(_logPath)) { Directory.CreateDirectory(_logPath); } //注册异常处理委托 if (IsHandler) { Application.logMessageReceived += Handler; } #endif }