通常游戏中的引导分为两种,强制引导和非强制引导,强制引导只能点被引导的按钮,点屏幕别的界面会提示玩家跟据引导提示走。刚接触ngui代码,大概了解了一下NGUI的工作原理,基本上实现了策划的要求。
在uicamera.cs中拦截玩家的点击事件:
static public void Notify (GameObject go, string funcName, object obj)
{
if (mNotifying > 10) return;
// Automatically forward events to the currently open popup list
if (currentScheme == ControlScheme.Controller && UIPopupList.isOpen &&
UIPopupList.current.source == go && UIPopupList.isOpen)
go = UIPopupList.current.gameObject;
if (go && go.activeInHierarchy)
{
///start by jackniu
//add for tutorial jackniu
if (TutorialManage.GetInstance().CheckTutorial(go, funcName)) return;
///end by jackniu
++mNotifying;
//if (currentScheme == ControlScheme.Controller)
// Debug.Log((go != null ? "[" + go.name + "]." : "[global].") + funcName + "(" + obj + ");", go);
go.SendMessage(funcName, obj, SendMessageOp