20 lines
648 B
C#
20 lines
648 B
C#
using Unity.Cinemachine;
|
|
using UnityEngine;
|
|
|
|
namespace BrewMonster
|
|
{
|
|
public class CameraController : MonoBehaviour
|
|
{
|
|
[SerializeField]private CinemachineCamera _cinemachineCamera;
|
|
private void Update()
|
|
{
|
|
//todo: should not always update
|
|
if (_cinemachineCamera.Follow == null && CECGameRun.Instance.GetHostPlayer() != null)
|
|
{
|
|
_cinemachineCamera.Follow = CECGameRun.Instance.GetHostPlayer().transform;
|
|
_cinemachineCamera.ForceCameraPosition(CECGameRun.Instance.GetHostPlayer().transform.position, Quaternion.identity);
|
|
}
|
|
}
|
|
}
|
|
}
|