GuidePanel即新手引导界面
1、遮罩
GuidePanel添加张image,勾选Raycast Target,调整颜色并设置全屏。
2、高亮区域的显示
// 取消高亮
private void CancelHightLight(GameObject go)
{
Destroy(go.GetComponent<GraphicRaycaster>());
Destroy(go.GetComponent<Canvas>());
//Next();
EventTriggerListener.Get(go).onClick -= CancelHightLight;
}
// 跳跃引导
private void JumpGuide()
{
GamePanel gamePanel = UIManager.Instance.GetUIPage<GamePanel>();
if (gamePanel == null)
return;
GameObject jump = gamePanel.JumpBtn.gameObject;
Canvas canvas = jump.AddComponent<Canvas>();
canvas.overrideSorting = true;
canvas.sortingOrder = 1;
jump.AddComponent<GraphicRaycaster>();
//设置监听
EventTriggerListener.Get(jump).onClick += CancelHightLight; // 为跳跃按钮增加一个响应函数
}