Skip to content

Commit 83cfc8c

Browse files
committed
Removed some logs
1 parent 953be5a commit 83cfc8c

File tree

3 files changed

+31
-8
lines changed

3 files changed

+31
-8
lines changed

packages/com.seaube.ecs-idl/Editor/EcsIdlPackagesPostprocessor.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ static void OnPostprocessAllAssets
5454
}
5555
}
5656

57-
UnityEngine.Debug.Log("any packages update?!");
5857
if(importedPkgs.Count > 0 || deletedPkgs.Count > 0 || movedPkgs.Count > 0) {
5958
RefreshEcsIdlCodegen(importedPkgs, deletedPkgs, movedPkgs);
6059
}
@@ -117,9 +116,8 @@ static void RefreshEcsIdlCodegen
117116
Progress.Report(progressId, 0.1f);
118117
codegen.Start();
119118

120-
UnityEngine.Debug.Log("getting plugins!");
121119
foreach(var plugin in GetCodegenPlugins()) {
122-
UnityEngine.Debug.Log("plugin!");
120+
// TODO: Custom codegen plugins
123121
}
124122
}
125123

@@ -135,11 +133,10 @@ static IEnumerable<EcsIdlCodegenPlugin> GetCodegenPlugins() {
135133

136134
if(pluginAttrs.Length > 0) {
137135
var pluginAttr = pluginAttrs[0] as EcsIdlCodegenPluginAttribute;
138-
UnityEngine.Debug.Log($"Plugin Name: {pluginAttr!.name}");
139136
var plugin =
140137
System.Activator.CreateInstance(type) as EcsIdlCodegenPlugin;
141138
if(plugin == null) {
142-
UnityEngine.Debug.Log(
139+
UnityEngine.Debug.LogError(
143140
$"Invalid EcsIdlCodegenPlugin: {pluginAttr!.name}"
144141
);
145142
} else {

packages/com.seaube.ecs-idl/Editor/EcsIdlUnitySyncDebugWindow.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ IEnumerator<string> Refresh() {
110110
cancelledRequested = true;
111111
return false;
112112
});
113-
UnityEngine.Debug.Log("Refresh()?");
114113

115114
try {
116115
foreach(var (pc, typeName) in RefreshTypes()) {
@@ -241,6 +240,11 @@ void PreviewEntityGameObjectPoolRemove
241240
}
242241

243242
void OnGUI() {
243+
if(refreshing) {
244+
EditorGUILayout.HelpBox(new GUIContent("Refreshing..."));
245+
return;
246+
}
247+
244248
scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);
245249
allMonoBehavioursFoldout = EditorGUILayout.BeginFoldoutHeaderGroup(
246250
allMonoBehavioursFoldout,

packages/com.seaube.ecs-idl/Editor/Importer/EcsIdlImporter.cs

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,32 @@ public override void OnImportAsset(AssetImportContext ctx) {
2929
codegen.StartInfo.RedirectStandardOutput = true;
3030
codegen.StartInfo.UseShellExecute = false;
3131

32+
var pkgJsonStr = "";
33+
var errMessage = "";
34+
35+
codegen.ErrorDataReceived += (_, ev) => {
36+
if(ev.Data != null) {
37+
errMessage += ev.Data;
38+
}
39+
};
40+
41+
codegen.OutputDataReceived += (_, ev) => {
42+
if(ev.Data != null) {
43+
pkgJsonStr += ev.Data;
44+
}
45+
};
46+
3247
try {
3348
codegen.Start();
34-
codegen.WaitForExit();
49+
codegen.BeginOutputReadLine();
50+
codegen.BeginErrorReadLine();
51+
if(!codegen.WaitForExit(10000)) {
52+
ctx.LogImportError("ECS IDL Importer timed out");
53+
return;
54+
} else {
55+
// See documentation https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.waitforexit?view=net-6.0#system-diagnostics-process-waitforexit(system-int32)
56+
codegen.WaitForExit();
57+
}
3558
} catch(System.Exception err) {
3659
ctx.LogImportError(err.Message);
3760
return;
@@ -42,7 +65,6 @@ public override void OnImportAsset(AssetImportContext ctx) {
4265
return;
4366
}
4467

45-
var pkgJsonStr = codegen.StandardOutput.ReadToEnd();
4668
var pkgJson = JsonUtility.FromJson<PkgInfoJson>(pkgJsonStr);
4769
var pkg = (EcsIdlPackage)ScriptableObject.CreateInstance(
4870
typeof(EcsIdlPackage)

0 commit comments

Comments
 (0)