Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEditor;
- using UnityEngine;
- public static class EditorTestScript
- {
- static EditorTestScript()
- {
- Debug.Log("Static Constructor");
- AssemblyReloadEvents.beforeAssemblyReload += OnBeforeAssemblyReload;
- AssemblyReloadEvents.afterAssemblyReload += OnAfterAssemblyReload;
- }
- [UnityEditor.Callbacks.DidReloadScripts]
- private static void AssemblyReload()
- {
- if (EditorApplication.isCompiling || EditorApplication.isUpdating)
- {
- EditorApplication.delayCall += AssemblyReload;
- return;
- }
- EditorApplication.delayCall += UpdateDefines;
- }
- public static void UpdateDefines()
- {
- Debug.Log("Reload Scripts");
- }
- [UnityEditor.InitializeOnLoadMethod]
- public static void Initialise()
- {
- Debug.Log("Initialise On Load");
- }
- public static void OnBeforeAssemblyReload()
- {
- Debug.Log("Before Assembly Reload");
- }
- public static void OnAfterAssemblyReload()
- {
- Debug.Log("After Assembly Reload");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment