如题。
private GameObject myBtn;
private Vector3 scaleOri;
[SerializeField]
public float bigger;
void Start()
{
myBtn = this.gameObject;
scaleOri = myBtn.transform.localScale;
}
// Update is called once per frame
void Update()
{
}
public void OnMouseEnter()
{
myBtn.transform.localScale *= bigger;
Debug.Log("进入按钮!!!");
}
public void OnMouseExit()
{
myBtn.transform.localScale = scaleOri;
}
已添加BoxCollider2D和该脚本,但debug与操作无任何反应,怎么处理鼠标进入退出按钮,缩放按钮功能好?谢谢