Files
Continentis/Assets/UMod/Examples/Scripts/UIModElement.cs

42 lines
800 B
C#
Raw Normal View History

2025-10-03 00:02:43 -04:00
using System;
using UnityEngine;
using UnityEngine.UI;
namespace UMod.Example
{
public class UIModElement : MonoBehaviour
{
// Public
public Text nameText;
public Text versionText;
2026-03-20 11:56:50 -04:00
2025-10-03 00:02:43 -04:00
public Text pathText;
2026-03-20 11:56:50 -04:00
// Events
public Action<UIModElement> OnClicked;
2025-10-03 00:02:43 -04:00
// Properties
public string Name
{
2026-03-20 11:56:50 -04:00
get => nameText.text;
set => nameText.text = value;
2025-10-03 00:02:43 -04:00
}
public string Version
{
2026-03-20 11:56:50 -04:00
set => versionText.text = value;
2025-10-03 00:02:43 -04:00
}
public string Path
{
2026-03-20 11:56:50 -04:00
set => pathText.text = value;
2025-10-03 00:02:43 -04:00
}
// Methods
public void OnElementClicked()
{
if (OnClicked != null)
OnClicked(this);
}
}
2026-03-20 11:56:50 -04:00
}