added reload animation and bullet limit
This commit is contained in:
30
Assets/Darkmatter/Code/Presentation/Camera/CameraService.cs
Normal file
30
Assets/Darkmatter/Code/Presentation/Camera/CameraService.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user