public void drawPingGizmos(RuntimeGizmoDrawer drawer) { Color pingColor; float pingSize; float animTime; Vector3 pingPos0, pingPos1; Quaternion pingRot0; foreach (var ping in _activePings) { if (ping.position0Func != null) { pingPos0 = ping.position0Func(); } else { pingPos0 = ping.position0; } if (ping.position1Func != null) { pingPos1 = ping.position1Func(); } else { pingPos1 = ping.position1; } pingRot0 = ping.rotation0; pingColor = ping.color; animTime = Mathf.Lerp(0f, 1f, ping.time / PING_DURATION); animTime = pingAnimCurve.Evaluate(animTime); pingSize = ping.sizeMultiplier * DEFAULT_PING_RADIUS; switch (ping.animType) { case AnimType.Expand: pingSize = pingSize * animTime; break; case AnimType.Fade: pingColor = ping.color.WithAlpha(1f - animTime); break; case AnimType.ExpandAndFade: pingSize = pingSize * animTime; pingColor = ping.color.WithAlpha(1f - animTime); break; } drawer.color = pingColor; switch (ping.shapeType) { case ShapeType.Sphere: drawer.DrawWireSphere(pingPos0, pingRot0, pingSize); break; case ShapeType.Capsule: drawer.DrawWireCapsule(pingPos0, pingPos1, pingSize); break; case ShapeType.Cone: drawer.DrawCone(pingPos0, pingPos1, pingSize); break; } } }