// Draw red squares if things are misaligned, white if they're aligned properly public virtual void OnDrawGizmos() { if (m_DestroyTool) { return; } foreach (Transform occupiedSquare in m_Occupied) { if (ValidateOccupied(occupiedSquare.position)) { GizmoUtil.DrawSquareAround(occupiedSquare.position, Constants.GridSize, Color.white); } else { GizmoUtil.DrawSquareAround(occupiedSquare.position, 1f, Color.red); } } foreach (Transform doorwaySquare in m_Doorway) { if (ValidateDoorway(doorwaySquare.position)) { GizmoUtil.DrawSquareAround(doorwaySquare.position, 1f, Color.white); } else { GizmoUtil.DrawSquareAround(doorwaySquare.position, 1f, Color.red); } } }
void OnDrawGizmos() { if (EditorApplication.isPlayingOrWillChangePlaymode) { return; } GizmoUtil.DrawColliders(GetComponents <Collider>(), Config.Instance.GetHitboxColor(type), true); }
private void OnDrawGizmosSelected() { if (currentPath == null) { return; } GizmoUtil.DrawPathGizmo(currentPath); }
void OnDrawGizmos() { Gizmos.DrawSphere(Position, .1f); GizmoUtil.GizmosDrawArrow(Position, Position + Velocity * .2f, Color.yellow); GizmoUtil.GizmosDrawArrow(Position, Position + Up, Color.white); Gizmos.color = Color.red; Gizmos.DrawLine(Position, Position + Up * Dimensions.y); }
void OnDrawGizmos() { Collider[] colliders = includeChildren ? GetComponentsInChildren <Collider>() : GetComponents <Collider>(); if (colliders == null) { return; } GizmoUtil.DrawColliders3D(colliders, color, solid); }
void OnDrawGizmos() { if (!enableRaycastDebugging) { return; } foreach (var info in raycastDebugs) { GizmoUtil.DrawCircle(info.origin, 0.1f, Color.yellow); GizmoUtil.DrawArrow(info.origin, info.origin + info.direction * info.distance, Color.yellow); } }
public void OnDrawGizmos() { HashSet <GameObject> allCloseObjects = new HashSet <GameObject>(); Gizmos.color = Color.red; foreach (InteractionHand kHand in _trackingHands) { allCloseObjects.UnionWith(kHand.closeObjects); foreach (InteractionPoint kPoint in kHand.trackedPoints) { Gizmos.DrawSphere(kPoint.globalPosition, 0.005f); if (kPoint.isConnected) { Gizmos.color = Color.cyan; Gizmos.DrawSphere(kPoint.globalReferencePosition, 0.005f); GizmoUtil.DrawLine(kPoint.globalPosition, kPoint.globalReferencePosition); } } } GizmoUtil.pushMatrix(); foreach (GameObject obj in allCloseObjects.Where(o => o != null)) { GizmoUtil.relativeTo(obj); InteractionObject interactionObject = InteractionObject.getInteractionObject(obj); if (interactionObject.rigidbody == null) { Gizmos.color = Color.blue; } else { Gizmos.color = obj.GetComponent <Rigidbody>().isKinematic ? Color.green : Color.magenta; } if (_objectsToReEnable.ContainsKey(interactionObject)) { Gizmos.color = Color.red; } Gizmos.DrawWireCube(Vector3.zero, Vector3.one * 1.1f); } GizmoUtil.popMatrix(); }
/// <summary> /// Callback to draw gizmos that are pickable and always drawn. /// </summary> void OnDrawGizmos() { if (CheckRegions == null) { return; } #if UNITY_EDITOR if (EditorApplication.isPlayingOrWillChangePlaymode && !isView) { return; } #endif using (GizmoUtil.With(Color.white)) { foreach (var region in CheckRegions) { GizmoUtil.DrawBox(GetWorldRegion(region, dir)); } } }