aboutsummaryrefslogtreecommitdiff
path: root/Assets/Cinemachine/Base/Runtime/Core/ICinemachineCamera.cs
blob: 82e7af5f5af3a5c71c0044300a21e50a97076b15 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
using UnityEngine;

namespace Cinemachine
{
    /// <summary>
    /// An abstract representation of a virtual camera which lives within the Unity scene
    /// </summary>
    public interface ICinemachineCamera
    {
        /// <summary>
        /// Gets the name of this virtual camera. For use when deciding how to blend
        /// to or from this camera
        /// </summary>
        string Name { get; }

        /// <summary>
        /// Gets a brief debug description of this virtual camera, for use when displayiong debug info
        /// </summary>
        string Description { get; }

        /// <summary>
        /// Gets the priority of this <c>ICinemachineCamera</c>. The virtual camera
        /// will be inserted into the global priority stack based on this value.
        /// </summary>
        int Priority { get; set; }

        /// <summary>
        /// The thing the camera wants to look at (aim).  May be null.
        /// </summary>
        Transform LookAt { get; set; }

        /// <summary>
        /// The thing the camera wants to follow (moving camera).  May be null.
        /// </summary>
        Transform Follow { get; set; }

        /// <summary>
        /// Camera state at the current time.
        /// </summary>
        CameraState State { get; }

        /// <summary>
        /// Gets the virtual camera game attached to this class.
        /// </summary>
        GameObject VirtualCameraGameObject { get; }

        /// <summary>For cameras that implement child cameras, return the live child,
        /// otherwise, just returns self.</summary>
        ICinemachineCamera LiveChildOrSelf { get; }

        /// <summary>
        /// For cameras that implement child cameras, returns the parent vcam, otherwise null.
        /// </summary>
        ICinemachineCamera ParentCamera { get; }

        /// <summary>Check whether the vcam is a live child of this camera.</summary>
        /// <param name="vcam">The Virtual Camera to check</param>
        /// <returns>True if the vcam is currently actively influencing the state of this vcam</returns>
        bool IsLiveChild(ICinemachineCamera vcam);

        /// <summary>
        /// Updates this Cinemachine Camera. For an active camera this should be
        /// called once and only once each frame.  To guarantee this, you should never
        /// call this method directly.  Always use
        /// CinemachineCore.UpdateVirtualCamera(ICinemachineCamera, float), which
        /// has protection against multiple calls per frame.
        /// </summary>
        /// <param name="worldUp">Default world Up, set by the CinemachineBrain</param>
        /// <param name="deltaTime">Delta time for time-based effects (ignore if less than 0)</param>
        void UpdateCameraState(Vector3 worldUp, float deltaTime);

        /// <summary>
        /// Notification that a new camera is being activated.  This is sent to the
        /// currently active camera.  Both may be active simultaneously for a while, if blending.
        /// </summary>
        /// <param name="fromCam">The camera being deactivated.  May be null.</param>
        /// <param name="worldUp">Default world Up, set by the CinemachineBrain</param>
        /// <param name="deltaTime">Delta time for time-based effects (ignore if less than 0)</param>
        void OnTransitionFromCamera(ICinemachineCamera fromCam, Vector3 worldUp, float deltaTime);
    }
}