通常游戏中的引导分为两种,强制引导和非强制引导,强制引导只能点被引导的按钮,点屏幕别的界面会提示玩家跟据引导提示走。刚接触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

本文介绍如何在Unity使用NGUI系统中创建引导,并通过修改uicamera.cs来拦截玩家的点击事件,确保玩家在强制引导期间只能交互于指定的按钮,防止他们偏离引导流程。

427

被折叠的 条评论
为什么被折叠?



