コード例 #1
0
    public void NextFrame()
    {
        currentFrame.value++;

        if (currentFrame.value >= dialogueEntry.size)
        {
            Debug.Log("Reached the end");
            DialogueAction   da   = (DAEndDialogue)ScriptableObject.CreateInstance("DAEndDialogue");
            DialogueJsonItem data = new DialogueJsonItem();
            data.entry = dialogueEntry;
            da.Act(scene, data);
        }
        else
        {
            CompareScenes(dialogueEntry.frames[currentFrame.value]);
        }
    }
コード例 #2
0
    private IEnumerator RunNextFrame()
    {
        isWaiting = true;
        while (currentAction.value < dialogueEntry.actions.Count)
        {
            DialogueActionData data = dialogueEntry.actions[currentAction.value];
            DialogueAction     da   = DialogueAction.CreateAction(data.type);
            bool res = da.Act(scene, data);
            if (data.type == DActionType.MOVEMENT)
            {
                for (int i = 0; i < Utility.DIALOGUE_PLAYERS_COUNT + Utility.DIALOGUE_PLAYERS_OUTSIDE_COUNT; i++)
                {
                    float speed = data.values[0] * 0.001f;
                    scene.characterTransforms[i].MoveCharacter(speed);
                }
            }

            RunEvents(data.type, res);
            currentAction.value++;

            if (data.useDelay)
            {
                if (data.type != DActionType.SET_TEXT && data.type != DActionType.END_SCENE)
                {
                    yield return(new WaitForSeconds(scene.effectStartDuration.value));

                    yield return(new WaitForSeconds(scene.effectEndDuration.value));
                }
            }

            if (!data.autoContinue)
            {
                break;
            }
        }
        isWaiting = false;
        yield break;
    }