Speed up debug gizmos render

This commit is contained in:
2018-01-03 00:33:02 +07:00
parent 82b2ef048c
commit 9611419aca
3 changed files with 8 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
###### Version 3.1.0 ###### Version 3.1.0
* Fix Unity 5.6 warning * Fix Unity 5.6 warning
* Speed up debug gizmos render
* Disable iso object snapping by children * Disable iso object snapping by children
###### Version 3.0.2 ###### Version 3.0.2

View File

@@ -316,14 +316,14 @@ namespace IsoTools {
void OnDrawGizmos() { void OnDrawGizmos() {
var iso_world = isoWorld; var iso_world = isoWorld;
if ( iso_world ) { if ( iso_world ) {
if ( iso_world.isShowIsoBounds ) { if ( iso_world.isShowIsoBounds && iso_world.Internal_IsVisible(this) ) {
IsoUtils.DrawIsoCube( IsoUtils.DrawIsoCube(
iso_world, iso_world,
position + size * 0.5f, position + size * 0.5f,
size, size,
Color.red); Color.red);
} }
if ( iso_world.isShowScreenBounds ) { if ( iso_world.isShowScreenBounds && iso_world.Internal_IsVisible(this) ) {
IsoUtils.DrawRect( IsoUtils.DrawRect(
Internal.QTBounds, Internal.QTBounds,
Color.green); Color.green);
@@ -333,7 +333,7 @@ namespace IsoTools {
void OnDrawGizmosSelected() { void OnDrawGizmosSelected() {
var iso_world = isoWorld; 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 ) { for ( int i = 0, e = Internal.SelfDepends.Count; i < e; ++i ) {
IsoUtils.DrawLine( IsoUtils.DrawLine(
Internal.QTBounds.center, Internal.QTBounds.center,

View File

@@ -443,6 +443,10 @@ namespace IsoTools {
} }
} }
public bool Internal_IsVisible(IsoObject iso_object) {
return _screenSolver.curVisibles.Contains(iso_object);
}
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// //
// Private // Private