38 lines
899 B
C#
38 lines
899 B
C#
using QuickOutline;
|
|
using UnityEngine;
|
|
using ZXKFramework;
|
|
|
|
[RequireComponent(typeof(Outline))]
|
|
public class ModelClick : MonoBehaviour
|
|
{
|
|
Outline outline;
|
|
[Header("µã»÷ºó·¢Ë͵ÄÏûÏ¢ÀàÐÍ")]
|
|
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);
|
|
}
|
|
}
|