using System; using UnityEngine; using Framework.Services; namespace Framework.Dialogue { /// Manages the active dialogue canvas and canvas placements /// /// When the game wants to display dialogue UI, it can use this dialogue manager /// service to find a good placement of the dialogue UI. The dialogue manager /// also tracks the active dialogue canvas so that only one is active at the /// same time. /// [ ServiceScope(Scope.Scene), DefaultBinding(typeof(DialogueManager)) ] public interface IDialogueManager { /// Finds the best dialogue canvas placement on an actor /// Viewer for which a placement will be searched /// Actor the placement has to be attached to /// The best dialogue canvas placement for the specified actor DialoguePlacement FindPlacementOnActor(Transform viewer, GameObject actor); /// Finds the best dialogue canvas placement on an actor /// Viewer for which a placement will be searched /// Actor the placement has to be attached to /// /// Maximum distance the placement may have from the viewer /// /// The best dialogue canvas placement for the specified actor DialoguePlacement FindPlacementOnActor( Transform viewer, GameObject actor, float maximumDistance ); /// Finds the best dialogue canvas placement not attached to an actor /// Position of the viewer in the world /// The best dialogue canvas placement not attached to any actor DialoguePlacement FindPlacementInWorld(Transform viewer); /// Displays a new dialogue canvas at a specific location /// Where the dialogue canvas will be displayed IDialogueCanvas ShowDialogue(DialoguePlacement placement); /// Moves the currently active dialoge to a new location /// New location the dialoge should be moved to void MoveDialogue(Transform newTransform); /// Kills the currently active dialogue void HideDialogue(); /// Currently active dialogue UI IDialogueCanvas ActiveDialogueCanvas { get; } } } // namespace Framework.Dialogue