Corgi Engine  v8.8
MoreMountains.CorgiEngine.DialogueZone Class Reference

Add this class to an empty component. It will automatically add a boxcollider2d, set it to "is trigger". Then customize the dialogue zone through the inspector. More...

Inheritance diagram for MoreMountains.CorgiEngine.DialogueZone:
MoreMountains.CorgiEngine.ButtonActivated MoreMountains.Tools.MMMonoBehaviour

Public Member Functions

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

Public Attributes

GameObject DialogueBoxPrefab
 the prefab to use for the dialogue box More...
 
Color TextBackgroundColor =Color.black
 the color of the text background. More...
 
Color TextColor =Color.white
 the color of the text More...
 
bool ArrowVisible =true
 if true, the dialogue box will have a small, downward pointing arrow More...
 
Font TextFont
 the font that should be used to display the text More...
 
int TextSize = 20
 the size of the font More...
 
TextAnchor Alignment = TextAnchor.MiddleCenter
 the text alignment in the box used to display the text More...
 
float FadeDuration =0.2f
 the duration of the in and out fades More...
 
float TransitionTime =0.2f
 the time between two dialogues More...
 
float DistanceFromTop =0
 the distance from the top of the box collider the dialogue box should appear at More...
 
bool BoxesFollowZone = false
 if this is true, the dialogue boxes will follow the zone's position More...
 
bool CanMoveWhileTalking = true
 if this is set to true, the character will be able to move while dialogue is in progress More...
 
bool ButtonHandled =true
 whether this dialogue zone is operated via the CharacterButtonActivation ability or not More...
 
float MessageDuration =3f
 duration of the message. only considered if the box is not button handled More...
 
bool ActivableMoreThanOnce =true
 true if can be activated more than once More...
 
float InactiveTime =2f
 if the zone is activable more than once, how long should it remain inactive between up times ? More...
 
string[] Dialogue
 the dialogue lines More...
 
- Public Attributes inherited from MoreMountains.CorgiEngine.ButtonActivated
ButtonActivatedRequirements ButtonActivatedRequirement = ButtonActivatedRequirements.Either
 the requirement(s) for this zone More...
 
bool RequiresPlayerType = true
 if this is true, this can only be activated by player Characters More...
 
bool RequiresButtonActivationAbility = true
 if this is true, this zone can only be activated if the character has the required ability More...
 
bool PreventJumpsWhileInThisZone = false
 if this is true, characters won't be able to jump when in that zone, regardless of the settings on their CharacterButtonActivation ability More...
 
bool Activable = true
 if this is false, the zone won't be activable More...
 
bool AutoActivation = false
 if true, the zone will activate whether the button is pressed or not More...
 
bool AutoActivationAndButtonInteraction = false
 if true, this zone will be auto activated but will still allow button interaction More...
 
bool CanOnlyActivateIfGrounded = false
 if this is set to false, the zone won't be activable while not grounded More...
 
bool ShouldUpdateState = true
 Set this to true if you want the CharacterBehaviorState to be notified of the player's entry into the zone. More...
 
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 More...
 
bool AlsoPerformChecksOnStay = false
 if this is true, extra enter checks will be performed on TriggerStay, to handle edge cases like a zone that'd prevent activation when not grounded, and a character enters it airborne, but then lands More...
 
LayerMask TargetLayerMask = ~0
 a layermask with all the layers that can interact with this specific button activated zone More...
 
bool UnlimitedActivations = true
 if this is set to false, your number of activations will be MaxNumberOfActivations More...
 
int MaxNumberOfActivations = 0
 the number of times the zone can be interacted with More...
 
float DelayBetweenUses = 0f
 the delay (in seconds) after an activation during which the zone can't be activated More...
 
bool DisableAfterUse = false
 if this is true, the zone will disable itself (forever or until you manually reactivate it) after its last use More...
 
InputTypes InputType = InputTypes.Default
 the selected input type (default : default binding from the InputManager for Interact, button (type in an axis button name), or key) More...
 
string InputButton = "Interact"
 the button axis name to use for this button activated object More...
 
KeyCode InputKey = KeyCode.Space
 the key to use for this More...
 
string AnimationTriggerParameterName
 an (absolutely optional) animation parameter that can be triggered on the character when activating the zone More...
 
bool UseVisualPrompt = true
 if this is true, a prompt will be shown if setup properly More...
 
ButtonPrompt ButtonPromptPrefab
 the gameobject to instantiate to present the prompt More...
 
string ButtonPromptText = "A"
 the text to display in the button prompt More...
 
