public bool FeatureWar_Cast(BoxCollider collider, float manualHeight)
    {
        //用来判断是否为特殊步骤
        bool             over      = true;
        BanBattleManager battleMgr = BanBattleManager.Instance;

        if (curStep == GuideStep.XiaoWuKong_OverSkill1)
        {
            Object obj = PrefabLoader.loadFromUnPack("Ban/AngryGuide", false);
            castGuide = Instantiate(obj) as GameObject;
            RED.AddChild(castGuide, BanBattleManager.Instance.AngryPos);
            castGuide.transform.localPosition = new Vector3(0f, 11f, 0f);
            //走到这一步
            curStep = GuideStep.XiaoWuKong_Cast_Overskill;
            //小悟空的怒气技要把按钮暴露出来
            StartCoroutine(turnAngryBtn());

            //设定Boxcollider的位置
            collider.center = new Vector3(-424f, FitScreen(-198f, manualHeight), 0);
            collider.size   = new Vector3(160f, 160f, 0);

            over = false;
            now  = Time.realtimeSinceStartup;
        }
        else if (curStep == GuideStep.XiaoWuKong_Cast_Overskill)
        {
            ///
            /// --- 为了防止用户的快速点击操作 -----
            ///
            float cur   = Time.realtimeSinceStartup;
            float delta = cur - now;
            if (delta <= 1)
            {
                return(false);
            }

            if (castGuide != null)
            {
                Destroy(castGuide);
            }
            Time.timeScale = 1.0f;

            BanSideInfo attside = battleMgr.attackSideInfo;
            attside.PlayerAngryWord.FeatureWarShow(1, string.Empty, () => { battleMgr.AngryUI(false, null, -1); });
            attside.angrySlot.curAP = 0;

            //走到这一步
            curStep = GuideStep.XiaoWuKong_Cast_Over;
            //设定Boxcollider的位置
            collider.center = Vector3.zero;
            collider.size   = new Vector3(1600f, 1200f, 0);

            over = false;

            StartCoroutine(battleMgr.getGuideUI.Guide_DX());
        }

        return(over);
    }
    //小悟空的怒气技要把按钮暴露出来
    IEnumerator turnAngryBtn()
    {
        BanBattleManager battleMgr = BanBattleManager.Instance;

        Time.timeScale = 1.0f;
        yield return(new WaitForSeconds(0.1f));

        SkillData sd = Core.Data.skillManager.getSkillDataConfig(25037);

        battleMgr.AngryUI(true, sd, 1);
        Invoke("stopAgain", 0.6f);
    }
    /// <summary>
    /// 新手引导第一关
    /// </summary>

    IEnumerator showLevel1(Item curItem, BanBattleManager battleMgr, GuideManager mgr, TemporyData temp)
    {
        NewFloor floor = Core.Data.newDungeonsManager.curFightingFloor;

                #if NewGuide
        if (floor != null && floor.config.ID == 60103 && mgr.isGuiding)
        {
                #else
        if (floor != null && floor.config.ID == 60101 && mgr.isGuiding)
        {
                #endif
            if (isGuideLevel1(curItem, battleMgr))
            {
                SkillData sd = Core.Data.skillManager.getSkillDataConfig(25037);
                battleMgr.AngryUI(true, sd, 1);
                yield return(new WaitForSeconds(BanTimeCenter.XiaoWuKong_Level1));

                Time.timeScale = 0.0f;
                mgr.AutoRUN();
            }
        }
    }

    bool isGuideLevel1(Item curItem, BanBattleManager battleMgr)
    {
        bool guide  = false;
        int  attNum = battleMgr.GetBattleRole(curItem.attackIndex).number;
        int  defNum = battleMgr.GetBattleRole(curItem.defenseIndex).number;

                #if NewGuide
        if (attNum == 10142 && defNum == 10172)
        {
                #else
        if (attNum == 10142 && defNum == 10175)
        {
                #endif
            if (curItem.period == Period.AngrySkillReady)
            {
                guide   = true;
                curStep = GuideStep.XiaoWuKong_OS_1;
                ConsoleEx.DebugLog("isGuideLevel1 is going", ConsoleEx.RED);
            }
        }

        return(guide);
    }

    #endregion
}
Пример #4
0
    protected override void OnEvent(EventTypeDefine p_e, object p_param)
    {
        ConsoleEx.DebugLog("EventType = " + p_e.ToString(), ConsoleEx.YELLOW);
        BanBattleManager battleMgr = BanBattleManager.Instance;
        BanSideInfo      attside   = battleMgr != null ? battleMgr.attackSideInfo : null;
        GuideManager     guideMgr  = Core.Data.guideManger;

#if NewGuide
        NewUIGuide guideUI = NewUIGuide.Instance;
#else
        UIGuide guideUI = UIGuide.Instance;
#endif
        TemporyData temp = Core.Data.temper;

        switch (p_e)
        {
        //打开第一个宝箱
        case EventTypeDefine.OpenTreasureChest:
            if (Open != null)
            {
                GuideData data = p_param as GuideData;
                if (data != null)
                {
                    Open(data.MultiIndex);
                    Core.Data.guideManger.DelayAutoRun(1.5f);
                }
            }
            break;

        //退出战斗
        case EventTypeDefine.ExitFightingScene:
            if (Exit != null)
            {
                AsyncTask.QueueOnMainThread(
                    () => {
                    Exit();
                    #region Add by jc 如果没有升级并且已经是最后一步引导了
                    if (Core.Data.playerManager.Lv <= temp.mPreLevel && temp.mPreLevel > 0 && !guideMgr.isLastOfCurGuide)
                    {
                        guideUI.HideGuide();
                        Core.Data.guideManger.DelayAutoRun(2.5f);
                    }
                    #endregion
                }
                    , 0.5f
                    );
            }
            break;

        case EventTypeDefine.Click_XiaoWuKongVBiKe:                       //显示双方队伍
        case EventTypeDefine.Click_WuKong2_Anger:                         //孙悟空2继承小悟空20怒气
        case EventTypeDefine.Click_BILUSI_V_WuKong3:                      //比鲁斯
        case EventTypeDefine.Click_WuKong3_NO_ANGER:                      //没有怒气值不能释放主动技能
        case EventTypeDefine.Click_WuKong3_Vs_BiLu:                       //孙悟空3对决比鲁斯
            guideUI.HideGuide();
            Time.timeScale = 1.0f;
            break;

            #region 怒气技的起始阶段
        case EventTypeDefine.Click_XiaoWuKong_OS_4: {
            Time.timeScale = 1.0f;
            SkillData sd = Core.Data.skillManager.getSkillDataConfig(25037);
            attside.PlayerAngryWord.FeatureWarShow(1, sd.name, () => { Time.timeScale = 0f; });
        }
        break;

        case EventTypeDefine.Click_WuKong2_OS_4: {
            Time.timeScale = 1.0f;
            SkillData sd = Core.Data.skillManager.getSkillDataConfig(25008);
            attside.PlayerAngryWord.FeatureWarShow(1, sd.name, () => { Time.timeScale = 0f; });
        }
        break;

        case EventTypeDefine.Click_WuKong3_OS_4: {
            Time.timeScale = 1.0f;
            SkillData sd = Core.Data.skillManager.getSkillDataConfig(25058);
            attside.PlayerAngryWord.FeatureWarShow(1, sd.name, () => { Time.timeScale = 0f; });
        }
        break;
            #endregion

        case EventTypeDefine.Click_XiaoWuKong_OS_4_2:
            Time.timeScale = 1.0f;
            attside.PlayerAngryWord.FeatureWarShow(2, string.Empty, () => { Time.timeScale = 0f; });
            break;

        case EventTypeDefine.Click_XiaoWuKong_OS_4_3:
            Time.timeScale = 1.0f;
            attside.PlayerAngryWord.FeatureWarShow(3, string.Empty, () => { Time.timeScale = 0f; });
            break;

        case EventTypeDefine.Click_XiaoWuKong_OS_4_4:
            Time.timeScale = 1.0f;
            guideUI.HideGuide();
            AsyncTask.RemoveAllDelayedWork();
            attside.PlayerAngryWord.FeatureWarShow(4, string.Empty, () => { battleMgr.AngryUI(false, null, -1); });

            long      now  = Core.TimerEng.curTime;
            TimerTask task = new TimerTask(now, now + 2, 1, ThreadType.MainThread);
            task.onEventEnd = (t) => {
                Time.timeScale = 1.0f;
                AsyncTask.RemoveAllDelayedWork();
                battleMgr.AngryUI(false, null, -1);
            };
            task.DispatchToRealHandler();
            break;

        case EventTypeDefine.Click_XiaoWuKong_Lv1: {
            Time.timeScale = 1.0f;
            guideUI.HideGuide();
            AsyncTask.RemoveAllDelayedWork();

            attside.PlayerAngryWord.FeatureWarShow(1, string.Empty, () => { battleMgr.AngryUI(false, null, -1); });
            attside.angrySlot.curAP = 0;
            battleMgr.Root.Camera1.eventReceiverMask = LayerMask.NameToLayer("Everything");
        }
        break;

        //调用武者强化
        case EventTypeDefine.Click_JumpToStrengthening:
            if (Exit != null)
            {
                UIGuide.Instance.HideGuide();

                Core.Data.guideManger.DelayAutoRun(2f);
                // --- 武者强化 ---
                FinalTrialMgr.GetInstance().jumpTo = TrialEnum.None;
                BattleToUIInfo.From = RUIType.EMViewState.S_Team_NoSelect;
                Exit();
            }

            break;
        }
    }
    /// <summary>
    /// 未来之战的引导
    /// </summary>

    IEnumerator showFeatureWar(Item curItem, BanBattleManager battleMgr, GuideManager mgr)
    {
        if (isGuide_1(curItem, battleMgr))
        {
            yield return(new WaitForSeconds(BanTimeCenter.XiaoWuKong_V_BiKe));

            Time.timeScale = 0.0f;
            mgr.AutoRUN();
        }

        if (isGuide_2(curItem, battleMgr))
        {
            //小悟空的怒气技要把按钮暴露出来
            SkillData sd = Core.Data.skillManager.getSkillDataConfig(25037);
            battleMgr.AngryUI(true, sd, 4);
            yield return(new WaitForSeconds(BanTimeCenter.XiaoWuKong_OS_4));

            mgr.AutoRUN();
            yield return(new WaitForSeconds(1F));

            Time.timeScale = 0.0f;
        }

        if (isGuide_3(curItem, battleMgr))
        {
            yield return(new WaitForSeconds(BanTimeCenter.WuKong2_Anger));

            Time.timeScale = 0.0f;
            mgr.AutoRUN();
        }

        if (isGuide_4(curItem, battleMgr))
        {
            //悟空2的怒气技要把按钮暴露出来
            SkillData sd = Core.Data.skillManager.getSkillDataConfig(25037);
            battleMgr.AngryUI(true, sd, 4);
            yield return(new WaitForSeconds(BanTimeCenter.XiaoWuKong_OS_4));

            Time.timeScale = 0.0f;
            mgr.AutoRUN();
        }

        if (isGuide_5(curItem, battleMgr))
        {
            //悟空3的怒气技要把按钮暴露出来
            SkillData sd = Core.Data.skillManager.getSkillDataConfig(25058);
            battleMgr.AngryUI(true, sd, 4);
            yield return(new WaitForSeconds(BanTimeCenter.XiaoWuKong_OS_4));

            Time.timeScale = 0.0f;
            mgr.AutoRUN();
        }

        if (isGuide_6(curItem, battleMgr))
        {
            yield return(new WaitForSeconds(BanTimeCenter.BILUSI_V_WuKong3));

            Time.timeScale = 0.0f;
            mgr.AutoRUN();
        }

        //没有怒气值不能释放主动技能
        if (isGuide_7(curItem, battleMgr))
        {
            yield return(new WaitForSeconds(BanTimeCenter.WuKong3_NO_ANGER));

            Time.timeScale = 0.0f;
            mgr.AutoRUN();
        }

        //超级孙悟空3对决比鲁斯
        if (isGuide_8(curItem, battleMgr))
        {
            Time.timeScale = 0.0f;
            mgr.AutoRUN();
        }
    }