void PlayDialogue(string key, soundRole role) { FMOD.Studio.EventInstance dialogueInstance; switch (role) { case soundRole.Estella: dialogueInstance = FMODUnity.RuntimeManager.CreateInstance(fmodEstellaTalkEvent); dialogueInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(_player, _player.GetComponent <Rigidbody>())); break; case soundRole.Tim: dialogueInstance = FMODUnity.RuntimeManager.CreateInstance(fmodTimTalkEvent); break; default: dialogueInstance = FMODUnity.RuntimeManager.CreateInstance(fmodEstellaTalkEvent); break; } // Pin the key string in memory and pass a pointer through the user data GCHandle stringHandle = GCHandle.Alloc(key, GCHandleType.Pinned); dialogueInstance.setUserData(GCHandle.ToIntPtr(stringHandle)); dialogueInstance.setCallback(dialogueCallback); dialogueInstance.start(); dialogueInstance.release(); }
public SoundLine() { lineID = "0000"; nextLineID = "End"; role = soundRole.Estella; waitTimeInMS = 0; subtileGer = ""; subtileEng = ""; }
public void setDialog(String text, soundRole role) { _dialogCanvas.GetComponent <DialogCanvas>().setText(text); _dialogCanvas.GetComponent <DialogCanvas>().setImage(role); }