Skip to content
Snippets Groups Projects
Commit e02ae402 authored by Nat10k's avatar Nat10k
Browse files

fix : conflicts with main

parent c6a55ee8
No related merge requests found
This diff is collapsed.
This diff is collapsed.
using Nightmare; using Nightmare;
using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine; using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.SceneManagement; using UnityEngine.SceneManagement;
using UnityEngine.SocialPlatforms;
using UnityEngine.UI; using UnityEngine.UI;
public class QuestManager : MonoBehaviour public class QuestManager : MonoBehaviour
...@@ -22,14 +18,30 @@ public class QuestManager : MonoBehaviour ...@@ -22,14 +18,30 @@ public class QuestManager : MonoBehaviour
PlayerCurrency playerCurr; PlayerCurrency playerCurr;
Controls controls;
InputAction click;
private void Awake() private void Awake()
{ {
controls = new Controls();
click = controls.UI.Click;
currQuest = questList[0]; currQuest = questList[0];
CompletedCanvas.enabled = false; CompletedCanvas.enabled = false;
loadedNext = false; loadedNext = false;
playerCurr = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerCurrency>(); playerCurr = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerCurrency>();
} }
private void OnEnable()
{
SceneManager.sceneLoaded += OnSceneLoaded;
click.Enable();
}
private void OnDisable()
{
click.Disable();
}
public Quest getCurrentQuest() public Quest getCurrentQuest()
{ {
return currQuest; return currQuest;
...@@ -37,7 +49,7 @@ public class QuestManager : MonoBehaviour ...@@ -37,7 +49,7 @@ public class QuestManager : MonoBehaviour
void Update() void Update()
{ {
if (Input.GetMouseButtonDown(0)) if (click.IsPressed())
{ {
if (CompletedCanvas.enabled == true) if (CompletedCanvas.enabled == true)
{ {
...@@ -56,11 +68,6 @@ public class QuestManager : MonoBehaviour ...@@ -56,11 +68,6 @@ public class QuestManager : MonoBehaviour
} }
} }
void OnEnable()
{
SceneManager.sceneLoaded += OnSceneLoaded;
}
void LateUpdate() void LateUpdate()
{ {
questText.text = "Quest\n"; questText.text = "Quest\n";
......
...@@ -14,7 +14,11 @@ public class SettingsManager : MonoBehaviour ...@@ -14,7 +14,11 @@ public class SettingsManager : MonoBehaviour
nameInput.text = PlayerPrefs.GetString("PlayerName", ""); nameInput.text = PlayerPrefs.GetString("PlayerName", "");
toggles[PlayerPrefs.GetInt("Difficulty", 0)].isOn = true; toggles[PlayerPrefs.GetInt("Difficulty", 0)].isOn = true;
#if MOBILE_INPUT
arToggle.isOn = PlayerPrefs.GetInt("isAR", 0) != 0; arToggle.isOn = PlayerPrefs.GetInt("isAR", 0) != 0;
#else
arToggle.gameObject.SetActive(false);
#endif
} }
public void SetPlayerName(string name) public void SetPlayerName(string name)
......
...@@ -19,12 +19,12 @@ namespace Nightmare ...@@ -19,12 +19,12 @@ namespace Nightmare
Vector3 movement; // The vector to store the direction of the player's movement. Vector3 movement; // The vector to store the direction of the player's movement.
Animator anim; // Reference to the animator component. Animator anim; // Reference to the animator component.
Rigidbody playerRigidbody; // Reference to the player's rigidbody. Rigidbody playerRigidbody; // Reference to the player's rigidbody.
int isAR = 0;
#if !MOBILE_INPUT #if !MOBILE_INPUT
int floorMask; // A layer mask so that a ray can be cast just at gameobjects on the floor layer. int floorMask; // A layer mask so that a ray can be cast just at gameobjects on the floor layer.
float camRayLength = 100f; // The length of the ray from the camera into the scene. float camRayLength = 100f; // The length of the ray from the camera into the scene.
#else #else
Vector2 lookDir; Vector2 lookDir;
int isAR;
#endif #endif
private Vector3 lastPosition; // Variable to store the last position private Vector3 lastPosition; // Variable to store the last position
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment