Esempio n. 1
0
    /// <summary>
    /// Calculates and draws a rectangle
    /// </summary>
    private void Rectangle()
    {
        float   rectSinParam = Mathf.Sin(lerpingHalfParam * 2 * Mathf.PI);
        float   rectCosParam = Mathf.Cos(lerpingHalfParam * 2 * Mathf.PI);
        Vector2 halfSizes    = new Vector2(
            1.5f * (rectSinParam * rectSizeAmplitude + (1 - rectSizeAmplitude)),
            1 * (rectCosParam * rectSizeAmplitude + (1 - rectSizeAmplitude))
            );

        CustomGizmos.DrawCrossedRect(new Vector3(4, 0, 1.5f), Vector3.forward, Vector3.right, halfSizes, 5);
    }