浏览代码

Merge branch 'main' into art-assets

/main
Ciro Continisio 4 年前
当前提交
7303c4fe
共有 1 个文件被更改,包括 15 次插入0 次删除
  1. 15
      UOP1_Project/Assets/Scripts/CameraManager.cs

15
UOP1_Project/Assets/Scripts/CameraManager.cs


using System;
using UnityEngine;
using Cinemachine;
using System.Collections;
public class CameraManager : MonoBehaviour
{

[Tooltip("The CameraManager listens to this event, fired by objects in any scene, to adapt camera position")]
[SerializeField] private TransformEventChannelSO _frameObjectChannel = default;
private bool cameraMovementLock = false;
public void SetupProtagonistVirtualCamera(Transform target)
{

Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
StartCoroutine(DisableMouseControlForFrame());
}
IEnumerator DisableMouseControlForFrame()
{
cameraMovementLock = true;
yield return new WaitForEndOfFrame();
cameraMovementLock = false;
}
private void OnDisableMouseControlCamera()

private void OnCameraMove(Vector2 cameraMovement, bool isDeviceMouse)
{
if (cameraMovementLock)
return;
if (isDeviceMouse && !_isRMBPressed)
return;

正在加载...
取消
保存