void Initialize() { if (mInitilized || mInitEnumerator != null) { return; } mInitEnumerator = Settings.Init <SerializedRoot>( ); if (mInitEnumerator == null) { Debug.LogError(Settings.kLogPrefix + "Could not init Settings"); return; } EditorUpdate.Run(() => { if (mInitEnumerator == null) { return(true); } return(!mInitEnumerator.MoveNext()); }, () => { mInitilized = true; mSettings = new SettingsProxy(); mFieldRenderers = GetAllInstancesOfAllSubclassesOf(typeof(FieldRendererBase)); mInitEnumerator = null; }); }
public void IssueEditorUpdate() { if (EditorUpdate != null) { EditorUpdate.Invoke(); } }
public static Task <bool> updateText(string editorText) { _editorText = editorText; EditorUpdate?.Invoke(null, editorText); return(Task.FromResult(true)); }
public void EditorPlay(double deltaTime) { DOTween.ManualUpdate((float)deltaTime, (float)deltaTime); if (sequence.IsComplete()) { sequence.Rewind(false); EditorUpdate.RemoveEditorUpdatePlug(EditorPlay); } }
public void PlayPreview() { RegenerateSequence(); sequence.SetUpdate(UpdateType.Manual); sequence.ForceInit(); sequence.SetAutoKill(false); sequence.Restart(false); EditorUpdate.EditorUpdatePlug(EditorPlay); }
public void StopPreview() { try { sequence?.Complete(); sequence.Rewind(); } catch (Exception) { // ignored } EditorUpdate.RemoveEditorUpdatePlug(EditorPlay); }
public static void CheckItNow() { if (Directory.Exists("Assets/Plugins/UnityPurchasing/Bin")) { EditorUpdate.AddDefine("IAP", EditorUserBuildSettings.selectedBuildTargetGroup); if (Instance != null) { Instance.Close(); } } else { OpenWelcomeWindow(); } }
void Save() { if (mSaveProcess != null) { return; } mStatusMessage = "Saving ..."; mSaveProcess = mSettings.Save(Settings.FileName); EditorUpdate.Run(() => { if (mSaveProcess == null) { return(true); } return(!mSaveProcess.MoveNext()); }, () => { mSaveProcess = null; mStatusMessage = kReadyMessage; }); }
private void MasterTimeTick(object sender, EventArgs e) { EditorUpdate?.Invoke(this, e); }
internal static void EditorRootUpdate() { EditorUpdate?.Invoke(); }
private void ProcessForegroundQueue() { EditorUpdate?.Invoke(this, EventArgs.Empty); _foregroundStepStopwatch.Restart(); for (; _foregroundStepStopwatch.Elapsed.TotalMilliseconds < 16;) { if (_enumeration != null) { try { if (!_enumeration.MoveNext()) { _enumeration.Dispose(); _enumeration = null; } else { CurrentReport = _enumeration.Current; } } catch (Exception exception) { CurrentReport = exception.ToString(); Debug.LogError(exception); _enumeration?.Dispose(); _enumeration = null; } } else { Func <IEnumerable <ProgressBarReport> > task; lock (_gate) { if (_foregroundTasks.Count == 0) { CurrentReport = ""; _completeForegroundTasksCounter = 0; EditorApplication.update = Delegate.Remove(EditorApplication.update, _processForegroundQueue) as EditorApplication.CallbackFunction; return; } ++_completeForegroundTasksCounter; task = _foregroundTasks.Dequeue(); } try { _enumeration = task().GetEnumerator(); } catch (Exception exception) { CurrentReport = exception.ToString(); Debug.LogError(exception); } } } }