TopDown Engine v4.5
Loading...
Searching...
No Matches
MoreMountains.TopDownEngine.DialogueZone Class Reference

Add this class to an empty component. It requires a Collider or Collider2D, set to "is trigger". You can then customize the dialogue zone through the inspector. More...

Inheritance diagram for MoreMountains.TopDownEngine.DialogueZone:
MoreMountains.TopDownEngine.ButtonActivated MoreMountains.TopDownEngine.TopDownMonoBehaviour MoreMountains.Tools.MMMonoBehaviour

Public Member Functions

override void TriggerButtonAction ()
 When the button is pressed we start the dialogue.
virtual void StartDialogue ()
 When triggered, either by button press or simply entering the zone, starts the dialogue.
Public Member Functions inherited from MoreMountains.TopDownEngine.ButtonActivated
virtual void Initialization ()
 Grabs components and shows prompt if needed.
virtual void TriggerExitAction (GameObject collider)
virtual void TriggerEnterAction (GameObject collider)
virtual void MakeActivable ()
 Makes the zone activable.
virtual void MakeUnactivable ()
 Makes the zone unactivable.
virtual void ToggleActivable ()
 Makes the zone activable if it wasn't, unactivable if it was activable.
virtual void PromptError ()
 Triggers an error.
virtual void ShowPrompt ()
 Shows the button A prompt.
virtual void HidePrompt ()
 Hides the button A prompt.
virtual void DisableZone ()
 Disables the button activated zone.
virtual void EnableZone ()
 Enables the button activated zone.
virtual bool CheckNumberOfUses ()
 Checks the remaining number of uses and eventual delay between uses and returns true if the zone can be activated.

Public Attributes

DialogueBox DialogueBoxPrefab
 the prefab to use to display the dialogue
Color TextBackgroundColor = Color.black
 the color of the text background.
Color TextColor = Color.white
 the color of the text
Font TextFont
 the font that should be used to display the text
int TextSize = 40
 the size of the font
TextAnchor Alignment = TextAnchor.MiddleCenter
 the text alignment in the box used to display the text
float FadeDuration = 0.2f
 the duration of the in and out fades
float TransitionTime = 0.2f
 the time between two dialogues
Vector3 Offset = Vector3.zero
 the distance from the top of the box collider the dialogue box should appear at
bool BoxesFollowZone = false
 if this is true, the dialogue boxes will follow the zone's position
bool CanMoveWhileTalking = true
 if this is set to true, the character will be able to move while dialogue is in progress
bool ButtonHandled = true
 whether or not this zone is handled by a button or not
float MessageDuration = 3f
 duration of the message. only considered if the box is not button handled
bool ActivableMoreThanOnce = true
 true if can be activated more than once
float InactiveTime = 2f
 if the zone is activable more than once, how long should it remain inactive between up times?
DialogueElement[] Dialogue
 the dialogue lines
Public Attributes inherited from MoreMountains.TopDownEngine.ButtonActivated
ButtonActivatedRequirements ButtonActivatedRequirement = ButtonActivatedRequirements.Either
 if this is true, objects with a ButtonActivator class will be able to interact with this zone
bool RequiresPlayerType = true
 if this is true, this can only be activated by player Characters
bool RequiresButtonActivationAbility = true
 if this is true, this zone can only be activated if the character has the required ability
bool Activable = true
 if this is false, the zone won't be activable
bool AutoActivation = false
 if true, the zone will activate whether the button is pressed or not
bool AutoActivationAndButtonInteraction = false
 if true, this zone will be auto activated but will still allow button interaction
float AutoActivationDelay = 0f
 the delay, in seconds, during which the character has to be within the zone to activate it
bool AutoActivationDelayResetsOnExit = true
 if this is true, exiting the zone will reset the auto activation delay
bool CanOnlyActivateIfGrounded = false
 if this is set to false, the zone won't be activable while not grounded
bool ShouldUpdateState = true
 Set this to true if you want the CharacterBehaviorState to be notified of the player's entry into the zone.
bool OnlyOneActivationAtOnce = true
 if this is true, enter won't be retriggered if another object enters, and exit will only be triggered when the last object exits
LayerMask TargetLayerMask = ~0
 a layermask with all the layers that can interact with this specific button activated zone
bool UnlimitedActivations = true
 if this is set to false, your number of activations will be MaxNumberOfActivations
int MaxNumberOfActivations = 0
 the number of times the zone can be interacted with
int NumberOfActivationsLeft
 the amount of remaining activations on this zone
float DelayBetweenUses = 0f
 the delay (in seconds) after an activation during which the zone can't be activated
bool DisableAfterUse = false
 if this is true, the zone will disable itself (forever or until you manually reactivate it) after its last use
InputTypes InputType = InputTypes.Default
 the selected input type (default, button or key)
string InputButton = "Interact"
 the selected button string used to activate this zone
