SkillUI

Contains the logic for handling the UI of the shown skills in the skill tree UI.

Implementation

public class SkillUI : MonoBehaviour

Inheritance

MonoBehaviour --> SkillUI

Fields

Name

Description

DATABASE_SKILLS

Reference to the skills database

button

The button component of this gameobject

skillTreeUIManager

The SkillTreeUIManager component of the skill tree

skillTreeOpener

The Skills component of the opener of the skill tree

skillConnectorEnabled

References the enabled skill connector used between two skills

skillConnectorDisabled

References the disabled skill connector used between two skills

skillIconEnabled

Image component used for the icon when the skill is unlocked

skillIconDisabled

Image component used for the icon when the skill is locked

tooltipIcon

Image component used for the skill icon in the tooltip

tooltipName

Text component where the name of the skill will be shown

tooltipDescription

Text component where the description of the skill will be shown

tooltipLevelRequiredValue

Text component where the required level will be shown

tooltipSkillPointsRequiredValue

Text component where the required skill points will be shown

tooltipSkillStateValue

Text component where the state will be shown

tooltipSkillStateValueColorLocked

Color value for tooltipSkillStateValue when locked

tooltipSkillStateValueColorUnlocked

Color value for tooltipSkillStateValue when unlocked

imageLocked

Image component that shows if a skill is locked

imageUnlocked

Image component that shows if a skill is unlocked

skillTransform

The RectTransform component of this gameobject

prefabContextMenu

Prefab of the context menu

skillContextMenu

The current context menu that is shown/was last shown

eventOnHoverEnter

Defines the logic that will be executed when you start hovering over the skill

eventOnHoverExit

Defines the logic that will be executed when you exit hovering over the skill

Methods

Name

Description

Setup(Skills, SkillAsset, Skill.SkillState)

Calls different methods for the setup of the UI and events

UpdateUI(SkillAsset, Skill.SkillState)

Updates the UI

OnClick()

Called when left-clicking on the image

OnClickRight()

Called when right-clicking on the image

ShowSkillContextMenu(int, GameObject, RectTransform)

Shows the context menu for the skill

HideSkillContextMenu()

Hides the context menu

AddButtonListeners(SkillContextMenuUI, int)

Adds the button listeners for the different context menu buttons

SetButtonVisibility(int, SkillContextMenuUI)

Sets the context menu button's visibility

UnlockSkill(int)

Called when clicking on the Unlock Skill button

SkillAddToSkillBar(int)

Called when clicking on the Add To Skill Bar button

SkillRemoveFromSkillBar(int)

Called when clicking on the Remove From Skill Bar button

SetupEvents(EventTriggerType, UnityAction)

Sets up the events for the skill dragging

OnPointerEnter(BaseEventData)

Called when the mouse pointer enters the UI area

OnPointerExit(BaseEventData)

Called when the mouse pointer exits the UI area

OnDragBegin(BaseEventData)

Called when starting to drag a skill

OnDragEnd(BaseEventData)

Called when stopping to drag a skill

OnDragMove(BaseEventData)

Called when dragging a skill

Properties

Name

Description

SkillAsset

Contains a reference to the skill of this element