Files
gmtk-2023/Assets/Scripts/AdventurerInteractable.cs
Amaan Shawkath d023634369 - changed camera so it only moves on a right click
- added sfx to characters talking
- added character sprite to dialogue panel
2023-07-09 15:57:31 +01:00

40 lines
1.0 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AdventurerInteractable : MonoBehaviour
{
public int m_spawnQuestID = 0;
[SerializeField] private string m_name = string.Empty;
// Start is called before the first frame update
void Start()
{
}
void OnMouseEnter()
{
GameManager.Instance.uiManager.SetCursor(GameManager.Instance.m_talkCursor);
}
void OnMouseExit()
{
GameManager.Instance.uiManager.SetCursor(GameManager.Instance.m_defaultCursor);
}
private void OnMouseDown()
{
if (GameManager.Instance.uiManager.InputBlocked)
return;
if (GameManager.Instance.dialogueController.DialogueInProgress)
return;
GameManager.Instance.uiManager.BlockInput(true);
PlayerController.Instance.cameraMovement = false;
CharacterData character = CharacterManager.Instance.GetCharacterDataByName(m_name);
GameManager.Instance.dialogueController.DisplayCharacterText(character);
}
}