KeyCode InputKey = KeyCode.Space
 the key used to activate this zone
string AnimationTriggerParameterName
 an (absolutely optional) animation parameter that can be triggered on the character when activating the zone
bool UseVisualPrompt = true
 if this is true, a prompt will be shown if setup properly
ButtonPrompt ButtonPromptPrefab
 the gameobject to instantiate to present the prompt
string ButtonPromptText = "A"
 the text to display in the button prompt
Color ButtonPromptColor = MMColors.LawnGreen
 the text to display in the button prompt
Color ButtonPromptTextColor = MMColors.White
 the color for the prompt's text
bool AlwaysShowPrompt = true
 If true, the "buttonA" prompt will always be shown, whether the player is in the zone or not.
bool ShowPromptWhenColliding = true
 If true, the "buttonA" prompt will be shown when a player is colliding with the zone.
bool HidePromptAfterUse = false
 If true, the prompt will hide after use.
Vector3 PromptRelativePosition = Vector3.zero
 the position of the actual buttonA prompt relative to the object's center
Vector3 PromptRotation = Vector3.zero
 the rotation of the actual buttonA prompt
MMFeedbacks ActivationFeedback
 a feedback to play when the zone gets activated
MMFeedbacks DeniedFeedback
 a feedback to play when the zone tries to get activated but can't
MMFeedbacks EnterFeedback
 a feedback to play when the zone gets entered
MMFeedbacks ExitFeedback
 a feedback to play when the zone gets exited
UnityEvent OnActivation
 a UnityEvent to trigger when this zone gets activated
UnityEvent OnEnter
 a UnityEvent to trigger when this zone gets entered
UnityEvent OnExit
 a UnityEvent to trigger when this zone gets exited
UnityEvent OnStay
 a UnityEvent to trigger when a character is within the zone

Protected Member Functions

override void OnEnable ()
 Initializes the dialogue zone.
virtual void EnableCollider (bool status)
 Turns collider on or off.
virtual IEnumerator PlayNextDialogue ()
 Plays the next dialogue in the queue.
virtual IEnumerator AutoNextDialogue ()
 Automatically goes to the next dialogue line.
virtual IEnumerator Reactivate ()
 Reactivate the dialogue zone.
Protected Member Functions inherited from MoreMountains.TopDownEngine.ButtonActivated
virtual void OnDisable ()
 On disable we disable our input action if needed.
virtual IEnumerator TriggerButtonActionCo ()
virtual void Update ()
virtual void ActivateZone ()
 Activates the zone.
virtual void OnTriggerEnter2D (Collider2D collidingObject)
 Handles enter collision with 2D triggers.
virtual void OnTriggerExit2D (Collider2D collidingObject)
 Handles enter collision with 2D triggers.
virtual void OnTriggerEnter (Collider collidingObject)
 Handles enter collision with 2D triggers.
virtual void OnTriggerExit (Collider collidingObject)
 Handles enter collision with 2D triggers.
virtual void TriggerEnter (GameObject collider)
 Triggered when something collides with the button activated zone.
virtual void TriggerExit (GameObject collider)
 Triggered when something exits the water.
virtual bool TestForLastObject (GameObject collider)
 Tests if the object exiting our zone is the last remaining one.
virtual bool CheckConditions (GameObject collider)
 Determines whether or not this zone should be activated.

Protected Attributes

DialogueBox _dialogueBox
 private variables
bool _activated = false
bool _playing = false
int _currentIndex
bool _activable = true
WaitForSeconds _transitionTimeWFS
WaitForSeconds _messageDurationWFS
WaitForSeconds _inactiveTimeWFS
Protected Attributes inherited from MoreMountains.TopDownEngine.ButtonActivated
Animator _buttonPromptAnimator
ButtonPrompt _buttonPrompt
Collider _collider
Collider2D _collider2D
bool _promptHiddenForever = false
CharacterButtonActivation _characterButtonActivation
float _lastActivationTimestamp
List< GameObject > _collidingObjects
Character _currentCharacter
bool _staying = false
Coroutine _autoActivationCoroutine

Additional Inherited Members

Public Types inherited from MoreMountains.TopDownEngine.ButtonActivated
enum  ButtonActivatedRequirements { Character , ButtonActivator , Either , None }
enum  InputTypes { Default , Button , Key }
Properties inherited from MoreMountains.TopDownEngine.ButtonActivated
virtual bool AutoActivationInProgress [get, set]
virtual float AutoActivationStartedAt [get, set]
bool InputActionPerformed [get]

Detailed Description

Add this class to an empty component. It requires a Collider or Collider2D, set to "is trigger". You can then customize the dialogue zone through the inspector.

Member Function Documentation

◆ AutoNextDialogue()

virtual IEnumerator MoreMountains.TopDownEngine.DialogueZone.AutoNextDialogue ( )
protectedvirtual

Automatically goes to the next dialogue line.

Returns
The next dialogue.

