Created
December 22, 2023 09:11
-
-
Save leventeren/d1ef7d3f3d4b755ed9b0c28ce4bd8b2e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
namespace EditorBehaviourTest | |
{ | |
[InitializeOnLoad] | |
public static class EditorBehaviour | |
{ | |
static EditorBehaviour() | |
{ | |
EditorApplication.playModeStateChanged += OnPlayModeStateChanged; | |
} | |
private static void OnPlayModeStateChanged(PlayModeStateChange playModeStateChange) | |
{ | |
if (playModeStateChange == PlayModeStateChange.EnteredPlayMode) | |
{ | |
//entered play mode | |
} | |
else if (playModeStateChange == PlayModeStateChange.EnteredEditMode) | |
{ | |
//entered edit mode | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment