38 lines
899 B
C#
Raw Normal View History

2025-03-11 16:24:25 +08:00
using QuickOutline;
using UnityEngine;
using ZXKFramework;
[RequireComponent(typeof(Outline))]
public class ModelClick : MonoBehaviour
{
Outline outline;
[Header("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><CDB5><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>")]
public EventType type;
private void Awake()
{
outline = GetComponent<Outline>();
}
private void Start()
{
if (outline)
{
outline.OutlineMode = Outline.Mode.OutlineAll;
outline.OutlineColor = new Color(0, 1, 0, 1);
outline.OutlineWidth = 2f;
}
}
private void OnMouseDown()
{
Hide();
Game.Instance.eventManager.Raise(new MessageTypeEvent() {type = type , id = MVC.GetModel<GameModel>().GetId()});
}
public void Show()
{
gameObject.SetActive(true);
}
public void Hide()
{
gameObject.SetActive(false);
}
}