diff --git a/Assets/IsoTools/Docs/CHANGELOG.md b/Assets/IsoTools/Docs/CHANGELOG.md index 26f2588..71eb141 100644 --- a/Assets/IsoTools/Docs/CHANGELOG.md +++ b/Assets/IsoTools/Docs/CHANGELOG.md @@ -1,6 +1,7 @@ ###### Version 3.1.0 * Fix Unity 5.6 warning +* Speed up debug gizmos render * Disable iso object snapping by children ###### Version 3.0.2 diff --git a/Assets/IsoTools/Scripts/IsoObject.cs b/Assets/IsoTools/Scripts/IsoObject.cs index 3535c29..76756bd 100644 --- a/Assets/IsoTools/Scripts/IsoObject.cs +++ b/Assets/IsoTools/Scripts/IsoObject.cs @@ -316,14 +316,14 @@ namespace IsoTools { void OnDrawGizmos() { var iso_world = isoWorld; if ( iso_world ) { - if ( iso_world.isShowIsoBounds ) { + if ( iso_world.isShowIsoBounds && iso_world.Internal_IsVisible(this) ) { IsoUtils.DrawIsoCube( iso_world, position + size * 0.5f, size, Color.red); } - if ( iso_world.isShowScreenBounds ) { + if ( iso_world.isShowScreenBounds && iso_world.Internal_IsVisible(this) ) { IsoUtils.DrawRect( Internal.QTBounds, Color.green); @@ -333,7 +333,7 @@ namespace IsoTools { void OnDrawGizmosSelected() { var iso_world = isoWorld; - if ( iso_world && iso_world.isShowDepends ) { + if ( iso_world && iso_world.isShowDepends && iso_world.Internal_IsVisible(this) ) { for ( int i = 0, e = Internal.SelfDepends.Count; i < e; ++i ) { IsoUtils.DrawLine( Internal.QTBounds.center, diff --git a/Assets/IsoTools/Scripts/IsoWorld.cs b/Assets/IsoTools/Scripts/IsoWorld.cs index 0239fea..f4d7035 100644 --- a/Assets/IsoTools/Scripts/IsoWorld.cs +++ b/Assets/IsoTools/Scripts/IsoWorld.cs @@ -443,6 +443,10 @@ namespace IsoTools { } } + public bool Internal_IsVisible(IsoObject iso_object) { + return _screenSolver.curVisibles.Contains(iso_object); + } + // --------------------------------------------------------------------- // // Private