コード例 #1
0
    static public void Stop()
    {
        if (null != activeDialogue)
        {
            // if animation tracks are specified, let that take care of exit animations
            if (!activeDialogue.exitAnimationSequence.ContainsTracks() && !activeDialogue.exitActions.ContainsAnmationTracks())
            {
                TriggerEndAnimations();
            }

            activeDialogue.exitAnimationSequence.Execute();
            activeDialogue.exitActions.Execute();

            Interaction activeInteraction = GetActiveInteraction();
            if (null != activeInteraction)
            {
                activeInteraction.ClearCharacterRotationLocks();
                activeInteraction.SwitchCharactersBackToPreviousTeam();
                activeInteraction.ClearCharacterInfo();
            }

            Dialogue.DialogueData.DialoguePointCamera exitCamera = activeDialogue.GetExitCamera();
            if (null != exitCamera)
            {
                Interaction.SetUpNewCamera(exitCamera, null, activeDialogue.dialoguePoints);
            }
            else if (!activeDialogue.exitActions.ContainsCameraAction() && null != Camera.main)
            {
                CameraBase cameraComponent = Camera.main.gameObject.GetComponent <CameraBase>();
                if (null != cameraComponent)
                {
                    CameraLerp defaultDialogueLerp = GlobalDialogueData.Instance.defaultDialogueLerp;
                    cameraComponent.EnterFixedOffsetGameCamera(defaultDialogueLerp);
                }
            }

            if (!activeDialogue.isDuringGameplay && activeDialogue.removeDialogueHUDOnExit)
            {
                UIStack.Instance.BackStack();
            }
            activeDialogue = null;

            if (null != onInteractionEnd)
            {
                onInteractionEnd();
            }
            EventManager.instance.Raise(new DialogueEvent(DialogueEvent.EventType.stop));
        }
    }