Read Current Text Character Being Written
Posted: Mon Apr 17, 2023 5:53 pm
Hey there,
I'm implementing an Animal Crossing-style dialogue system into a game using FMOD in Unity and can't figure out a way to read what text symbol is currently being output by the UnityUITypewriterEffect.
This is what I have so far which seems to be working fine for changing the actor in FMOD, I just want a similar way to read the current text symbol "abc" etc. it gets very confusing if I say character so just trying to be clear what I mean
any help would be greatly appreciated
I'm implementing an Animal Crossing-style dialogue system into a game using FMOD in Unity and can't figure out a way to read what text symbol is currently being output by the UnityUITypewriterEffect.
This is what I have so far which seems to be working fine for changing the actor in FMOD, I just want a similar way to read the current text symbol "abc" etc. it gets very confusing if I say character so just trying to be clear what I mean
Code: Select all
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using FMODUnity;
using PixelCrushers.DialogueSystem;
public class FMODDialogueAudio : MonoBehaviour
{
FMOD.Studio.EventInstance characterSound;
int currentCharacter;
private void Start()
{
characterSound = RuntimeManager.CreateInstance("event:/SFX/Dialogue/dialogueMulti");
}
private void Update()
{
int actorID = DialogueManager.currentConversationState.subtitle.speakerInfo.id;
characterSound.setParameterByName("Speaker", actorID);
GetCurrentCharacter();
characterSound.setParameterByName("TextCharacter", currentCharacter);
}
public void PlayCharacter()
{
characterSound.start();
}
void GetCurrentCharacter()
{
// No idea what to do here
}
}