示例#1
0
    public void AddScore(int value)
    {
        bool isBest = PlayerDataManager.SetScore(GetScore() + value);

        SetCurrentLevelScore(GetCurrentLevelScore() + value);
        if (!GetWhetherRateus() && GetScore() >= 1000)
        {
            SetHasRateus();
            UIManager.ShowPopPanelByType(UI_Panel.UI_PopPanel.RateusPanel);
        }
        if (GetCurrentLevelScore() >= UpgradeNeedScore)
        {
            SetCurrentLevelScore(0);
            PlayerDataManager.SetLevel(GetLevel() + 1);
            RefreshUpgradeNeedScore();
        }
        CurrentLevelProgress = GetLevel() + GetCurrentLevelScore() / (UpgradeNeedScore * 1f);
        UI_MenuPanel _MenuPanel = UIManager.GetUIPanel(UI_Panel.MenuPanel) as UI_MenuPanel;

        if (_MenuPanel != null)
        {
            _MenuPanel.RefreshScoreText();
            if (isBest)
            {
                _MenuPanel.RefreshBestScoreText();
            }
        }
    }
示例#2
0
    public int AddAmazon(int value)
    {
        int          endValue   = PlayerDataManager.AddAmazon(value);
        UI_MenuPanel _MenuPanel = UIManager.GetUIPanel(UI_Panel.MenuPanel) as UI_MenuPanel;

        if (_MenuPanel != null)
        {
            //_MenuPanel.RefreshCashText();
        }
        return(endValue);
    }
示例#3
0
        // =====================  重载 ============================
        /// <summary>
        /// 1: 初始化
        /// </summary>
        protected override void InitData()
        {
            base.InitData();
            Inst                = this;
            mBloodControl       = AddUI("UI_Fight/UI_BloodPanel_3_0").GetComponent <UI_BloodPanel>();
            mNumberMgr          = AddUI("UI_Fight/UI_HPPanel_3_1").GetComponent <UI_ShowPanel>();
            mMenuPanel          = AddUI("UI_Fight/UI_Menu_2_1").GetComponent <UI_MenuPanel>();
            mSkipAnimationPanel = AddUI("UI_SkipAnimation/UI_SkipAnimationPanel_1_0").GetComponent <UI_SkipAnimationPanel>();
            mMessageTip         = AddUI("UI_Fight/UI_MessageAlert_2_0").transform.FindChild("ShowMessage").GetComponent <CanvasGroup>();
            mFrontLayout        = AddUI("UI_Fight/UI_FrontLayout_1_0").transform;

            mShowMessage     = mMessageTip.transform.FindChild("image").GetComponent <Image>();
            mShowMessageText = mMessageTip.transform.FindChild("Text").GetComponent <Text>();
            mMessageRect     = mMessageTip.GetComponent <RectTransform>();
            var position = mMessageRect.anchoredPosition3D;

            mMessageRect.anchoredPosition3D = new Vector3(position.x, position.y + mMoveDistance, position.z);
            mShowMessageBackGround          = mShowMessage.overrideSprite;
            // 加載資源
            mFlagPre         = UIResourceMgr.LoadPrefab("UI/Prefabs/TargetFlag");
            heroBloodPre     = UIResourceMgr.LoadPrefab("UI/Prefabs/UI_Fight/HeroBloodBar");
            monsterBloodPre  = UIResourceMgr.LoadPrefab("UI/Prefabs/UI_Fight/MonsterBloodBar");
            bossBloodBar     = UIResourceMgr.LoadPrefab("UI/Prefabs/UI_Fight/BossBloodBar");
            pausePanelPrefab = UIResourceMgr.LoadPrefab("UI/Prefabs/UI_Fight/UI_FightPausePanel");

            mTouchControl = new UI_TouchControler();


            // 添加buff管理脚本
            mBuffMgr             = gameObject.AddComponent <UI_BuffMgr>();
            mBuffMgr.mMenuPanel  = mMenuPanel;
            mBuffMgr.mBloodPanel = mBloodControl;

            GameEventDispatcher.Inst.addEventListener(GameEventID.F_FightStateUpdate, onFightStatuChange);
            GameEventDispatcher.Inst.addEventListener(GameEventID.U_MessageAlert, onShowMessageCall);
            GameEventDispatcher.Inst.addEventListener(GameEventID.F_OnSupportMonstorBlood, onSupportMonstorBlood);
            GameEventDispatcher.Inst.addEventListener(GameEventID.SE_StoryEnter, onStoryCall);
            GameEventDispatcher.Inst.addEventListener(GameEventID.SE_StoryCameraEnter, onStoryCall);
            GameEventDispatcher.Inst.addEventListener(GameEventID.SE_StoryEnd, onStoryEnd);
            GameEventDispatcher.Inst.addEventListener(GameEventID.SE_StoryCameraEnd, onStoryCameraEnd);
            GameEventDispatcher.Inst.addEventListener(GameEventID.SE_ShowSkillTarget, onSingleSkillCall);
            GameEventDispatcher.Inst.addEventListener(GameEventID.F_BattleOver, onFightEndCall);
            GameEventDispatcher.Inst.addEventListener(GameEventID.F_BattleFail, onFightEndCall);
            GameEventDispatcher.Inst.addEventListener(GameEventID.F_CountDownOver, onFightEndCall);
            GameEventDispatcher.Inst.addEventListener(GameEventID.F_UI_ChangeHP, onHpChangeCall);
            GameEventDispatcher.Inst.addEventListener(GameEventID.F_UI_Dodge, onMissCall);
            GameEventDispatcher.Inst.addEventListener(GameEventID.F_IsOpenSealBox, IsShowSealBox);
            GameEventDispatcher.Inst.addEventListener(GameEventID.UI_MysteriousShopSpecialTips, MysteriousShopSpecialTips);
            GameEventDispatcher.Inst.addEventListener(GameEventID.SE_BossPass, WorldBossPassTips);
            //GameEventDispatcher.Inst.addEventListener(GameEventID.UI_SpecialStageTips, SpecialStageSpecialTips);
        }
