Merge systems #5
File diff suppressed because it is too large
Load Diff
@@ -8,6 +8,7 @@ public class PlayerController : MonoBehaviour
|
||||
public Camera playerCam;
|
||||
public float xLimit = 45;
|
||||
public float yLimit = 25;
|
||||
public bool cameraMovement = true;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
@@ -16,6 +17,8 @@ public class PlayerController : MonoBehaviour
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (cameraMovement)
|
||||
{
|
||||
float mouseX = 2 * (Input.mousePosition.x / playerCam.pixelWidth) - 1;
|
||||
float mouseY = -(2 * (Input.mousePosition.y / playerCam.pixelHeight) - 1);
|
||||
@@ -23,4 +26,5 @@ public class PlayerController : MonoBehaviour
|
||||
Quaternion rotation = Quaternion.Euler(yLimit * mouseY, xLimit * mouseX, 0);
|
||||
playerCam.transform.rotation = rotation;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
35
Assets/Scripts/QuestLogInteractable.cs
Normal file
35
Assets/Scripts/QuestLogInteractable.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class QuestLogInteractable : MonoBehaviour
|
||||
{
|
||||
|
||||
public GameObject journal;
|
||||
public PlayerController playerController;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void OnMouseDown()
|
||||
{
|
||||
Debug.Log("MOUSE DOWN ON INVENTORY");
|
||||
journal.SetActive(true);
|
||||
playerController.cameraMovement = false;
|
||||
}
|
||||
|
||||
public void CloseJournal()
|
||||
{
|
||||
Cursor.lockState = CursorLockMode.Locked;
|
||||
journal.SetActive(false);
|
||||
playerController.cameraMovement = true;
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/QuestLogInteractable.cs.meta
Normal file
11
Assets/Scripts/QuestLogInteractable.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c0493f659bb4e67428b686920758641b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user