local this = class("cameraController_photographPoint", require("ui.manager.camera.controller.cameraController"))
local PATH_CAMERA = "Program/Camera/pre_cinemachineVirtualPhotographPointCamera.prefab"

function this:ctor(mode)
  this.super.ctor(self, mode)
end

function this:switchIn(preMode, params)
  self:initVirCamera()
  self.cameraTactics:SetEnabled(true)
end

function this:switchOut(nextMode)
  self:onDestroy()
end

function this:initVirCamera()
  local goVirCam = L_GameUtil.loadVirtualCamera(nil, PATH_CAMERA)
  self.virCamera = goVirCam:GetComponent(typeof(C_CinemachineVirtualCamera))
  self.cameraPhotograph = goVirCam:GetComponent(typeof(CS.Lens.Gameplay.World.CameraPhotoGraph))
  self.cameraTactics = C_CameraManager.CreateCommonTactics(goVirCam, C_CinemachineBlendType.Cut, false)
end

function this:setInputProvider()
  if self.cameraTactics and self.cameraTactics.inputProvider then
    self.cameraTactics.inputProvider.enabled = true
  end
end

function this:onDestroy()
  if L_CommonUtil.isValid(self.virCamera) then
    C_GameObject.Destroy(self.virCamera.gameObject)
  end
  self.virCamera = nil
  C_CameraManager.RemoveTactics(self.cameraTactics)
  self.entity = nil
end

function this:getCameraPhotoGraph()
  return self.cameraPhotograph
end

function this:getVirCamera()
  return self.virCamera
end

return this
