public override void TestDrawGizmos() { base.TestDrawGizmos(); // Draw 'grounding' volume var radius = capsuleCollider.radius; var center = capsuleCollider.center; var offset = Mathf.Max(0.0f, capsuleCollider.height * 0.5f - radius); var color = new Color(0.5f, 1.0f, 0.6f); if (_groundHitInfo.IsSlideSlopeGround(groundLimit)) { color = new Color(0.75f, 0.8f, 0.18f, 1f); } else { color = isOnGround ? (isValidGround ? Color.green : Color.blue) : Color.red; } DebugDraw.DebugWireSphere(ObjAdapter.transform.position + ObjAdapter.transform.rotation * (center - Vector3.up * offset), color, radius * 1.01f); // When on ledge, show ledge offset radius and state (solid / empty side) var standingOnLedge = isOnLedgeSolidSide || isOnLedgeEmptySide; if (standingOnLedge) { color = isOnLedgeSolidSide ? new Color(0.0f, 1.0f, 0.0f, 0.25f) : new Color(1.0f, 0.0f, 0.0f, 0.25f); DebugDraw.DebugCircle(ObjAdapter.transform.position, Vector3.up, color, ledgeOffset); } }
public void DrawHitBox(IGameEntity gameEntity, float time) { var hitBoxComponent = GetHitBoxComponent(gameEntity); if (hitBoxComponent != null) { var position = gameEntity.Position.Value; DebugDraw.DebugWireSphere(GetPosition(gameEntity), GetRadius(gameEntity), time); HitBoxGameObjectUpdater.DrawBoundBox(hitBoxComponent.HitBoxGameObject.transform, time); } }
public void DrawHitBox(IGameEntity gameEntity, float time) { var subManager = GetSubManager(gameEntity.EntityType); if (subManager != null) { DebugDraw.DebugWireSphere(GetPosition(gameEntity), GetRadius(gameEntity), time); foreach (var item in subManager.GetCollidersTransform(gameEntity.EntityKey)) { HitBoxGameObjectUpdater.DrawBoundBox(item, time); } } }