42 lines
800 B
C#
42 lines
800 B
C#
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace UMod.Example
|
|
{
|
|
public class UIModElement : MonoBehaviour
|
|
{
|
|
// Public
|
|
public Text nameText;
|
|
public Text versionText;
|
|
|
|
public Text pathText;
|
|
|
|
// Events
|
|
public Action<UIModElement> OnClicked;
|
|
|
|
// Properties
|
|
public string Name
|
|
{
|
|
get => nameText.text;
|
|
set => nameText.text = value;
|
|
}
|
|
|
|
public string Version
|
|
{
|
|
set => versionText.text = value;
|
|
}
|
|
|
|
public string Path
|
|
{
|
|
set => pathText.text = value;
|
|
}
|
|
|
|
// Methods
|
|
public void OnElementClicked()
|
|
{
|
|
if (OnClicked != null)
|
|
OnClicked(this);
|
|
}
|
|
}
|
|
} |