◆ EnableCollider()

virtual void MoreMountains.TopDownEngine.DialogueZone.EnableCollider ( bool status)
protectedvirtual

Turns collider on or off.

Parameters
status

◆ OnEnable()

override void MoreMountains.TopDownEngine.DialogueZone.OnEnable ( )
protectedvirtual

Initializes the dialogue zone.

Reimplemented from MoreMountains.TopDownEngine.ButtonActivated.

◆ PlayNextDialogue()

virtual IEnumerator MoreMountains.TopDownEngine.DialogueZone.PlayNextDialogue ( )
protectedvirtual

Plays the next dialogue in the queue.

◆ Reactivate()

virtual IEnumerator MoreMountains.TopDownEngine.DialogueZone.Reactivate ( )
protectedvirtual

Reactivate the dialogue zone.

◆ StartDialogue()

virtual void MoreMountains.TopDownEngine.DialogueZone.StartDialogue ( )
virtual

When triggered, either by button press or simply entering the zone, starts the dialogue.

◆ TriggerButtonAction()

override void MoreMountains.TopDownEngine.DialogueZone.TriggerButtonAction ( )
virtual

When the button is pressed we start the dialogue.

Reimplemented from MoreMountains.TopDownEngine.ButtonActivated.

Member Data Documentation

◆ _activable

bool MoreMountains.TopDownEngine.DialogueZone._activable = true
protected

◆ _activated

bool MoreMountains.TopDownEngine.DialogueZone._activated = false
protected

◆ _currentIndex

int MoreMountains.TopDownEngine.DialogueZone._currentIndex
protected

◆ _dialogueBox

DialogueBox MoreMountains.TopDownEngine.DialogueZone._dialogueBox
protected

private variables

◆ _inactiveTimeWFS

WaitForSeconds MoreMountains.TopDownEngine.DialogueZone._inactiveTimeWFS
protected

◆ _messageDurationWFS

WaitForSeconds MoreMountains.TopDownEngine.DialogueZone._messageDurationWFS
protected

◆ _playing

bool MoreMountains.TopDownEngine.DialogueZone._playing = false
protected

◆ _transitionTimeWFS

WaitForSeconds MoreMountains.TopDownEngine.DialogueZone._transitionTimeWFS
protected

◆ ActivableMoreThanOnce

bool MoreMountains.TopDownEngine.DialogueZone.ActivableMoreThanOnce = true

true if can be activated more than once

◆ Alignment

TextAnchor MoreMountains.TopDownEngine.DialogueZone.Alignment = TextAnchor.MiddleCenter

the text alignment in the box used to display the text

◆ BoxesFollowZone

bool MoreMountains.TopDownEngine.DialogueZone.BoxesFollowZone = false

if this is true, the dialogue boxes will follow the zone's position

◆ ButtonHandled

bool MoreMountains.TopDownEngine.DialogueZone.ButtonHandled = true

whether or not this zone is handled by a button or not

◆ CanMoveWhileTalking

bool MoreMountains.TopDownEngine.DialogueZone.CanMoveWhileTalking = true

if this is set to true, the character will be able to move while dialogue is in progress

◆ Dialogue

DialogueElement [] MoreMountains.TopDownEngine.DialogueZone.Dialogue

the dialogue lines

◆ DialogueBoxPrefab

DialogueBox MoreMountains.TopDownEngine.DialogueZone.DialogueBoxPrefab

the prefab to use to display the dialogue

◆ FadeDuration

float MoreMountains.TopDownEngine.DialogueZone.FadeDuration = 0.2f

the duration of the in and out fades

◆ InactiveTime

float MoreMountains.TopDownEngine.DialogueZone.InactiveTime = 2f

if the zone is activable more than once, how long should it remain inactive between up times?

◆ MessageDuration

float MoreMountains.TopDownEngine.DialogueZone.MessageDuration = 3f

duration of the message. only considered if the box is not button handled

◆ Offset

Vector3 MoreMountains.TopDownEngine.DialogueZone.Offset = Vector3.zero

the distance from the top of the box collider the dialogue box should appear at

◆ TextBackgroundColor

Color MoreMountains.TopDownEngine.DialogueZone.TextBackgroundColor = Color.black

the color of the text background.

◆ TextColor

Color MoreMountains.TopDownEngine.DialogueZone.TextColor = Color.white

the color of the text

◆ TextFont

Font MoreMountains.TopDownEngine.DialogueZone.TextFont

the font that should be used to display the text

◆ TextSize

int MoreMountains.TopDownEngine.DialogueZone.TextSize = 40

the size of the font

◆ TransitionTime

float MoreMountains.TopDownEngine.DialogueZone.TransitionTime = 0.2f

the time between two dialogues


The documentation for this class was generated from the following file:
  • H:/Code/MoreMountains/topdownengine/Assets/TopDownEngine/Common/Scripts/GUI/DialogueZone.cs