31 lines
785 B
C#
31 lines
785 B
C#
using Darkmatter.Core;
|
|
using System;
|
|
using Unity.Cinemachine;
|
|
using UnityEngine;
|
|
using VContainer;
|
|
|
|
namespace Darkmatter.Presentation
|
|
{
|
|
public class CameraService : MonoBehaviour, ICameraService
|
|
{
|
|
public CinemachineThirdPersonFollow AdsCamera;
|
|
[Inject] private IInputReader inputReader;
|
|
public bool isAiming = false;
|
|
private void Start()
|
|
{
|
|
inputReader.OnAdsCameraSwitch += SwitchADSCamera;
|
|
AdsCamera.gameObject.SetActive(false);
|
|
}
|
|
private void OnDisable()
|
|
{
|
|
inputReader.OnAdsCameraSwitch -= SwitchADSCamera;
|
|
}
|
|
|
|
private void SwitchADSCamera()
|
|
{
|
|
isAiming = !isAiming;
|
|
AdsCamera.gameObject.SetActive(isAiming);
|
|
}
|
|
}
|
|
}
|