|
TopDown Engine v4.5
|
Extend this class to activate something when a button is pressed in a certain zone. More...
Public Types | |
| enum | ButtonActivatedRequirements { Character , ButtonActivator , Either , None } |
| enum | InputTypes { Default , Button , Key } |
Public Member Functions | |
| virtual void | Initialization () |
| Grabs components and shows prompt if needed. | |
| virtual void | TriggerButtonAction () |
| When the input button is pressed, we check whether or not the zone can be activated, and if yes, trigger ZoneActivated. | |
| 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 | |
| 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 | |
| virtual void | OnEnable () |
| On Enable, we initialize our ButtonActivated zone. | |
| 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 | |
| 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 |
Properties | |
| virtual bool | AutoActivationInProgress [get, set] |
| virtual float | AutoActivationStartedAt [get, set] |
| bool | InputActionPerformed [get] |
Extend this class to activate something when a button is pressed in a certain zone.
|
protectedvirtual |
Activates the zone.
|
protectedvirtual |
|
virtual |
Checks the remaining number of uses and eventual delay between uses and returns true if the zone can be activated.
true, if number of uses was checked, false otherwise.
|
virtual |
Disables the button activated zone.
|
virtual |
Enables the button activated zone.
|
virtual |
Hides the button A prompt.
|
virtual |
Grabs components and shows prompt if needed.
Reimplemented in MoreMountains.TopDownEngine.MovementZone.
|
virtual |
Makes the zone activable.
|
virtual |
Makes the zone unactivable.
|
protectedvirtual |
On disable we disable our input action if needed.
|
protectedvirtual |
On Enable, we initialize our ButtonActivated zone.
Reimplemented in MoreMountains.TopDownEngine.DialogueZone.
|
protectedvirtual |
Handles enter collision with 2D triggers.
| collidingObject | Colliding object. |
Reimplemented in MoreMountains.TopDownEngine.KeyOperatedZone.
|
protectedvirtual |
Handles enter collision with 2D triggers.
| collidingObject | Colliding object. |
Reimplemented in MoreMountains.TopDownEngine.KeyOperatedZone.
|
protectedvirtual |
Handles enter collision with 2D triggers.
| collidingObject | Colliding object. |
|
protectedvirtual |
Handles enter collision with 2D triggers.
| collidingObject | Colliding object. |
|
virtual |
Triggers an error.
|
virtual |
Shows the button A prompt.
|
protectedvirtual |
Tests if the object exiting our zone is the last remaining one.
| collider |
|
virtual |
Makes the zone activable if it wasn't, unactivable if it was activable.
|
virtual |
When the input button is pressed, we check whether or not the zone can be activated, and if yes, trigger ZoneActivated.
Reimplemented in MoreMountains.TopDownEngine.DialogueZone, MoreMountains.TopDownEngine.FinishLevel, MoreMountains.TopDownEngine.KeyOperatedZone, MoreMountains.TopDownEngine.MovementZone, MoreMountains.TopDownEngine.Teleporter, and MoreMountains.TopDownEngine.TimeZone.
|
protectedvirtual |
|
protectedvirtual |
Triggered when something collides with the button activated zone.
| collider | Something colliding with the water. |
Reimplemented in MoreMountains.TopDownEngine.Teleporter.
|
virtual |
|
protectedvirtual |
Triggered when something exits the water.
| collider | Something colliding with the dialogue zone. |
|
virtual |
|
protectedvirtual |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| bool MoreMountains.TopDownEngine.ButtonActivated.Activable = true |
if this is false, the zone won't be activable
| MMFeedbacks MoreMountains.TopDownEngine.ButtonActivated.ActivationFeedback |
a feedback to play when the zone gets activated
| bool MoreMountains.TopDownEngine.ButtonActivated.AlwaysShowPrompt = true |
If true, the "buttonA" prompt will always be shown, whether the player is in the zone or not.
| string MoreMountains.TopDownEngine.ButtonActivated.AnimationTriggerParameterName |
an (absolutely optional) animation parameter that can be triggered on the character when activating the zone
| bool MoreMountains.TopDownEngine.ButtonActivated.AutoActivation = false |
if true, the zone will activate whether the button is pressed or not
| bool MoreMountains.TopDownEngine.ButtonActivated.AutoActivationAndButtonInteraction = false |
if true, this zone will be auto activated but will still allow button interaction
| float MoreMountains.TopDownEngine.ButtonActivated.AutoActivationDelay = 0f |
the delay, in seconds, during which the character has to be within the zone to activate it
| bool MoreMountains.TopDownEngine.ButtonActivated.AutoActivationDelayResetsOnExit = true |
if this is true, exiting the zone will reset the auto activation delay
| ButtonActivatedRequirements MoreMountains.TopDownEngine.ButtonActivated.ButtonActivatedRequirement = ButtonActivatedRequirements.Either |
if this is true, objects with a ButtonActivator class will be able to interact with this zone
| Color MoreMountains.TopDownEngine.ButtonActivated.ButtonPromptColor = MMColors.LawnGreen |
the text to display in the button prompt
| ButtonPrompt MoreMountains.TopDownEngine.ButtonActivated.ButtonPromptPrefab |
the gameobject to instantiate to present the prompt
| string MoreMountains.TopDownEngine.ButtonActivated.ButtonPromptText = "A" |
the text to display in the button prompt
| Color MoreMountains.TopDownEngine.ButtonActivated.ButtonPromptTextColor = MMColors.White |
the color for the prompt's text
| bool MoreMountains.TopDownEngine.ButtonActivated.CanOnlyActivateIfGrounded = false |
if this is set to false, the zone won't be activable while not grounded
| float MoreMountains.TopDownEngine.ButtonActivated.DelayBetweenUses = 0f |
the delay (in seconds) after an activation during which the zone can't be activated
| MMFeedbacks MoreMountains.TopDownEngine.ButtonActivated.DeniedFeedback |
a feedback to play when the zone tries to get activated but can't
| bool MoreMountains.TopDownEngine.ButtonActivated.DisableAfterUse = false |
if this is true, the zone will disable itself (forever or until you manually reactivate it) after its last use
| MMFeedbacks MoreMountains.TopDownEngine.ButtonActivated.EnterFeedback |
a feedback to play when the zone gets entered
| MMFeedbacks MoreMountains.TopDownEngine.ButtonActivated.ExitFeedback |
a feedback to play when the zone gets exited
| bool MoreMountains.TopDownEngine.ButtonActivated.HidePromptAfterUse = false |
If true, the prompt will hide after use.
| string MoreMountains.TopDownEngine.ButtonActivated.InputButton = "Interact" |
the selected button string used to activate this zone
| KeyCode MoreMountains.TopDownEngine.ButtonActivated.InputKey = KeyCode.Space |
the key used to activate this zone
| InputTypes MoreMountains.TopDownEngine.ButtonActivated.InputType = InputTypes.Default |
the selected input type (default, button or key)
| int MoreMountains.TopDownEngine.ButtonActivated.MaxNumberOfActivations = 0 |
the number of times the zone can be interacted with
| int MoreMountains.TopDownEngine.ButtonActivated.NumberOfActivationsLeft |
the amount of remaining activations on this zone
| UnityEvent MoreMountains.TopDownEngine.ButtonActivated.OnActivation |
a UnityEvent to trigger when this zone gets activated
| UnityEvent MoreMountains.TopDownEngine.ButtonActivated.OnEnter |
a UnityEvent to trigger when this zone gets entered
| UnityEvent MoreMountains.TopDownEngine.ButtonActivated.OnExit |
a UnityEvent to trigger when this zone gets exited
| bool MoreMountains.TopDownEngine.ButtonActivated.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
| UnityEvent MoreMountains.TopDownEngine.ButtonActivated.OnStay |
a UnityEvent to trigger when a character is within the zone
| Vector3 MoreMountains.TopDownEngine.ButtonActivated.PromptRelativePosition = Vector3.zero |
the position of the actual buttonA prompt relative to the object's center
| Vector3 MoreMountains.TopDownEngine.ButtonActivated.PromptRotation = Vector3.zero |
the rotation of the actual buttonA prompt
| bool MoreMountains.TopDownEngine.ButtonActivated.RequiresButtonActivationAbility = true |
if this is true, this zone can only be activated if the character has the required ability
| bool MoreMountains.TopDownEngine.ButtonActivated.RequiresPlayerType = true |
if this is true, this can only be activated by player Characters
| bool MoreMountains.TopDownEngine.ButtonActivated.ShouldUpdateState = true |
Set this to true if you want the CharacterBehaviorState to be notified of the player's entry into the zone.
| bool MoreMountains.TopDownEngine.ButtonActivated.ShowPromptWhenColliding = true |
If true, the "buttonA" prompt will be shown when a player is colliding with the zone.
| LayerMask MoreMountains.TopDownEngine.ButtonActivated.TargetLayerMask = ~0 |
a layermask with all the layers that can interact with this specific button activated zone
| bool MoreMountains.TopDownEngine.ButtonActivated.UnlimitedActivations = true |
if this is set to false, your number of activations will be MaxNumberOfActivations
| bool MoreMountains.TopDownEngine.ButtonActivated.UseVisualPrompt = true |
if this is true, a prompt will be shown if setup properly
|
getset |
|
getset |
|
get |