예제 #1
0
    private void DrawField()
    {
        Gizmos.color = Color.green;
        Gizmos.DrawLine(bottomLeft, bottomRight);
        Gizmos.DrawLine(topLeft, topRight);
        Gizmos.DrawLine(bottomLeft, topLeft);
        Gizmos.DrawLine(bottomRight, topRight);

        DebugGizmos.DrawX(mouseReticle, .1f * factor, mainCamera.transform, Color.red, 0);
    }
예제 #2
0
    private void OnDrawGizmos()
    {
        if (Application.isPlaying)
        {
            Gizmos.color = Color.red;
            Gizmos.DrawLine(bottomLeft, bottomRight);
            Gizmos.DrawLine(topLeft, topRight);
            Gizmos.DrawLine(bottomLeft, topLeft);
            Gizmos.DrawLine(bottomRight, topRight);

            DebugGizmos.DrawX(center, .1f * factor, mainCamera.transform, Color.red);
            DebugGizmos.DrawX(crosshair, .2f * factor, mainCamera.transform, Color.yellow);

            Vector3 cameraToCrosshair = (crosshair - mainCamera.transform.position).normalized;

            Gizmos.DrawRay(crosshair, cameraToCrosshair * 10);
        }
    }