Bug Fixes from v1.0

- Fix lighting on desert
- Move dialogue radius to correct spot
- Disable movement while talking to NPCs
- Move desert spawn point a little bit
This commit is contained in:
2022-08-31 22:56:09 -07:00
parent c73a2e918c
commit b907cdcd9b
20 changed files with 828 additions and 52 deletions

View File

@@ -7,6 +7,18 @@ namespace Scampz.GameJam
[SerializeField]
private Animator animator;
public static LevelChanger Instance;
private void Awake()
{
if (Instance != null && Instance != this)
{
DestroyImmediate(this);
return;
}
Instance = this;
}
public void FadeAnimation()
{
animator.SetTrigger("Start");

View File

@@ -1,6 +1,7 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Scampz.GameJam.Assets.Scripts;
using Scampz.GameJam.Assets.Scripts.Audio;
using Scampz.GameJam.Assets.Scripts.Utilities;
using TMPro;
@@ -120,6 +121,9 @@ namespace Scampz.GameJam
_dialogueTextGUI.text = string.Empty;
IsTalking = false;
SFXManager.Instance.StopSoundEffect();
var player = GameObject.FindGameObjectWithTag("Player");
var inputController = player.GetComponent<CharacterInputController>();
inputController.EnableActions();
}
}
}

View File

@@ -1,3 +1,4 @@
using Scampz.GameJam.Assets.Scripts;
using UnityEngine;
using UnityEngine.InputSystem;
@@ -33,7 +34,9 @@ namespace Scampz.GameJam
private void OnTriggerExit(Collider other)
{
if (other.CompareTag("Player"))
{
_isWithinRange = false;
}
}
private void Update()
@@ -41,10 +44,9 @@ namespace Scampz.GameJam
if (_isWithinRange && confirmAction.triggered && !DialogueManager.Instance.IsTalking)
{
var player = GameObject.FindGameObjectWithTag("Player");
var cc = player.GetComponent<CharacterController>();
cc.enabled = false;
var inputController = player.GetComponent<CharacterInputController>();
inputController.DisableActions();
_dialogueTrigger.TriggerDialogue();
cc.enabled = true;
}
}
}

View File

@@ -12,7 +12,7 @@ namespace Scampz.GameJam
{
if (Instance != null && Instance != this)
{
Destroy(this);
DestroyImmediate(this);
return;
}
Instance = this;
@@ -28,8 +28,7 @@ namespace Scampz.GameJam
{
yield return null;
var player = GameObject.FindGameObjectWithTag("Player");
var levelChanger = GetComponentInChildren<LevelChanger>();
levelChanger.FadeAnimation();
LevelChanger.Instance.FadeAnimation();
yield return null;
var loadSceneOperation = SceneManager.LoadSceneAsync(sceneName, loadSceneMode);
yield return new WaitForSeconds(3f);

View File

@@ -15,6 +15,16 @@ namespace Scampz.GameJam.Assets.Scripts
private InputAction move;
private InputAction sprint;
public void EnableActions()
{
move.Enable();
}
public void DisableActions()
{
move.Disable();
}
private void Awake()
{
playerControls = new PlayerControls();

View File

@@ -21,7 +21,7 @@ namespace Scampz.GameJam.Assets.Scripts.Player
public void OnTriggerStay(Collider other)
{
if (confirmAction.triggered)
if (other.CompareTag("Player") && confirmAction.triggered)
UnlockSanctumState.Instance.VoidOpened = true;
}
}

View File

@@ -1,4 +1,5 @@
using Scampz.GameJam.Assets.Scripts;
using TMPro;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.SceneManagement;
@@ -16,10 +17,18 @@ namespace Scampz.GameJam
confirmAction.Enable();
}
private void OnDisable()
{
confirmAction.Disable();
}
void Update()
{
if (confirmAction.triggered)
var uiText = GetComponentInChildren<TextMeshProUGUI>();
if (confirmAction.inProgress)
{
GameManager.Instance.LoadScene(SceneNames.WorldMap, LoadSceneMode.Single);
}
}
}
}