little renaming

This commit is contained in:
2016-12-28 23:39:46 +07:00
parent c6de29bd5a
commit 6afa1e24f6
7 changed files with 2357 additions and 85 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -18,7 +18,7 @@ namespace IsoTools.Internal {
return isActiveAndEnabled && gameObject.activeInHierarchy; return isActiveAndEnabled && gameObject.activeInHierarchy;
} }
protected IsoWorld FindFirstActiveParentWorld() { protected IsoWorld FindFirstActiveWorld() {
IsoWorld ret_value = null; IsoWorld ret_value = null;
GetComponentsInParent<IsoWorld>(false, _tempWorlds); GetComponentsInParent<IsoWorld>(false, _tempWorlds);
for ( int i = 0, e = _tempWorlds.Count; i < e; ++i ) { for ( int i = 0, e = _tempWorlds.Count; i < e; ++i ) {

View File

@@ -14,7 +14,7 @@ namespace IsoTools.Internal {
// //
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
THold FindFirstActiveParent() { THold FindFirstActiveHolder() {
THold ret_value = null; THold ret_value = null;
GetComponentsInParent<THold>(false, _tempHolders); GetComponentsInParent<THold>(false, _tempHolders);
for ( int i = 0, e = _tempHolders.Count; i < e; ++i ) { for ( int i = 0, e = _tempHolders.Count; i < e; ++i ) {
@@ -44,7 +44,7 @@ namespace IsoTools.Internal {
public void RecacheHolder() { public void RecacheHolder() {
ResetHolder(); ResetHolder();
if ( IsActive() ) { if ( IsActive() ) {
_holder = FindFirstActiveParent(); _holder = FindFirstActiveHolder();
if ( _holder ) { if ( _holder ) {
_holder.AddInstance(this as TInst); _holder.AddInstance(this as TInst);
} }

View File

@@ -186,13 +186,11 @@ namespace IsoTools.Internal {
return false; return false;
} }
#if UNITY_EDITOR
public void OnDrawGizmos(IsoWorld iso_world) { public void OnDrawGizmos(IsoWorld iso_world) {
if ( iso_world.isShowQuadTree ) { if ( iso_world.isShowQuadTree ) {
_quadTree.VisitAllBounds(_qtBoundsLU); _quadTree.VisitAllBounds(_qtBoundsLU);
} }
} }
#endif
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// //

View File

@@ -35,10 +35,8 @@ namespace IsoTools.Internal {
return false; return false;
} }
#if UNITY_EDITOR
public void OnDrawGizmos() { public void OnDrawGizmos() {
} }
#endif
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// //
@@ -160,27 +158,27 @@ namespace IsoTools.Internal {
var cur_visibles = screen_solver.curVisibles; var cur_visibles = screen_solver.curVisibles;
for ( int i = 0, e = cur_visibles.Count; i < e; ++i ) { for ( int i = 0, e = cur_visibles.Count; i < e; ++i ) {
start_depth = RecursivePlaceIsoObject( start_depth = RecursivePlaceIsoObject(
cur_visibles[i], start_depth, step_depth); cur_visibles[i], step_depth, start_depth);
} }
} }
float RecursivePlaceIsoObject(IsoObject iso_object, float depth, float step_depth) { float RecursivePlaceIsoObject(IsoObject iso_object, float step_depth, float start_depth) {
if ( iso_object.Internal.Placed ) { if ( iso_object.Internal.Placed ) {
return depth; return start_depth;
} }
iso_object.Internal.Placed = true; iso_object.Internal.Placed = true;
var self_depends = iso_object.Internal.SelfDepends; var self_depends = iso_object.Internal.SelfDepends;
for ( int i = 0, e = self_depends.Count; i < e; ++i ) { for ( int i = 0, e = self_depends.Count; i < e; ++i ) {
depth = RecursivePlaceIsoObject(self_depends[i], depth, step_depth); start_depth = RecursivePlaceIsoObject(self_depends[i], step_depth, start_depth);
} }
if ( iso_object.mode == IsoObject.Mode.Mode3d ) { if ( iso_object.mode == IsoObject.Mode.Mode3d ) {
var zoffset = iso_object.Internal.Offset3d; var zoffset = iso_object.Internal.Offset3d;
var extents = iso_object.Internal.MinMax3d.size; var extents = iso_object.Internal.MinMax3d.size;
PlaceIsoObject(iso_object, depth + extents * 0.5f + zoffset); PlaceIsoObject(iso_object, start_depth + extents * 0.5f + zoffset);
return depth + extents + step_depth; return start_depth + extents + step_depth;
} else { } else {
PlaceIsoObject(iso_object, depth); PlaceIsoObject(iso_object, start_depth);
return depth + step_depth; return start_depth + step_depth;
} }
} }

View File

@@ -7,7 +7,7 @@ namespace IsoTools {
public sealed class IsoParent : IsoBehaviour<IsoParent> { public sealed class IsoParent : IsoBehaviour<IsoParent> {
public IsoWorld isoWorld { public IsoWorld isoWorld {
get { get {
return FindFirstActiveParentWorld(); return FindFirstActiveWorld();
} }
} }
} }

View File

@@ -285,7 +285,6 @@ namespace IsoTools {
// //
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
#if UNITY_EDITOR
[Header("Editor Only")] [Header("Editor Only")]
[SerializeField] bool _showIsoBounds = false; [SerializeField] bool _showIsoBounds = false;
public bool isShowIsoBounds { public bool isShowIsoBounds {
@@ -323,7 +322,6 @@ namespace IsoTools {
get { return _showQuadTree; } get { return _showQuadTree; }
set { _showQuadTree = value; } set { _showQuadTree = value; }
} }
#endif
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// //