Merge branch 'master' into ui_graphics
This commit is contained in:
@@ -32,7 +32,7 @@ public class AdventurerInteractable : MonoBehaviour
|
||||
return;
|
||||
|
||||
GameManager.Instance.uiManager.BlockInput(true);
|
||||
//PlayerController.Instance.cameraMovement = false;
|
||||
PlayerController.Instance.cameraMovement = false;
|
||||
CharacterData character = CharacterManager.Instance.GetCharacterDataByName(m_name);
|
||||
GameManager.Instance.dialogueController.DisplayCharacterText(character);
|
||||
}
|
||||
|
||||
@@ -16,5 +16,6 @@ public class CharacterData : ScriptableObject
|
||||
[Header("The index of the dialogue relates to what question it should link too.")]
|
||||
public List<Dialogue> m_dialogueOptions;
|
||||
|
||||
public AudioSource m_typingSfx;
|
||||
public AudioClip m_typingSfx;
|
||||
public float m_sfxPitch = 1;
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ public class CharacterSheet : MonoBehaviour
|
||||
public void Action_Close()
|
||||
{
|
||||
PlayerController.Instance.cameraMovement = true;
|
||||
GameManager.Instance.uiManager.BlockInput(false);
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@ public class DialoguePanel : MonoBehaviour
|
||||
[SerializeField] private TMP_Text m_characterText;
|
||||
[SerializeField] private CharacterSheetController m_characterSheetController;
|
||||
[SerializeField] private GameObject m_dialogueEndedIndicator;
|
||||
[SerializeField] private AudioSource m_sfxSource;
|
||||
[SerializeField] private Image m_characterImage;
|
||||
|
||||
private const float TypingSpeed = 0.03f;
|
||||
|
||||
@@ -45,6 +47,9 @@ public class DialoguePanel : MonoBehaviour
|
||||
{
|
||||
m_questionIndexAsked.Clear();
|
||||
|
||||
m_characterImage.sprite = characterData.m_avatar;
|
||||
m_sfxSource.pitch = characterData.m_sfxPitch;
|
||||
|
||||
Cleanup();
|
||||
|
||||
if (m_characterSheet != null)
|
||||
@@ -53,6 +58,11 @@ public class DialoguePanel : MonoBehaviour
|
||||
m_characterSheet.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
if (characterData.m_typingSfx != null)
|
||||
{
|
||||
m_sfxSource.clip = characterData.m_typingSfx;
|
||||
}
|
||||
|
||||
m_questionsAsked = 0;
|
||||
m_currentCharacter = characterData;
|
||||
SetCharacterName();
|
||||
@@ -141,6 +151,10 @@ public class DialoguePanel : MonoBehaviour
|
||||
}
|
||||
|
||||
m_characterText.text += letter;
|
||||
|
||||
if (!m_sfxSource.isPlaying)
|
||||
m_sfxSource.Play();
|
||||
|
||||
yield return new WaitForSeconds(TypingSpeed);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,13 +27,16 @@ public class PlayerController : MonoBehaviour
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (cameraMovement)
|
||||
if (Input.GetMouseButton(1))
|
||||
{
|
||||
float mouseX = 2 * (Input.mousePosition.x / playerCam.pixelWidth) - 1;
|
||||
float mouseY = -(2 * (Input.mousePosition.y / playerCam.pixelHeight) - 1);
|
||||
if (cameraMovement)
|
||||
{
|
||||
float mouseX = 2 * (Input.mousePosition.x / playerCam.pixelWidth) - 1;
|
||||
float mouseY = -(2 * (Input.mousePosition.y / playerCam.pixelHeight) - 1);
|
||||
|
||||
Quaternion rotation = Quaternion.Euler(yLimit * mouseY, xLimit * mouseX, 0);
|
||||
playerCam.transform.rotation = rotation;
|
||||
Quaternion rotation = Quaternion.Euler(yLimit * mouseY, xLimit * mouseX, 0);
|
||||
playerCam.transform.rotation = rotation;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user