36 lines
748 B
C#
Raw Permalink Normal View History

2025-03-11 15:30:07 +08:00
using QuickOutline;
using UnityEngine;
[RequireComponent(typeof(Outline))]
public class Target : MonoBehaviour
{
Outline outline;
public void Init()
{
outline = GetComponent<Outline>();
gameObject.layer = LayerMask.NameToLayer("Target");
Hide();
}
public void Show()
{
gameObject.SetActive(true);
UnFocus();
}
public void Hide()
{
gameObject.SetActive(false);
}
public void UnFocus()
{
outline.OutlineColor = new Color(0,1,0);
}
public void Focus()
{
outline.OutlineColor = new Color(1,1,0);
}
public void Execute()
{
//todo
Debug.Log(name+" Success");
}
}