public void OnEnable() { if (_treeView == null) { _treeView = new BurstMethodTreeView(new TreeViewState()); } _safetyChecks = BurstCompiler.Options.EnableBurstSafetyChecks; }
public void OnEnable() { if (_treeView == null) { _treeView = new BurstMethodTreeView(new TreeViewState()); } _safetyChecks = BurstCompiler.Options.EnableBurstSafetyChecks; var assemblyList = BurstReflection.GetAssemblyList(AssembliesType.Editor, onlyAssembliesThatPossiblyContainJobs: true); Task.Run( () => { // Do this stuff asynchronously. var result = BurstReflection.FindExecuteMethods(assemblyList); _targets = result.CompileTargets; _targets.Sort((left, right) => string.Compare(left.GetDisplayName(), right.GetDisplayName(), StringComparison.Ordinal)); return(result); }) .ContinueWith(t => { // Do this stuff on the main (UI) thread. if (t.Status == TaskStatus.RanToCompletion) { foreach (var logMessage in t.Result.LogMessages) { switch (logMessage.LogType) { case BurstReflection.LogType.Warning: Debug.LogWarning(logMessage.Message); break; case BurstReflection.LogType.Exception: Debug.LogException(logMessage.Exception); break; default: throw new InvalidOperationException(); } } _treeView.Targets = _targets; _treeView.Reload(); if (_selectedItem != null) { _treeView.TrySelectByDisplayName(_selectedItem); } _requiresRepaint = true; _initialized = true; } else if (t.Exception != null) { Debug.LogError($"Could not load Inspector: {t.Exception}"); } }); }
public void OnEnable() { if (_treeView == null) _treeView = new BurstMethodTreeView(new TreeViewState()); }