示例#1
0
    public static void ShowStageEnsure(StageDataItem stageInfo)
    {
        Hashtable hash = new Hashtable();

        hash.Add("StageInfo", stageInfo);
        GameCore.Instance.UIManager.ShowUI(UIConfig.UIStageEnsure, UILayer.PopUI, hash);
    }
示例#2
0
    public override void Show(Hashtable hash)
    {
        base.Show(hash);

        StageDataItem stageItem = (StageDataItem)hash["InitObj"];

        ShowStageInfo(stageItem);
    }
示例#3
0
 public void TestStage(StageDataItem stageItem)
 {
     _TestingStage = stageItem;
     _TestInfos.Clear();
     _TestInfos.Add(_TestingStage, new List <TestStageInfo>());
     StageDataPack.Instance._FightingStage = _TestingStage;
     LogicManager.Instance.EnterFight(_TestingStage);
 }
示例#4
0
    public void TestStageUpdate()
    {
        if (_TestingStage == null)
        {
            return;
        }

        if (!UIFightBox.IsTestMode())
        {
            UIFightBox.SetTest();
        }

        if (UIStageSucess.IsShow() || UIStageFail.IsShow())
        {
            TestStageInfo testInfo = new TestStageInfo();
            if (UIStageSucess.IsShow())
            {
                testInfo._IsWin = true;
            }
            else
            {
                testInfo._IsWin = false;
            }
            testInfo._Round      = BattleField.Instance._BattleRound - 1;
            testInfo._RemainHP   = (int)(((float)BattleField.Instance._RoleMotion._HP / BattleField.Instance._RoleMotion._MaxHP) * 10);
            testInfo._ElimitTrap = BallBox.Instance._ElimitTrapCnt;
            testInfo._ElimitBomb = BallBox.Instance._ElimitBombCnt;

            ++_TestTimes;
            _TestInfos[_TestingStage].Add(testInfo);
            LogicManager.Instance.ExitFight();

            if (_TestTimes >= _DefaultTestTimes)
            {
                _TestTimes = 0;
                //++_CurIdx;
                //if (_CurIdx >= _TargetIdx)
                {
                    _TestingStage = null;
                    WriteRecords();
                }
                //else
                //{
                //    _TestingStage = StageDataPack.Instance._StageItems[_CurIdx];
                //    _TestInfos.Add(_TestingStage, new List<TestStageInfo>());
                //    StageDataPack.Instance._FightingStage = _TestingStage;
                //    LogicManager.Instance.EnterFight(_TestingStage);
                //}
            }
            else
            {
                StageDataPack.Instance._FightingStage = _TestingStage;
                LogicManager.Instance.EnterFight(_TestingStage);
            }
        }
    }
示例#5
0
    private void OnChooseStage(object selectItem)
    {
        StageDataItem selectStage = (StageDataItem)selectItem;

        Debug.Log("OnChooseStage:" + selectStage.StageID);
        int stageIdx = int.Parse(selectStage.StageID) - 1;

        if (stageIdx <= StageDataPack.Instance.CurIdx)
        {
            UIStageEnsure.ShowStageEnsure(selectStage);
        }

        UIGuide.HideGuide();
    }
示例#6
0
    public void PassStage(StageMapRecord passStageMap)
    {
        List <AwardItem> awardList = new List <AwardItem>();

        _FightingStage = LogicManager.Instance.EnterStageInfo;
        var baseAward = AwardManager.AddAward(_FightingStage.StageRecord.AwardType[0], _FightingStage.StageRecord.AwardValue[0]);

        awardList.Add(baseAward);

        int starCnt = 0;

        for (int i = 0; i < 3; ++i)
        {
            if (_FightingStage.IsStarOn(i))
            {
                continue;
            }

            bool isGetStar = true;
            if (passStageMap._StarInfos.Count > i)
            {
                isGetStar = StarInfoBase.isCanGetStar(passStageMap._StarInfos[i]);
            }

            if (isGetStar)
            {
                StageDataPack.Instance.SetStageStar(_FightingStage.StageRecord.Id, i);

                var starAward = AwardManager.AddAward(_FightingStage.StageRecord.AwardType[i + 1], _FightingStage.StageRecord.AwardValue[i + 1]);
                awardList.Add(starAward);
            }
        }

        for (int i = 0; i < 3; ++i)
        {
            if (_FightingStage.IsStarOn(i))
            {
                ++starCnt;
            }
        }

        StageDataPack.Instance.SaveClass(true);
        UIFightBox.HideOptMask();
        UIStageSucess.ShowAsyn(_FightingStage.StageRecord, starCnt, awardList);

        WeaponDataPack.Instance.RefreshUnLock();
    }
示例#7
0
    public void InitStageInfo()
    {
        if (_StageItems == null)
        {
            _StageItems = new List <StageDataItem>();
        }

        if (_StageItems.Count == 0)
        {
            foreach (var tabRecord in TableReader.StageInfo.Records)
            {
                StageDataItem stageItem = new StageDataItem();
                stageItem.StageID = tabRecord.Key;
                stageItem.Star    = 0;

                _StageItems.Add(stageItem);
            }
        }
    }
示例#8
0
    public void EnterFight(StageDataItem enterStage)
    {
        EnterStageInfo = enterStage;

        GameCore.Instance.UIManager.DestoryAllUI();

        Hashtable hash = new Hashtable();

        hash.Add("StageRecord", enterStage);

        GameCore.Instance.EventController.PushEvent(EVENT_TYPE.EVENT_LOGIC_ENTER_STAGE, this, hash);

        UIFightBattleField.ShowAsyn();

        var mapRecord = StageMapRecord.ReadStageMap(enterStage.StageRecord.ScenePath);

        BallBox.Instance.Init(mapRecord);
        BallBox.Instance.InitBallInfo();

        BattleField.Instance.InitBattle(enterStage.StageRecord, mapRecord);
    }
示例#9
0
 private void ShowStageInfo(StageDataItem stageItem)
 {
     _UIStageName.text = Tables.StrDictionary.GetFormatStr(stageItem.StageRecord.Name);
 }
示例#10
0
 public override void Show(Hashtable hash)
 {
     base.Show(hash);
     _StageInfo = (StageDataItem)hash["StageInfo"];
     Refresh();
 }