mirror of
https://github.com/BlackMATov/unity-iso-tools.git
synced 2025-12-15 09:16:08 +07:00
fix OOM bug
This commit is contained in:
@@ -457,10 +457,13 @@ namespace IsoTools {
|
|||||||
_sectorsSize += IsoUtils.Vec2MaxF(iso_internal.ScreenRect.size);
|
_sectorsSize += IsoUtils.Vec2MaxF(iso_internal.ScreenRect.size);
|
||||||
}
|
}
|
||||||
var min_sector_size = IsoToScreen(IsoUtils.vec3OneX).x - IsoToScreen(Vector3.zero).x;
|
var min_sector_size = IsoToScreen(IsoUtils.vec3OneX).x - IsoToScreen(Vector3.zero).x;
|
||||||
_sectorsSize = Mathf.Round(Mathf.Max(min_sector_size, _sectorsSize / _visibles.Count));
|
_sectorsSize = _visibles.Count > 0
|
||||||
|
? Mathf.Round(Mathf.Max(min_sector_size, _sectorsSize / _visibles.Count))
|
||||||
|
: min_sector_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupObjectsSectors() {
|
void SetupObjectsSectors() {
|
||||||
|
if ( _visibles.Count > 0 ) {
|
||||||
_sectorsMinNumPos = new Vector2(float.MaxValue, float.MaxValue);
|
_sectorsMinNumPos = new Vector2(float.MaxValue, float.MaxValue);
|
||||||
_sectorsMaxNumPos = new Vector2(float.MinValue, float.MinValue);
|
_sectorsMaxNumPos = new Vector2(float.MinValue, float.MinValue);
|
||||||
for ( int i = 0, e = _visibles.Count; i < e; ++i ) {
|
for ( int i = 0, e = _visibles.Count; i < e; ++i ) {
|
||||||
@@ -488,6 +491,10 @@ namespace IsoTools {
|
|||||||
_sectorsMaxNumPos.y = iso_internal.MaxSector.y;
|
_sectorsMaxNumPos.y = iso_internal.MaxSector.y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
_sectorsMinNumPos = Vector2.zero;
|
||||||
|
_sectorsMaxNumPos = new Vector2(_sectorsSize, _sectorsSize);
|
||||||
|
}
|
||||||
_sectorsNumPosCount = _sectorsMaxNumPos - _sectorsMinNumPos;
|
_sectorsNumPosCount = _sectorsMaxNumPos - _sectorsMinNumPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -436,7 +436,7 @@ PlayerSettings:
|
|||||||
WebGL::memorySize: 256
|
WebGL::memorySize: 256
|
||||||
iOS::Architecture: 0
|
iOS::Architecture: 0
|
||||||
iOS::EnableIncrementalBuildSupportForIl2cpp: 1
|
iOS::EnableIncrementalBuildSupportForIl2cpp: 1
|
||||||
iOS::ScriptingBackend: 0
|
iOS::ScriptingBackend: 1
|
||||||
tvOS::Architecture: 1
|
tvOS::Architecture: 1
|
||||||
tvOS::EnableIncrementalBuildSupportForIl2cpp: 0
|
tvOS::EnableIncrementalBuildSupportForIl2cpp: 0
|
||||||
tvOS::ScriptingBackend: 1
|
tvOS::ScriptingBackend: 1
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<Properties StartupItem="Assembly-CSharp.csproj">
|
<Properties StartupItem="Assembly-CSharp.csproj">
|
||||||
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" PreferredExecutionTarget="Unity.Instance.Unity Editor" />
|
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" PreferredExecutionTarget="Unity.Instance.Unity Editor" />
|
||||||
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/IsoTools/Tiled/TiledMap.cs">
|
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/IsoTools/Scripts/IsoWorld.cs">
|
||||||
<Files>
|
<Files>
|
||||||
<File FileName="Assets/IsoTools/Tiled/Internal/Editor/TiledMapPostprocessor.cs" Line="147" Column="38" />
|
<File FileName="Assets/IsoTools/Scripts/IsoWorld.cs" Line="462" Column="64" />
|
||||||
<File FileName="Assets/IsoTools/Tiled/TiledMapTileset.cs" Line="17" Column="1" />
|
|
||||||
<File FileName="Assets/IsoTools/Tiled/TiledMap.cs" Line="31" Column="3" />
|
|
||||||
</Files>
|
</Files>
|
||||||
</MonoDevelop.Ide.Workbench>
|
</MonoDevelop.Ide.Workbench>
|
||||||
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||||
<BreakpointStore />
|
<BreakpointStore>
|
||||||
|
<Breakpoint file="/Users/matov/Projects/UnityIso/Assets/IsoTools/Scripts/IsoWorld.cs" line="563" column="1" />
|
||||||
|
</BreakpointStore>
|
||||||
</MonoDevelop.Ide.DebuggingService.Breakpoints>
|
</MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||||
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
|
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
|
||||||
</Properties>
|
</Properties>
|
||||||
Reference in New Issue
Block a user