Color ButtonPromptColor = MMColors.LawnGreen
 the text to display in the button prompt More...
 
Color ButtonPromptTextColor = MMColors.White
 the color for the prompt's text More...
 
bool AlwaysShowPrompt = true
 If true, the "buttonA" prompt will always be shown, whether the player is in the zone or not. More...
 
bool ShowPromptWhenColliding = true
 If true, the "buttonA" prompt will be shown when a player is colliding with the zone. More...
 
bool HidePromptAfterUse = false
 If true, the prompt will hide after use. More...
 
Vector3 PromptRelativePosition = Vector3.zero
 the position of the actual buttonA prompt relative to the object's center More...
 
MMFeedbacks ActivationFeedback
 a feedback to play when the zone gets activated More...
 
MMFeedbacks DeniedFeedback
 a feedback to play when the zone tries to get activated but can't More...
 
MMFeedbacks EnterFeedback
 a feedback to play when the zone gets entered More...
 
MMFeedbacks ExitFeedback
 a feedback to play when the zone gets exited More...
 
UnityEvent OnActivation
 an action to trigger when this gets activated More...
 
UnityEvent OnExit
 an action to trigger when exiting this zone More...
 
UnityEvent OnStay
 an action to trigger when staying in the zone More...
 

Protected Member Functions

override void OnEnable ()
 Initializes the dialogue zone More...
 
override void DisableAfterActivation ()
 Handles the disabling of the zone after activation More...
 
virtual IEnumerator PlayNextDialogue ()
 Plays the next dialogue in the queue More...
 
virtual IEnumerator AutoNextDialogue ()
 Automatically goes to the next dialogue line More...
 
virtual IEnumerator Reactivate ()
 Reactivate the dialogue zone More...
 
- Protected Member Functions inherited from MoreMountains.CorgiEngine.ButtonActivated
virtual void OnDisable ()
 On disable we disable our input action if needed More...
 
virtual void ActivateZone ()
 Activates the zone More...
 
virtual void OnTriggerEnter2D (Collider2D collidingObject)
 Handles enter collision with 2D triggers More...
 
virtual void OnTriggerStay2D (Collider2D collidingObject)
 On stay we invoke our stay event if needed, and perform a trigger enter check if it hasn't been done already More...
 
virtual void OnTriggerExit2D (Collider2D collidingObject)
 Handles enter collision with 2D triggers More...
 
virtual void TriggerEnter (GameObject collider)
 Triggered when something collides with the button activated zone More...
 
virtual void TriggerExit (GameObject collider)
 Triggered when something exits the water More...
 
virtual bool TestForLastObject (GameObject collider)
 Tests if the object exiting our zone is the last remaining one More...
 
virtual bool CheckConditions (GameObject collider)
 Determines whether or not this zone should be activated More...
 

Protected Attributes

DialogueBox _dialogueBox
 private variables More...
 
bool _activated =false
 
bool _playing =false
 
int _currentIndex
 
bool _activable =true
 
WaitForSeconds _transitionTimeWFS
 
WaitForSeconds _messageDurationWFS
 
WaitForSeconds _inactiveTimeWFS
 
- Protected Attributes inherited from MoreMountains.CorgiEngine.ButtonActivated
Animator _buttonPromptAnimator
 
ButtonPrompt _buttonPrompt
 
bool _promptHiddenForever = false
 
int _numberOfActivationsLeft
 
float _lastActivationTimestamp
 
Collider2D _buttonActivatedZoneCollider
 
CharacterButtonActivation _characterButtonActivation
 
Character _currentCharacter
 
List< GameObject > _collidingObjects
 
List< GameObject > _stayingGameObjects
 
List< Collider2D > _enteredColliders
 
int _inputActionPressedAtFrame
 

Additional Inherited Members

- Public Types inherited from MoreMountains.CorgiEngine.ButtonActivated
enum  ButtonActivatedRequirements { ButtonActivatedRequirements.Character, ButtonActivatedRequirements.ButtonActivator, ButtonActivatedRequirements.Either, ButtonActivatedRequirements.None }
 the different possible requirements for this activated zone, which can be either a character, a button activator, one or the other, or none More...
 
enum  InputTypes { InputTypes.Default, InputTypes.Button, InputTypes.Key }
 how input gets detected for this zone (default : default binding from the InputManager for Interact, button (type in an axis button name), or key) More...
 
- Properties inherited from MoreMountains.CorgiEngine.ButtonActivated
bool InputActionPerformed [get]
 

Detailed Description

