Skip to content

Commit

Permalink
Issue #245 simple fix for camera erratic behaviour (#250)
Browse files Browse the repository at this point in the history
* hair color mask material, old lady hairdo and glass, moustache, and shell bowl

Various art assets to make the townsfolk more unique. Bowl made from a giant shell.

* Fix Plant Critter mesh scaling and name (#239)

* Townsfolk_M animations, Palm2

* New tree type

* simple fix for camera

* Reset HasBeenPrewarmed (#243)

* [WIP] Added some table furniture (#233)

* Added some table furnitures

* Corrected all furniture prefabs to be prefab variant

* Added back recklol Dissolve effect (#217)

* Added recklol dissolve effect with some tweaks

* Added names to dissolve outputs

* Added a dissolve effect option in contextual menu and add alpha cutoff in Toon_Disolve

* [Bot] Automated dotnet-format update

* Imported Smurjo's models, reorganised folders

* Hotfix for null checking `ToState`. (#244)

* Wiki and Readme images

* Update README.md

* Update README.md

* Initial decoupling of CameraManager and SpawnSystem. Spawn system still needs reference to CameraManager, because it must provide it to Protagonist.

* Updated prefabs

* Added description to EventChannels

* Introduced RuntimeAnchors

Used in Spawn and CameraSystem for decoupling purposes

* [Bot] Automated dotnet-format update

* Changed the wait to EndOfFrame

Co-authored-by: Smurjo <Johanna@johanland.de>
Co-authored-by: treivize <42570903+treivize@users.noreply.github.com>
Co-authored-by: Ciro Continisio <ciro@unity3d.com>
Co-authored-by: Dave Rodriguez <drod7425@gmail.com>
Co-authored-by: David Lischinsky <david.lischinsky@outlook.com>
Co-authored-by: Jan Urbanec <UrbanecJ@seznam.cz>
  • Loading branch information
7 people committed Dec 5, 2020
1 parent e60d83c commit 973f96f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions UOP1_Project/Assets/Scripts/CameraManager.cs
@@ -1,6 +1,7 @@
using System;
using UnityEngine;
using Cinemachine;
using System.Collections;

public class CameraManager : MonoBehaviour
{
Expand All @@ -18,6 +19,8 @@ public class CameraManager : MonoBehaviour
[SerializeField] private TransformEventChannelSO _frameObjectChannel = default;


private bool cameraMovementLock = false;

public void SetupProtagonistVirtualCamera(Transform target)
{
freeLookVCam.Follow = target;
Expand Down Expand Up @@ -52,6 +55,15 @@ private void OnEnableMouseControlCamera()

Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;

StartCoroutine(DisableMouseControlForFrame());
}

IEnumerator DisableMouseControlForFrame()
{
cameraMovementLock = true;
yield return new WaitForEndOfFrame();
cameraMovementLock = false;
}

private void OnDisableMouseControlCamera()
Expand All @@ -69,6 +81,9 @@ private void OnDisableMouseControlCamera()

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

if (isDeviceMouse && !_isRMBPressed)
return;

Expand Down

0 comments on commit 973f96f

Please sign in to comment.