2017-07-30 02:09:19 +08:00
|
|
|
/// Credit playemgames
|
|
|
|
/// Sourced from - http://forum.unity3d.com/threads/sprite-icons-with-text-e-g-emoticons.265927/
|
|
|
|
|
2017-08-02 17:21:45 +08:00
|
|
|
namespace UnityEngine.UI.Extensions.Examples
|
2017-07-30 02:09:19 +08:00
|
|
|
{
|
2017-08-02 17:21:45 +08:00
|
|
|
public class testHref : MonoBehaviour
|
2017-07-30 02:09:19 +08:00
|
|
|
{
|
2017-08-02 17:21:45 +08:00
|
|
|
public TextPic textPic;
|
2017-07-30 02:09:19 +08:00
|
|
|
|
2017-08-02 17:21:45 +08:00
|
|
|
void Awake()
|
|
|
|
{
|
|
|
|
textPic = GetComponent<TextPic>();
|
|
|
|
}
|
2017-07-30 02:09:19 +08:00
|
|
|
|
2017-08-02 17:21:45 +08:00
|
|
|
void OnEnable()
|
|
|
|
{
|
|
|
|
textPic.onHrefClick.AddListener(OnHrefClick);
|
|
|
|
}
|
2017-07-30 02:09:19 +08:00
|
|
|
|
2017-08-02 17:21:45 +08:00
|
|
|
void OnDisable()
|
|
|
|
{
|
|
|
|
textPic.onHrefClick.RemoveListener(OnHrefClick);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void OnHrefClick(string hrefName)
|
|
|
|
{
|
|
|
|
Debug.Log("Click on the " + hrefName);
|
|
|
|
}
|
2017-07-30 02:09:19 +08:00
|
|
|
}
|
2017-08-02 17:21:45 +08:00
|
|
|
}
|