You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.5 KiB
52 lines
1.5 KiB
using UnityEngine; |
|
using Ability; |
|
using TMPro; |
|
|
|
public class InGameAbilityIcon : MonoBehaviour |
|
{ |
|
[SerializeField] InGameAbType m_type; |
|
[SerializeField] TextMeshProUGUI m_nameText; |
|
|
|
//----------------------------------------------------------------------------------------- |
|
public InGameAbType Type |
|
{ |
|
get { return m_type; } |
|
} |
|
|
|
//----------------------------------------------------------------------------------------- |
|
void Start () |
|
{ |
|
if (m_nameText) |
|
m_nameText.text = CommonFunctions.GetInGameAbilityNameStr(m_type); |
|
} |
|
|
|
//----------------------------------------------------------------------------------------- |
|
void Update () |
|
{ |
|
|
|
} |
|
|
|
//----------------------------------------------------------------------------------------- |
|
public void DisableAbName() |
|
{ |
|
Transform nameTrans = transform.Find("abName"); |
|
if (nameTrans) |
|
nameTrans.gameObject.SetActive(false); |
|
} |
|
|
|
//----------------------------------------------------------------------------------------- |
|
public void OnMouseDown() |
|
{ |
|
if (GlobalsVar.gBoard) |
|
{ |
|
GameBoard gameBoard = GlobalsVar.gBoard as GameBoard; |
|
if (gameBoard) |
|
{ |
|
gameBoard.MainCharacter.AddAbility(m_type); |
|
|
|
GameObject dlgObj = gameBoard.GetDialogByType(DialogType.ADD_IN_GAME_ABILITY_DIALOG); |
|
dlgObj.GetComponent<AddInGameAbilityDialog>().HideDialog(); |
|
} |
|
} |
|
} |
|
}
|
|
|