public override void LoadContent() { base.LoadContent(); dimension = this; state = STATE_BIRTH; Lights = new BlindList3D(); Lights.LoadContent(); ambientLight = new AmbientLight(); ambientLight.LoadContent(); AddLight(ambientLight); FinalImage = new RenderTarget2D(Global.device, Global.windowWidth, Global.windowHeight, false, SurfaceFormat.Color, DepthFormat.Depth24); OverlayImage = new RenderTarget2D(Global.device, Global.windowWidth, Global.windowHeight, false, SurfaceFormat.Color, DepthFormat.Depth24); TransImage = new RenderTarget2D(Global.device, Global.windowWidth, Global.windowHeight, false, SurfaceFormat.Color, DepthFormat.Depth24); Overlays = new BlindList3D(); Overlays.LoadContent(); Transparencies = new BlindList3D(); Transparencies.LoadContent(); skybox = new SkyBox(); skybox.LoadContent(); skybox.dimension = this; //OPTIONS wireFrame = false; mouseSensitivity = 0.001f; keySensitivity = 1f; gravity = -0.4f; _DebugMode = DebugModes.None; _ControlMode = ControlModes.None; _UpdateMode = UpdateModes.Normal; timeDilation = 1f; }
private void setUpdateMode(UpdateModes updataMode, string prompt) { Plugin.UpdateMode = updataMode; this.promptLabel.Text = prompt; if (updataMode == UpdateModes.Break) { this.playButton.Image = Resources.Play; this.toolTip.SetToolTip(_timelineDock.playButton, "Continue (F5)"); this.effectTimer.Enabled = false; } else { if (Plugin.EditMode == EditModes.Connect) { _currentFrame = -1; } this.effectTimer.Enabled = true; this.playButton.Image = Resources.Pause; this.toolTip.SetToolTip(_timelineDock.playButton, "Pause"); if (Plugin.EditMode == EditModes.Analyze) { bool bBreakedByLog = this._break_prompt.StartsWith("[applog]"); if (string.IsNullOrEmpty(this._break_prompt)) { } } } }
/// <summary> /// Gets the specified list excluding the second specified list. /// </summary> /// <param name="updateModes">The update modes to consider.</param> /// <param name="excludingUpdateModes">The excluding update modes to consider.</param> /// <returns></returns> public static UpdateModes[] Excluding( this UpdateModes[] updateModes, params UpdateModes[] excludingUpdateModes) { UpdateModes updateMode = updateModes.Aggregate((current, value) => current | value) & ~excludingUpdateModes.Aggregate((current, value) => current | value); return(Enum.GetValues(typeof(UpdateModes)).Cast <UpdateModes>().Where(p => (p & updateMode) == p).ToArray()); }
public Lerper(MonoBehaviour owner, Getter <float> getter, Action <float> setter, float duration, float target) { this.getter = getter; this.setter = setter; this.duration = duration; this.target = target; this.owner = owner; current = null; mode = UpdateModes.FixedUpdate; current = owner.StartCoroutine(Job()); }
public static float GetDeltaTime(TimeType timeType = TimeType.Scaled, UpdateModes mode = UpdateModes.Update) { if (timeType == TimeType.Scaled) { return(mode == UpdateModes.Update || mode == UpdateModes.LateUpdate ? Time.deltaTime : Time.fixedDeltaTime); } else { return(mode == UpdateModes.Update || mode == UpdateModes.LateUpdate ? Time.unscaledDeltaTime : Time.fixedUnscaledDeltaTime); } }
private async Task FetchBuilds(UpdateModes updateMode) { Log.Debug().Message("Fetching builds").Write(); foreach (var project in _projectList) { try { Log.Debug().Message($"Fetching builds for project \"{project.Name}\". ID: \"{project.Guid}\"").Write(); IAsyncEnumerable <IBuild> builds; if (LastUpdate.HasValue && !updateMode.HasFlag(UpdateModes.AllBuilds)) { Log.Debug().Message($"Fetching all builds since {LastUpdate.Value} for project \"{project.Name}\"").Write(); builds = project.FetchBuildsChangedSince(LastUpdate.Value); } else { Log.Debug().Message($"Fetching all builds for project \"{project.Name}\"").Write(); builds = project.FetchAllBuilds(); } var count = 0; await foreach (var build in builds) { _buildCache.AddOrReplace(build.CacheKey(), build); count += 1; } Log.Debug().Message($"Added \"{count}\" builds in project \"{project.Name}\". Build cache total: {_buildCache.Size}").Write(); var removedBuilds = project.FetchRemovedBuilds(); count = 0; await foreach (var build in removedBuilds) { _buildCache.Remove(build.CacheKey()); count += 1; } Log.Debug().Message($"Removed \"{count}\" builds in project \"{project.Name}\"").Write(); } catch (Exception ex) { var projectName = project.Name; ReportError("ErrorFetchingBuilds", projectName, ex); } } Log.Debug().Message("Done fetching builds").Write(); LastUpdate = DateTime.UtcNow; }
public async Task Update(UpdateModes mode = UpdateModes.DeltaBuilds) { var stopWatch = new Stopwatch(); stopWatch.Start(); Log.Info().Message("Starting update.").Write(); var treeResult = await Task.Run(async() => { var previousBuildStatus = _buildCache.CachedValues().ToDictionary(p => p.Key, p => p.Value.Status); var branchTask = FetchBranches(); var definitionsTask = FetchDefinitions(); var buildsTask = FetchBuilds(mode); await Task.WhenAll(branchTask, definitionsTask, buildsTask); Log.Debug().Message("Everything is fetched.").Write(); await UpdateBuilds(); CleanupBuilds(); var tree = BuildTree(); var currentBuildNodes = tree.AllChildren().OfType <IBuildNode>(); Log.Debug().Message("BuildTree is done. Producing notifications.").Write(); // don't show any notifications for the initial fetch IBuildTreeBuildsDelta delta = _oldTree == null ? new BuildTreeBuildsDelta() : new BuildTreeBuildsDelta(currentBuildNodes, previousBuildStatus, _configuration.PartialSucceededTreatmentMode); var notifications = _notificationFactory.ProduceNotifications(delta).ToList(); return(BuildTree : tree, Notifications : notifications); }); Log.Debug().Message("Calling notify.").Write(); _pipelineNotifier.Notify(treeResult.BuildTree, treeResult.Notifications); _oldTree = treeResult.BuildTree; stopWatch.Stop(); Log.Info().Message($"Update done in {stopWatch.ElapsedMilliseconds} ms.").Write(); }
public MySql(MySqlConnectionStringBuilder conStringBuilderBuilder, UpdateModes mode) { logger.Info("Initualize........."); UpdateMode = mode; _connectionStringBuilder = conStringBuilderBuilder; _buffer = SqlBuffer.Load(); if (AppSettings.Instance.MySqlDatabase == "") { AppSettings.Instance.MySqlDatabase = "TimeDataBase"; } VerifySql(); if (AppSettings.Instance.LastVersion != Program.CurrentVersion) { FixVersionMismatches(); } logger.Info("Initualize.........FINISHED!!!"); }
private void setUpdateMode(UpdateModes updataMode, string prompt) { Plugin.UpdateMode = updataMode; this.promptLabel.Text = prompt; if (updataMode == UpdateModes.Break) { this.playButton.Image = Resources.Play; this.toolTip.SetToolTip(_timelineDock.playButton, "Continue (F5)"); this.effectTimer.Enabled = false; //when breaked by cpp, allow to disable BreakAPP //when breaked by designer, don't allow to enable BreakAPP as it will cause inconsistence if (!Settings.Default.BreakAPP) { this.checkBoxBreakCPP.Enabled = false; } } else { _currentFrame = AgentDataPool.TotalFrames; this.effectTimer.Enabled = true; this.playButton.Image = Resources.Pause; this.toolTip.SetToolTip(_timelineDock.playButton, "Pause"); this.checkBoxBreakCPP.Enabled = true; if (Plugin.EditMode == EditModes.Analyze) { bool bBreakedByLog = this._break_prompt.StartsWith("[applog]"); if (string.IsNullOrEmpty(this._break_prompt)) { _agenttype_index = 0; _agentinstance_index = 0; } } } }
public static void ChangeUpdateAction(ActionEvent actionEvent, UpdateModes updateMode, Action action) { if (updateMode == UpdateModes.Update) { if (actionEvent == ActionEvent.Add) { OnUpate += action; } else { OnUpate -= action; } } else if (updateMode == UpdateModes.FixedUpdate) { if (actionEvent == ActionEvent.Add) { OnFixedUpdate += action; } else { OnFixedUpdate -= action; } } else { if (actionEvent == ActionEvent.Add) { OnLateUpdate += action; } else { OnLateUpdate -= action; } } }
/// <summary> /// Indicates whether the specified update mode list contains the specified update mode. /// </summary> /// <param name="updateModes">The specified update mode list to consider.</param> /// <param name="updateMode">The specified update mode to consider.</param> /// <returns></returns> public static bool Has( this UpdateModes[] updateModes, UpdateModes updateMode) { return((updateModes.Aggregate((current, value) => current | value) & updateMode) == updateMode); }
/// <summary> /// Gets the specified list excluding the secong specified list. /// </summary> /// <param name="updateMode">The update mode to consider.</param> /// <param name="excludingUpdateModes">The excluding update modes to consider.</param> /// <returns></returns> public static UpdateModes[] Excluding( this UpdateModes updateMode, params UpdateModes[] excludingUpdateModes) { return((new[] { updateMode }).Excluding(excludingUpdateModes)); }
public static void SetTranslationInUpdate(this Transform @this, out bool isFinish, out Vector3 intersection, Vector3 translate, Plane plane, float neighbourhood = 0, TimeType timeType = TimeType.Scaled, UpdateModes updateMode = UpdateModes.Update) { translate = GetTranslatonInUpdate(translate, timeType, updateMode); @this.SetTranslation(out isFinish, out intersection, translate, plane, neighbourhood); }
public static void SetTranslationInUpdate(this Transform @this, Vector3 translate, TimeType timeType = TimeType.Scaled, UpdateModes updateMode = UpdateModes.Update) { @this.Translate(GetTranslatonInUpdate(translate, timeType, updateMode)); }
public LuceneUpdateOptions(UpdateModes updateMode) { UpdateMode = updateMode; Fields = new List <string> (); }
private LuceneUpdateOptions() { UpdateMode = UpdateModes.Normal; Fields = new List <string> (); }
public Task Update(UpdateModes mode) => Pipeline.Update(mode);
private Lerper SetUpdate(UpdateModes mode) { this.mode = mode; return(this); }
public LuceneUpdateOptions(UpdateModes updateMode) { UpdateMode = updateMode; Fields = new List<string> (); }
public static void SetTranslationInUpdate(this Transform @this, out bool isFinish, Vector3 translate, Vector3 finalPosition, float neighbourhood = 0, TimeType timeType = TimeType.Scaled, UpdateModes updateMode = UpdateModes.Update) { translate = GetTranslatonInUpdate(translate, timeType, updateMode); @this.SetTranslation(out isFinish, translate, finalPosition, neighbourhood); }
private ScreenResolutions _screenResolution; private UpdateModes _updateMode; private DVideoPlayerClass _videoPlayer;
private static Vector3 GetTranslatonInUpdate(Vector3 translate, TimeType timeType = TimeType.Scaled, UpdateModes updateMode = UpdateModes.Update) { return(translate * TimeExtend.GetDeltaTime(timeType, updateMode)); }