Improvements: SpawnPointGizmo collision visualisation

echtnice

Member
These can possibly be adopted. Because others have it as a requirement or will have it in the future.

Line: 53

C#:
var extents = Vector3.zero;
extents.x = extents.z = spawnPoint.Size / 2;
extents.y = spawnPoint.GroundSnapHeight / 2;
var boxPosition = spawnPoint.transform.TransformPoint(extents);
var overlapCount = Physics.OverlapBoxNonAlloc(boxPosition, extents, spawnPoint.ObstructionColliders, spawnPoint.transform.rotation, spawnPoint.ObstructionLayers, QueryTriggerInteraction.Ignore);
if (overlapCount != 0) {
     for (int i = overlapCount - 1; i > -1; --i) {
         Handles.Label(spawnPoint.transform.position,
         spawnPoint.ObstructionColliders[i].transform.gameObject.name);
     }
}

Sometimes you can't see exactly whether the SpawnPoints are correctly placed, this code helps you to recognize this.
 

Justin

Administrator
Staff member
Good suggestion. I made a bit of modification to this but it'll be in the next update (after 2.3.5).
 
Top