Skip to content

Commit 0c72f55

Browse files
committed
Removed editor coroutines dependency from package
1 parent 4a49d04 commit 0c72f55

3 files changed

Lines changed: 7 additions & 21 deletions

File tree

Editor/EspidiGames.SOEventSystem.Editor.asmdef

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "EspidiGames.SOEventSystem.Editor",
33
"rootNamespace": "",
44
"references": [
5-
"GUID:478a2357cc57436488a56e564b08d223",
65
"GUID:2c34241bc039bf74eab5e91e0d89b976"
76
],
87
"includePlatforms": [

Editor/ScriptableObjectEventCreationWindow.cs

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System.Collections;
21
using System.Linq;
3-
using Unity.EditorCoroutines.Editor;
42
using UnityEditor;
53
using UnityEngine;
64

@@ -29,25 +27,17 @@ public class ScriptableObjectEventCreationWindow : EditorWindow
2927

3028
public static void OpenWindow()
3129
{
32-
//Calling this opens window normally (non-modal)
3330
_window = GetWindow<ScriptableObjectEventCreationWindow>(true, "Select Randomized Selected Objects");
3431
SetWindowSize(InitialWindowDimensions);
35-
EditorCoroutineUtility.StartCoroutineOwnerless(_window.MakeWindowModal());
36-
}
37-
38-
/// <summary>
39-
/// Coroutine that skips one editor frame and then makes Window modal.
40-
/// Necessary to open window from Project panel (right click -> Create/EspidiGames/SO Events / Open window)
41-
///For whatever reason, opening from that context menu left the window completely blank
42-
/// (it was working from unity menus though))
43-
/// </summary>
44-
private IEnumerator MakeWindowModal()
45-
{
46-
yield return null; //Wait just for one editor frame
4732

48-
this.ShowModalUtility();
33+
EditorApplication.delayCall += MakeWindowModal;
34+
void MakeWindowModal()
35+
{
36+
EditorApplication.delayCall -= MakeWindowModal;
37+
_window.ShowModalUtility();
38+
}
4939
}
50-
40+
5141
private void OnGUI()
5242
{
5343
EditorGUILayout.Space();

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
"email": "danigfe.dev@gmail.com",
1414
"url": "https://github.com/danigfedev"
1515
},
16-
"dependencies": {
17-
"com.unity.editorcoroutines": "1.0.0"
18-
},
1916
"keywords": [
2017
"so",
2118
"scriptableobject",

0 commit comments

Comments
 (0)