unnecessary algo little fix

This commit is contained in:
2016-04-21 12:41:01 +06:00
parent effb5f7b09
commit ef5be56a8f

View File

@@ -15,15 +15,8 @@ namespace IsoTools.Internal {
}
protected void DestroyUnnecessaryCheck() {
var unnecessary = true;
GetComponents<IsoPhysicHelperHolder>(_tmpHolders);
for ( int i = 0, e = _tmpHolders.Count; i < e; ++i ) {
if ( _tmpHolders[i] != this ) {
unnecessary = false;
break;
}
}
if ( unnecessary ) {
if ( _tmpHolders.Count == 1 && _tmpHolders[0] == this ) {
Destroy(physicHelper);
}
_tmpHolders.Clear();