File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -65,15 +65,22 @@ static Startup()
65
65
{
66
66
EditorApplication . update += Update ;
67
67
// use this delegation to ensure dispose luavm at last
68
- EditorApplication . playmodeStateChanged += ( ) =>
68
+ EditorApplication . playModeStateChanged += ( PlayModeStateChange state ) =>
69
69
{
70
-
71
- if ( isPlaying == true && EditorApplication . isPlaying == false )
70
+ switch ( state )
72
71
{
73
- if ( LuaState . main != null ) LuaState . main . Dispose ( ) ;
72
+ case PlayModeStateChange . ExitingEditMode :
73
+ if ( isPlaying == true && EditorApplication . isPlaying == false )
74
+ {
75
+ if ( LuaState . main != null )
76
+ LuaState . main . Dispose ( ) ;
77
+ isPlaying = false ;
78
+ }
79
+ break ;
80
+ case PlayModeStateChange . EnteredPlayMode :
81
+ isPlaying = true ;
82
+ break ;
74
83
}
75
-
76
- isPlaying = EditorApplication . isPlaying ;
77
84
} ;
78
85
}
79
86
You can’t perform that action at this time.
0 commit comments