Was attempting to call UpdateGridVisual to clear on unit death and I somewhere broke something that I am getting a memory leak, it is tied to the Unit and Selecting them as SelectionVisual quit working and Action buttons don’t populate.
Had a rough night and having trouble thinking this morning. Booted with Diags but still not sure what I changed to cause error.
here is code
StackOverflowException: The requested operation caused a stack overflow.
System.String.CreateStringFromEncoding (System.Byte* bytes, System.Int32 byteLength, System.Text.Encoding encoding) (at <3dd5df5ef4974f29afeb2d3ba227c5da>:0)
System.Text.Encoding.GetString (System.Byte* bytes, System.Int32 byteCount) (at <3dd5df5ef4974f29afeb2d3ba227c5da>:0)
System.Text.Encoding.GetString (System.ReadOnlySpan`1[T] bytes) (at <3dd5df5ef4974f29afeb2d3ba227c5da>:0)
System.String.Ctor (System.SByte* value, System.Int32 startIndex, System.Int32 length, System.Text.Encoding enc) (at <3dd5df5ef4974f29afeb2d3ba227c5da>:0)
System.String.CreateString (System.SByte* value, System.Int32 startIndex, System.Int32 length, System.Text.Encoding enc) (at <3dd5df5ef4974f29afeb2d3ba227c5da>:0)
(wrapper managed-to-managed) System.String..ctor(sbyte*,int,int,System.Text.Encoding)
UnityEngine.StackTraceUtility.ExtractStackTrace () (at <790a43858b4b404fbe02a2b7b4a0d9d6>:0)
UnityEngine.DebugLogHandler.LogFormat (UnityEngine.LogType logType, UnityEngine.Object context, System.String format, System.Object[] args) (at <790a43858b4b404fbe02a2b7b4a0d9d6>:0)
UnityEngine.Logger.Log (UnityEngine.LogType logType, System.Object message) (at <790a43858b4b404fbe02a2b7b4a0d9d6>:0)
UnityEngine.Debug.LogError (System.Object message) (at <790a43858b4b404fbe02a2b7b4a0d9d6>:0)
UnitActionSystem.GetSelectedUnit () (at Assets/Game/Scripts/Controls/UnitActionSystem.cs:121)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:116)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVisualType) (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:108)
GridSystemVisual.UpdateGridVisual () (at Assets/Game/Scripts/Grid/GridSystemVisual.cs:138)
GridSystemVisual.ShowGridPositionList (System.Collections.Generic.List`1[T] gridPositionList, GridSystemVisual+GridVisualType gridVis<message truncated>```