/// <summary>Internal method to notify the NavmeshCut that it has just been used to update the navmesh</summary> internal override void NotifyUpdated(GridLookup <NavmeshClipper> .Root previousState) { previousState.previousPosition = tr.position; if (useRotationAndScale) { previousState.previousRotation = tr.rotation; } }
// Token: 0x060026AD RID: 9901 RVA: 0x001A901C File Offset: 0x001A721C private void HandleOnDisableCallback(NavmeshClipper obj) { GridLookup <NavmeshClipper> .Root root = this.handler.cuts.GetRoot(obj); if (root != null) { this.forcedReloadRects.Add(root.previousBounds); this.handler.cuts.Remove(obj); } this.lastUpdateTime = float.NegativeInfinity; }
// Token: 0x060026A8 RID: 9896 RVA: 0x001A8EBC File Offset: 0x001A70BC public void DiscardPending() { if (this.handler != null) { for (GridLookup <NavmeshClipper> .Root root = this.handler.cuts.AllItems; root != null; root = root.next) { if (root.obj.RequiresUpdate()) { root.obj.NotifyUpdated(); } } } this.forcedReloadRects.Clear(); }
// Token: 0x060026AF RID: 9903 RVA: 0x001A90D0 File Offset: 0x001A72D0 public void ForceUpdate() { if (this.handler == null) { throw new Exception("Cannot update graphs. No TileHandler. Do not call the ForceUpdate method in Awake."); } this.lastUpdateTime = Time.realtimeSinceStartup; if (!this.handler.isValid) { if (!this.handler.graph.exists) { this.UseSpecifiedHandler(null); return; } Debug.Log("TileHandler no longer matched the underlaying graph (possibly because of a graph scan). Recreating TileHandler..."); this.UseSpecifiedHandler(new TileHandler(this.handler.graph)); this.handler.CreateTileTypesFromGraph(); this.forcedReloadRects.Add(new IntRect(int.MinValue, int.MinValue, int.MaxValue, int.MaxValue)); } GridLookup <NavmeshClipper> .Root allItems = this.handler.cuts.AllItems; if (this.forcedReloadRects.Count == 0) { int num = 0; for (GridLookup <NavmeshClipper> .Root root = allItems; root != null; root = root.next) { if (root.obj.RequiresUpdate()) { num++; break; } } if (num == 0) { return; } } bool flag = this.handler.StartBatchLoad(); for (int i = 0; i < this.forcedReloadRects.Count; i++) { this.handler.ReloadInBounds(this.forcedReloadRects[i]); } this.forcedReloadRects.Clear(); for (GridLookup <NavmeshClipper> .Root root2 = allItems; root2 != null; root2 = root2.next) { if (root2.obj.RequiresUpdate()) { this.handler.ReloadInBounds(root2.previousBounds); Rect bounds = root2.obj.GetBounds(this.handler.graph.transform); IntRect touchingTilesInGraphSpace = this.handler.graph.GetTouchingTilesInGraphSpace(bounds); this.handler.cuts.Move(root2.obj, touchingTilesInGraphSpace); this.handler.ReloadInBounds(touchingTilesInGraphSpace); } } for (GridLookup <NavmeshClipper> .Root root3 = allItems; root3 != null; root3 = root3.next) { if (root3.obj.RequiresUpdate()) { root3.obj.NotifyUpdated(); } } if (flag) { this.handler.EndBatchLoad(); } }
public abstract bool RequiresUpdate(GridLookup <NavmeshClipper> .Root previousState);
internal abstract void NotifyUpdated(GridLookup <NavmeshClipper> .Root previousState);
/// <summary> /// Returns true if this object has moved so much that it requires an update. /// When an update to the navmesh has been done, call NotifyUpdated to be able to get /// relavant output from this method again. /// </summary> public override bool RequiresUpdate(GridLookup <NavmeshClipper> .Root previousState) { return((tr.position - previousState.previousPosition).sqrMagnitude > updateDistance * updateDistance || (useRotationAndScale && (Quaternion.Angle(previousState.previousRotation, tr.rotation) > updateRotationDistance))); }
public static void Configure(this GridLookupSettings settings, GridLookup gridLkp, HtmlHelper html, ViewContext viewContext, params string[] arguments) { settings.Width = Unit.Percentage(100); settings.Height = Unit.Percentage(100); settings.GridViewStyles.Header.Wrap = DefaultBoolean.True; settings.GridViewProperties.Settings.HorizontalScrollBarMode = ScrollBarMode.Auto; settings.GridViewProperties.Settings.VerticalScrollBarMode = ScrollBarMode.Auto; //settings.GridViewProperties.SettingsExport.EnableClientSideExportAPI = true; //settings.SettingsExport.ExcelExportMode = DevExpress.Export.ExportType.DataAware; settings.GridViewProperties.Settings.ShowTitlePanel = true; //settings.GridViewProperties.Ti = gridData.Title; settings.GridViewStyles.AlternatingRow.BackColor = gridLkp.Data.AlternateRowColor; settings.Name = gridLkp.Name; settings.KeyFieldName = gridLkp.KeyColumnName; #region Configure Toolbars if (gridLkp.Data.ToolBarOptions.Show) { settings.AddToolBar(html, viewContext, gridLkp.Data.ToolbarItems, gridLkp.Data.ToolBarOptions); } #endregion #region Configure Columns foreach (var col in gridLkp.Data.DisplayColumns) { if (col.ColumnAction != null) { settings.Columns.Add(col.ColumnAction); var lcol = settings.Columns[col.Name] as MVCxGridViewColumn; if (!string.IsNullOrEmpty(col.DisplayName)) { lcol.Caption = col.DisplayName; } lcol.SetProperties(col); continue; } MVCxGridViewColumn gcol = settings.Columns.Add(col.Name, col.DisplayName, col.ColumnType); gcol.Set(col); } #endregion #region Configure Callback Route if (gridLkp.Data.CallBackRoute != null) { settings.GridViewProperties.CallbackRouteValues = gridLkp.Data.CallBackRoute; } #endregion //#region Configure Buttons //foreach (var btn in gridData.Buttons) //{ // settings.AddButton(btn.Type, btn.Display); //} //#endregion if (gridLkp.Data.ButtonOptions != null) { settings.CommandColumn.Visible = gridLkp.Data.ButtonOptions.Show; settings.CommandColumn.ShowNewButtonInHeader = gridLkp.Data.ButtonOptions.DisplayAddButtonInGridHeader; settings.CommandColumn.ShowNewButton = gridLkp.Data.ButtonOptions.DisplayAddButton; settings.CommandColumn.ShowCancelButton = gridLkp.Data.ButtonOptions.DisplayCancelButton; settings.CommandColumn.ShowEditButton = gridLkp.Data.ButtonOptions.DisplayEditButton; settings.CommandColumn.ShowUpdateButton = gridLkp.Data.ButtonOptions.DisplayUpdateButton; settings.CommandColumn.ShowDeleteButton = gridLkp.Data.ButtonOptions.DisplayDeleteButton; settings.CommandColumn.Width = Unit.Percentage(gridLkp.Data.ButtonOptions.Width); } }