Пример #1
0
    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();
    }
Пример #2
0
 public SoundLine()
 {
     lineID       = "0000";
     nextLineID   = "End";
     role         = soundRole.Estella;
     waitTimeInMS = 0;
     subtileGer   = "";
     subtileEng   = "";
 }
Пример #3
0
 public void setDialog(String text, soundRole role)
 {
     _dialogCanvas.GetComponent <DialogCanvas>().setText(text);
     _dialogCanvas.GetComponent <DialogCanvas>().setImage(role);
 }