示例#4
0
    public int AddProp2Num(int value)
    {
        int          currentPropNum = PlayerDataManager.AddPop2Num(value);
        UI_MenuPanel _MenuPanel     = UIManager.GetUIPanel(UI_Panel.MenuPanel) as UI_MenuPanel;

        if (_MenuPanel != null)
        {
            if (value < 0)
            {
                _MenuPanel.RefreshProp2();
            }
        }
        return(currentPropNum);
    }
示例#5
0
    public int AddCoin(int value)
    {
        int          endValue   = PlayerDataManager.AddCoin(value);
        UI_MenuPanel _MenuPanel = UIManager.GetUIPanel(UI_Panel.MenuPanel) as UI_MenuPanel;

        if (_MenuPanel != null)
        {
            if (value < 0)
            {
                _MenuPanel.RefreshCoinText();
            }
            _MenuPanel.RefreshProp1();
            _MenuPanel.RefreshProp2();
        }
        return(endValue);
    }
示例#6
0
    public void RestartGame()
    {
        PlayerDataManager.playerData.logRestartTime++;
        MainController.Instance.OnRestartGame();
        PlayerDataManager.SetScore(0);
        PlayerDataManager.SetLevel(0);
        RefreshUpgradeNeedScore();
        PlayerDataManager.SetProp1NeedCoinNum(originPropNeedCoinNum);
        PlayerDataManager.SetProp2NeedCoinNum(originPropNeedCoinNum);
        PlayerDataManager.ReSetLevelTargetBallNum();
        UI_MenuPanel _MenuPanel = UIManager.GetUIPanel(UI_Panel.MenuPanel) as UI_MenuPanel;

        if (_MenuPanel != null)
        {
            _MenuPanel.RefreshScoreText();
            _MenuPanel.ResetStageProgress();
            _MenuPanel.SetStageInfo();
            _MenuPanel.RefreshProp1();
            _MenuPanel.RefreshProp2();
        }
        LevelManager.SetTargetBallNum(PlayerDataManager.GetLevelTargetBallNum());
    }
示例#7
0
    public int AddCash(int value)
    {
        int          endValue   = PlayerDataManager.AddCash(value);
        UI_MenuPanel _MenuPanel = UIManager.GetUIPanel(UI_Panel.MenuPanel) as UI_MenuPanel;

        if (_MenuPanel != null)
        {
            if (value < 0)
            {
                _MenuPanel.RefreshCashText();
            }
            if (!PlayerDataManager.GetWhetherGuideCash())
            {
                PlayerDataManager.SetHasGuideCash();
                UI_PanelBase wheelPanel = UIManager.GetUIPanel(UI_Panel.UI_PopPanel.WheelPanel);
                if (wheelPanel != null)
                {
                    UIManager.ClosePopPanel(wheelPanel);
                }
                _MenuPanel.ShowGuideCash();
            }
        }
        return(endValue);
    }