Add this class to an empty component. It will automatically add a boxcollider2d, set it to "is trigger". Then customize the dialogue zone through the inspector.

Member Function Documentation

◆ AutoNextDialogue()

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

Automatically goes to the next dialogue line

Returns
The next dialogue.

◆ DisableAfterActivation()

override void MoreMountains.CorgiEngine.DialogueZone.DisableAfterActivation ( )
protectedvirtual

Handles the disabling of the zone after activation

Reimplemented from MoreMountains.CorgiEngine.ButtonActivated.

◆ OnEnable()

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

Initializes the dialogue zone

Reimplemented from MoreMountains.CorgiEngine.ButtonActivated.

◆ PlayNextDialogue()

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

Plays the next dialogue in the queue

◆ Reactivate()

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

Reactivate the dialogue zone

◆ StartDialogue()

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

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

◆ TriggerButtonAction()

override void MoreMountains.CorgiEngine.DialogueZone.TriggerButtonAction ( GameObject  instigator)
virtual

When the button is pressed we start the dialogue

Reimplemented from MoreMountains.CorgiEngine.ButtonActivated.

Member Data Documentation

◆ _activable

bool MoreMountains.CorgiEngine.DialogueZone._activable =true
protected

◆ _activated

bool MoreMountains.CorgiEngine.DialogueZone._activated =false
protected

◆ _currentIndex

int MoreMountains.CorgiEngine.DialogueZone._currentIndex
protected

◆ _dialogueBox

DialogueBox MoreMountains.CorgiEngine.DialogueZone._dialogueBox
protected

private variables

◆ _inactiveTimeWFS

WaitForSeconds MoreMountains.CorgiEngine.DialogueZone._inactiveTimeWFS
protected

◆ _messageDurationWFS

WaitForSeconds MoreMountains.CorgiEngine.DialogueZone._messageDurationWFS
protected

◆ _playing

bool MoreMountains.CorgiEngine.DialogueZone._playing =false
protected

◆ _transitionTimeWFS

WaitForSeconds MoreMountains.CorgiEngine.DialogueZone._transitionTimeWFS
protected

◆ ActivableMoreThanOnce

bool MoreMountains.CorgiEngine.DialogueZone.ActivableMoreThanOnce =true

true if can be activated more than once

◆ Alignment

TextAnchor MoreMountains.CorgiEngine.DialogueZone.Alignment = TextAnchor.MiddleCenter

the text alignment in the box used to display the text

◆ ArrowVisible

bool MoreMountains.CorgiEngine.DialogueZone.ArrowVisible =true

if true, the dialogue box will have a small, downward pointing arrow

◆ BoxesFollowZone

bool MoreMountains.CorgiEngine.DialogueZone.BoxesFollowZone = false

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

◆ ButtonHandled

bool MoreMountains.CorgiEngine.DialogueZone.ButtonHandled =true

whether this dialogue zone is operated via the CharacterButtonActivation ability or not

◆ CanMoveWhileTalking

bool MoreMountains.CorgiEngine.DialogueZone.CanMoveWhileTalking = true

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

◆ Dialogue

string [] MoreMountains.CorgiEngine.DialogueZone.Dialogue

the dialogue lines

◆ DialogueBoxPrefab

GameObject MoreMountains.CorgiEngine.DialogueZone.DialogueBoxPrefab

the prefab to use for the dialogue box

◆ DistanceFromTop

float MoreMountains.CorgiEngine.DialogueZone.DistanceFromTop =0

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

◆ FadeDuration

float MoreMountains.CorgiEngine.DialogueZone.FadeDuration =0.2f

the duration of the in and out fades

◆ InactiveTime

float MoreMountains.CorgiEngine.DialogueZone.InactiveTime =2f

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

◆ MessageDuration

float MoreMountains.CorgiEngine.DialogueZone.MessageDuration =3f

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

◆ TextBackgroundColor

Color MoreMountains.CorgiEngine.DialogueZone.TextBackgroundColor =Color.black

the color of the text background.

◆ TextColor

Color MoreMountains.CorgiEngine.DialogueZone.TextColor =Color.white

the color of the text

◆ TextFont

Font MoreMountains.CorgiEngine.DialogueZone.TextFont

the font that should be used to display the text

◆ TextSize

int MoreMountains.CorgiEngine.DialogueZone.TextSize = 20

the size of the font

◆ TransitionTime

float MoreMountains.CorgiEngine.DialogueZone.TransitionTime =0.2f

the time between two dialogues


The documentation for this class was generated from the following file: