Death Square Added
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using Cinemachine;
|
||||
using Level;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.U2D;
|
||||
|
||||
namespace Camera
|
||||
@@ -20,20 +22,18 @@ namespace Camera
|
||||
{
|
||||
_cinemachineVirtualCamera = GetComponent<CinemachineVirtualCamera>();
|
||||
pixelPerfectCamera = GameObject.FindObjectOfType<PixelPerfectCamera>();
|
||||
LevelManager.Instance.OnLevelChanged.AddListener(UpdateCamera);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
private void UpdateCamera()
|
||||
{
|
||||
if (LevelManager.Instance.CurrentLevel?.FixedCameraPoint == null)
|
||||
if (LevelManager.Instance.CurrentLevel.FixedCameraPoint == null)
|
||||
{
|
||||
if (_cinemachineVirtualCamera.Follow == null)
|
||||
{
|
||||
_cinemachineVirtualCamera.Follow = LevelManager.Instance.Player.transform;
|
||||
pixelPerfectCamera.refResolutionX = FollowResolutionX;
|
||||
pixelPerfectCamera.refResolutionY = FollowResolutionY;
|
||||
}
|
||||
_cinemachineVirtualCamera.Follow = LevelManager.Instance.Player.transform;
|
||||
pixelPerfectCamera.refResolutionX = FollowResolutionX;
|
||||
pixelPerfectCamera.refResolutionY = FollowResolutionY;
|
||||
}
|
||||
else if (_cinemachineVirtualCamera.Follow != LevelManager.Instance.CurrentLevel.FixedCameraPoint)
|
||||
else
|
||||
{
|
||||
_cinemachineVirtualCamera.Follow = LevelManager.Instance.CurrentLevel.FixedCameraPoint;
|
||||
pixelPerfectCamera.refResolutionX = FixedResolutionX;
|
||||
|
Reference in New Issue
Block a user