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

Implementation

1
public class SkillUI : MonoBehaviour
Copied!

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
Text component where the required level will be shown
Text component where the required skill points will be shown
​tooltipSkillStateValue​
Text component where the state will be shown
Color value for tooltipSkillStateValue when locked
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

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
Called when starting to drag a skill
​OnDragEnd(BaseEventData)​
Called when stopping to drag a skill
Called when dragging a skill

Properties

Name
Description
​SkillAsset​
Contains a reference to the skill of this element
Last modified 1yr ago