Example #1
0
        private static void DrawGroupComposerGizmos(CinemachineGroupComposer target, GizmoType selectionType)
        {
            // Show the group bounding box, as viewed from the camera position
            if (target.LookAtTargetGroup != null)
            {
                Matrix4x4 m = Gizmos.matrix;
                Bounds    b = target.LastBounds;
                Gizmos.matrix = target.LastBoundsMatrix;
                Gizmos.color  = Color.yellow;

                if (target.VcamState.Lens.Orthographic)
                {
                    Gizmos.DrawWireCube(b.center, b.size);
                }
                else
                {
                    float   z = b.center.z;
                    Vector3 e = b.extents;
                    Gizmos.DrawFrustum(
                        Vector3.zero,
                        Mathf.Atan2(e.y, z) * Mathf.Rad2Deg * 2,
                        z + e.z, z - e.z, e.x / e.y);
                }
                Gizmos.matrix = m;
            }
        }
Example #2
0
 private static void DrawGroupComposerGizmos(CinemachineGroupComposer target, GizmoType selectionType)
 {
     // Show the group bounding box, as viewed from the camera position
     if (target.TargetGroup != null)
     {
         Matrix4x4 m = Gizmos.matrix;
         Bounds    b = target.m_LastBounds;
         Gizmos.matrix = target.m_lastBoundsMatrix;
         Gizmos.color  = Color.yellow;
         Gizmos.DrawWireCube(b.center, b.size);
         Gizmos.matrix = m;
     }
 }
 private void Awake()
 {
     InputManager.Instance.onLockOn           += () => UpdateLockOn(!lockedOn.Value);
     InputManager.Instance.onCycleTargetRight += () => TryCycleTarget(true);
     InputManager.Instance.onCycleTargetLeft  += () => TryCycleTarget(false);
     targetableColliders = new Collider[colliderLimit];
     lastTarget          = null;
     currentTarget       = null;
     currentWeight       = 0;
     lastSeenTargetTime  = Mathf.NegativeInfinity;
     ClearCycleTargets();
     targetingReticle = Instantiate <GameObject>(targetingReticlePrefab);
     targetingReticle.SetActive(false);
     framingTransposer = lockOnVirtualCam.GetCinemachineComponent <CinemachineFramingTransposer>();
     groupComposer     = lockOnVirtualCam.GetCinemachineComponent <CinemachineGroupComposer>();
 }
Example #4
0
        private static void DrawGroupComposerGizmos(CinemachineGroupComposer target, GizmoType selectionType)
        {
            // Show the group bounding box, as viewed from the camera position
            ICinemachineCamera vcam = target.VirtualCamera;

            if (vcam == null || vcam.LookAt == null)
            {
                return;
            }
            CinemachineTargetGroup group = vcam.LookAt.GetComponent <CinemachineTargetGroup>();

            if (group == null)
            {
                return;
            }
            Matrix4x4 m = Gizmos.matrix;
            Bounds    b = target.m_LastBounds;

            Gizmos.matrix = target.m_lastBoundsMatrix;
            Gizmos.color  = Color.yellow;
            Gizmos.DrawWireCube(b.center, b.size);
            Gizmos.matrix = m;
        }