using System;
using UnityEngine;
using UnityEngine.Events;
namespace Unity.Cinemachine
{
///
/// An abstract representation of a virtual camera which lives within the Unity scene
///
public interface ICinemachineCamera
{
///
/// Gets the name of this virtual camera. For use when deciding how to blend
/// to or from this camera
///
string Name { get; }
///
/// Gets a brief debug description of this camera, for use when displaying debug info
///
string Description { get; }
///
/// Camera state at the current time.
///
CameraState State { get; }
/// Will return false if this references a deleted object
bool IsValid { get; }
///
/// Returns the ICinemachineMixer within which this Camera is nested, or null.
///
ICinemachineMixer ParentCamera { get; }
///
/// Update the camera's state.
/// The implementation must guarantee against multiple calls per frame, and should
/// use CinemachineCore.UpdateVirtualCamera(ICinemachineCamera, Vector3, float), which
/// has protection against multiple calls per frame.
///
/// Default world Up, set by the CinemachineBrain
/// Delta time for time-based effects (ignore if less than 0)
void UpdateCameraState(Vector3 worldUp, float deltaTime);
///
/// Notification that this camera is being activated. This is sent to the newly activated camera.
/// Multiple camera may be active simultaneously for a while, if blending.
/// evt.IncomingCamera will always be "this".
///
/// Context for the camera activation.
void OnCameraActivated(ActivationEventParams evt);
/// This is sent with ActivationEvent
public struct ActivationEventParams
{
/// Object that originated the event
public ICinemachineMixer Origin;
/// Camera that is being deactivated (may be null)
public ICinemachineCamera OutgoingCamera;
/// Camera that is being activated (may be null)
public ICinemachineCamera IncomingCamera;
/// If true, then the transition is instantaneous
public bool IsCut;
/// Up direction for this frame. Unity vector in world coords.
public Vector3 WorldUp;
/// Effective deltaTime for this frame
public float DeltaTime;
}
/// Event that is fired when a Cinemachine camera is activated.
[Serializable] public class ActivationEvent : UnityEvent {}
}
///
/// This is a ICinemachineCamera that can own child ICinemachineCameras.
/// ICinemachineCamera nesting is defined using this interface.
///
public interface ICinemachineMixer : ICinemachineCamera
{
/// Check whether the cam is a live child of this camera.
/// The child ICienamchineCamera to check
/// If true, will only return true if this vcam is the dominant live child
/// True if the vcam is currently actively influencing the state of this vcam
bool IsLiveChild(ICinemachineCamera child, bool dominantChildOnly = false);
}
}