コード例 #1
0
    public bool Init(DataTable table)
    {
        IDictionaryEnumerator itr = table.GetEnumerator();

        while (itr.MoveNext())
        {
            GuideTableItem item = itr.Value as GuideTableItem;

            if (item == null)
            {
                continue;
            }
            if (item.type < (int)GUIDE_TYPE.GUIDE_FIRST_GAME || item.type > (int)GUIDE_TYPE.GUIDE_TYPE_MAX)
            {
                LogOut("引导类型填写错误 type=" + item.type.ToString());
                return(false);
            }
            GUIDE_TYPE type = (GUIDE_TYPE)item.type;

            if (type == GUIDE_TYPE.GUIDE_ENTER_TRIGGER)
            {
                continue;
            }

            if (!GuideManager.Instance.mGuides.ContainsKey(type))
            {
                mGuides.Add(type, new List <GuideTableItem>());
            }
            mGuides[type].Add(item);
        }
        return(true);
    }
コード例 #2
0
    private void onBeginGuide(GuideTableItem item)
    {
        if (item == null)
        {
            return;
        }

        if (mGuideRuntime != null && mGuideRuntime.GetResID() == item.id)
        {
            return;
        }

        if (mGuideRuntime != null && mGuideRuntime.IsRuning())
        {
            //mCacheQueue.Enqueue(id);
            GameDebug.Log("引导 id=" + mGuideRuntime.GetResID().ToString() + "未完成   强制下一个引导 id=" + item.id.ToString());
            mGuideRuntime.Destroy();
        }


//         if( mGuideRuntime != null && mGuideRuntime.IsRuning() )
//         {
//             mCacheQueue.Enqueue(id);
//             GameDebug.Log("引导问题 : 有一个引导正在进行中. 放入缓存 id = " + id.ToString());
//             return;
//         }

        mGuideRuntime = new GuideRuntime(item.id, item.script);

        mGuideRuntime.Begin();
    }
コード例 #3
0
    public bool IsHelperReplace()
    {
        GuideTableItem item = GetRes();

        if (item == null)
        {
            return(false);
        }
        return(item.helperReplace > 0);
    }
コード例 #4
0
    public void OnGuideEnd()
    {
        HideUI();

        if (mGuideRuntime != null)
        {
            GuideTableItem res = mGuideRuntime.GetRes();
            if (res != null && res.beginHelper > 0)
            {
                ZhushouManager.Instance.Begin();
            }
        }
    }
コード例 #5
0
 private bool CheckAndBeginGuide(GuideTableItem item, int condition)
 {
     if (item == null)
     {
         return(false);
     }
     if (item.condition != condition)
     {
         return(false);
     }
     if (CheckComplete(item.id) >= 0)
     {
         return(false);
     }
     onBeginGuide(item);
     return(true);
 }
コード例 #6
0
    public void OnEnterTrigger(int guideId)
    {
        if (!DataManager.GuideTable.ContainsKey(guideId))
        {
            return;
        }
        GuideTableItem item = DataManager.GuideTable[guideId] as GuideTableItem;

        if (item == null)
        {
            return;
        }
        LogOut("进入热区 触发引导ID= " + guideId.ToString());

        if (CheckComplete(item.id) >= 0)
        {
            return;
        }
        onBeginGuide(item);
    }