2021-03-05 16:34:52 +01:00
|
|
|
using System;
|
2021-02-19 17:33:02 +01:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
2021-03-11 21:25:09 +01:00
|
|
|
using TMPro;
|
2021-02-19 17:33:02 +01:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
[CreateAssetMenu(menuName = "KernelPanic/Dialogue/Settings")]
|
|
|
|
public class DialogueSettings : ScriptableObject
|
|
|
|
{
|
2021-03-11 21:25:09 +01:00
|
|
|
[Serializable]
|
|
|
|
public struct InputPromptSpriteIndices
|
|
|
|
{
|
|
|
|
public int blink;
|
|
|
|
public int boost;
|
|
|
|
public int timeFreeze;
|
2021-03-12 18:15:27 +01:00
|
|
|
public int interact;
|
2021-03-11 21:25:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public InputPromptSpriteIndices GamepadInputPrompts => _gamepadInputPrompts;
|
|
|
|
[SerializeField] private InputPromptSpriteIndices _gamepadInputPrompts;
|
|
|
|
|
|
|
|
public InputPromptSpriteIndices KeyboardInputPrompts => _keyboardInputPrompts;
|
|
|
|
[SerializeField] private InputPromptSpriteIndices _keyboardInputPrompts;
|
|
|
|
|
2021-02-19 17:33:02 +01:00
|
|
|
public float HideAfter => _hideAfter;
|
2021-02-22 16:29:17 +01:00
|
|
|
[SerializeField] private float _hideAfter;
|
|
|
|
|
2021-03-05 16:34:52 +01:00
|
|
|
public string RadioDialogueKey => _radioDialogueKey;
|
|
|
|
[SerializeField] private string _radioDialogueKey;
|
|
|
|
|
2021-05-14 20:08:27 +02:00
|
|
|
public string BazDialogueKey => _bazDialogueKey;
|
|
|
|
[SerializeField] private string _bazDialogueKey;
|
|
|
|
|
2021-03-05 16:34:52 +01:00
|
|
|
[SerializeField] private AudioClip[] _dialogueClips;
|
|
|
|
private readonly Dictionary<string, AudioClip> _keyClips = new Dictionary<string, AudioClip>();
|
|
|
|
|
|
|
|
public AudioClip GetDialogueClip(string key)
|
|
|
|
{
|
|
|
|
if (!_keyClips.ContainsKey(key))
|
|
|
|
{
|
|
|
|
Debug.LogError($"no clip for key {key}");
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return _keyClips[key];
|
|
|
|
}
|
|
|
|
|
|
|
|
private void OnEnable()
|
|
|
|
{
|
|
|
|
foreach (var dialogueClip in _dialogueClips)
|
|
|
|
{
|
|
|
|
_keyClips[dialogueClip.name] = dialogueClip;
|
|
|
|
}
|
|
|
|
}
|
2021-02-22 16:29:17 +01:00
|
|
|
}
|