void DrawGizmos() { if (ShowHitDebug == false) { return; } if (mHitData != null && mOwner != null && mOwner.transform != null) { HitCheckBase hitCheck = mHitData.hitCheckData; Vector3 normal = mOwner.transform.up; if (hitCheck.shapeType == EHitCheckShape.Fan) { Vector3 startVec = Quaternion.AngleAxis(-hitCheck.angle * 0.5f, normal) * mOwner.transform.forward; GizmosExtension.DrawFanShapeWithHeight(pos, normal, startVec, hitCheck.angle, hitCheck.radius, hitCheck.height); } else if (hitCheck.shapeType == EHitCheckShape.Cylinder || hitCheck.shapeType == EHitCheckShape.Capsule) { GizmosExtension.DrawCylinder(pos, normal, forwardDir, hitCheck.radius, hitCheck.height); } else if (hitCheck.shapeType == EHitCheckShape.LaserBeam) { GizmosExtension.DrawLaserBeam(pos, moveDirection, hitCheck.radius, hitCheck.height); } } }
void OnSceneUI(SceneView sceneView) { if (mHitData != null) { HitCheckBase hitCheck = mHitData.hitCheckData; Vector3 pos = debugDummy.transform.TransformPoint(mHitData.startPosition) + hitCheck.posOffset; Vector3 normal = debugDummy.transform.up; if (mHitData.moveSpeed > 0) { Vector3 startDir = debugDummy.transform.TransformDirection(mHitData.startDirection.normalized); Handles.ArrowCap(0, pos, Quaternion.LookRotation(startDir.normalized), 2f); } if (hitCheck.shapeType == EHitCheckShape.Fan) { Vector3 startVec = Quaternion.AngleAxis(-hitCheck.angle * 0.5f, normal) * debugDummy.transform.forward; GizmosExtension.DrawFanShapeWithHeight(pos, normal, startVec, hitCheck.angle, hitCheck.radius, hitCheck.height); } else if (hitCheck.shapeType == EHitCheckShape.Capsule || hitCheck.shapeType == EHitCheckShape.Cylinder) { GizmosExtension.DrawCylinder(pos, normal, debugDummy.transform.forward, hitCheck.radius, hitCheck.height); } else if (hitCheck.shapeType == EHitCheckShape.LaserBeam) { } } }
void OnDrawGizmos() { Vector3 pos = transform.position + offset; GizmosExtension.DrawFanShapeWithHeight(pos, transform.up, transform.right, angle, radius, height); }