コード例 #1
0
    private void InitCoin()
    {
        //获取玩家停车场等级       获取玩家现有金币
        parkingCenterData = GlobalDataManager.GetInstance().playerData.GetParkingCenterDataIDIndexOfDataIdx();

        profitLevel        = parkingCenterData.parkingProfitLevel;
        parkingSpaceLevel  = parkingCenterData.parkingSpaceLevel;
        enterCarSpawnLevel = parkingCenterData.parkingEnterCarSpawnLevel;

        coinVal                   = playerData.playerZoo.playerCoin.GetCoinByScene(currSceneID).coinBigInt;
        consumeProfitCoins        = ParkingCenter.GetUpGradeParkingProfitConsumption(profitLevel);
        consumeParkingSpaceCoins  = ParkingCenter.GetUpGradeNumberConsumption(parkingSpaceLevel);
        consumeEnterCarSpawnCoins = ParkingCenter.GetUpGradeEnterCarSpawnConsumption(enterCarSpawnLevel);
    }
コード例 #2
0
    /// <summary>
    /// 测试数值
    /// </summary>
    private void OnTestFormule()
    {
        for (int i = 1; i < 50; i++)
        {
            //var number01 = PlayerDataModule.GetAdditionExpect(i);
            //LogWarp.LogErrorFormat("测试数值  加成预期:  等级={0}   value={1}    ", i, number01);
            //var number02 = ParkingCenter.ParkingEnterCarSpawnExpectLevel(i);
            //LogWarp.LogErrorFormat("测试数值  来客速度期望等级:  等级={0}   value={1}    ", i, number02);
            //var number03 = ParkingCenter.ParkingSpaceExpectLevel(i);
            //LogWarp.LogErrorFormat("测试数值  停车位数期望等级:  等级={0}   value={1}    ", i, number03);
            var number04 = ParkingCenter.ParkingProfitExpectLevel(i);
            //LogWarp.LogErrorFormat("测试数值  利润提升期望等级等级:  等级={0}   value={1}    ", i, number04);


            //var number05 = LittleZooModule.GetAnimalExpectLevel(i);
            //LogWarp.LogErrorFormat("测试数值  动物期望等级:  等级={0}   value={1}    ", i, number05);


            //var number06 = LittleZooModule.GetAnimalUpLevelPriceFormula( i);
            //LogWarp.LogErrorFormat("测试数值  动物升级消耗价格:  等级={0}   value={1}    ", i, number06);
        }
    }
コード例 #3
0
    /// <summary>
    /// 控件显示赋值
    /// </summary>
    private void InitCompent()
    {
        //LogWarp.LogError(" 测试:   InitCompent   ");

        if (maxGrade >= parkingProfitMaxGrade)
        {
            maxGrade = parkingProfitMaxGrade;
        }

        lvText.text       = string.Format(GetL10NString("Ui_Text_2"), profitLevel.ToString());
        gradeSlider.value = AddPercentage(profitLevel - oldMaxGrade, maxGrade - oldMaxGrade);
        gradeText_2.text  = profitLevel.ToString() + "/" + maxGrade.ToString(); //最大等级上限
        //获取UI image =
        Config.itemCell itemCell = GradeSliderAwardImage();
        gradeSlider_Image.sprite = ResourceManager.LoadSpriteFromPrefab(itemCell.icon);

        gradeSlider_Text.text     = MinerBigInt.ToDisplay(itemCell.itemval);
        scoreNumTest.text         = starLevelReached + "/" + parkingCell.starsum;
        profitCoins_Text_2.text   = ParkingCenter.GetParkingProfit(profitLevel).ToString() + "%";//a.ToString("#0.0")
        profitCoins_Text_3.text   = "+" + ParkingCenter.GetParkingProfit(profitLevel, 1).ToString() + "%";
        profitCoins_LvText.text   = profitLevel.ToString();
        parkingSpace_Text2.text   = ParkingCenter.GetParkingSpace(parkingSpaceLevel).ToString();
        parkingSpace_Text3.text   = "+" + (ParkingCenter.GetParkingSpace(parkingSpaceLevel, 1)).ToString();
        parkingSpace_LvText.text  = parkingSpaceLevel.ToString();
        enterCarSpawn_Text2.text  = ParkingCenter.GetParkingEnterCarSpawn_UI(enterCarSpawnLevel).ToString("f2") + GetL10NString("Ui_Text_67");
        enterCarSpawn_Text3.text  = "+" + ParkingCenter.GetParkingEnterCarSpawn(enterCarSpawnLevel, 1).ToString("f2");
        enterCarSpawn_LvText.text = enterCarSpawnLevel.ToString();

        profitCoins_Button_NeedGoldNum.text    = MinerBigInt.ToDisplay(consumeProfitCoins).ToString();    //升级模式需要的金钱
        profitCoins_Button_ButtonLvUpText.text = GetL10NString("Ui_Text_7");

        parkingSpace_Button_NeedGoldNum.text    = MinerBigInt.ToDisplay(consumeParkingSpaceCoins).ToString();    //升级模式需要的金钱
        parkingSpace_Button_ButtonLvUpText.text = GetL10NString("Ui_Text_7");

        enterCarSpawn_Button_NeedGoldNum.text    = MinerBigInt.ToDisplay(consumeEnterCarSpawnCoins).ToString();    //升级模式需要的金钱
        enterCarSpawn_Button_ButtonLvUpText.text = GetL10NString("Ui_Text_7");

        SetGradeBool_Profit();
        SetGradeBool_ParkingSpace();
        SetGradeBool_EnterCarSpawn();
        if (profitLevel >= parkingProfitMaxGrade)
        {
            profitCoins_Button_NeedGoldNum.text    = GetL10NString("Ui_Text_47"); //升级模式需要的金钱
            profitCoins_Button_ButtonLvUpText.text = GetL10NString("Ui_Text_46"); //升级模式要升的级数
            lvText.text             = parkingCell.lvmax.ToString();               //等级text
            profitCoins_Text_3.text = GetL10NString("Ui_Text_47");                //价格变化标签
            SwitchButtonUnClickable(profitCoins_Button, false);
        }
        if (parkingSpaceLevel >= parkingSpaceMaxGrade)
        {
            parkingSpace_Button_NeedGoldNum.text    = GetL10NString("Ui_Text_47"); //升级模式需要的金钱
            parkingSpace_Button_ButtonLvUpText.text = GetL10NString("Ui_Text_46"); //升级模式要升的级数
            parkingSpace_Text3.text = GetL10NString("Ui_Text_47");                 //数量变化标签
            SwitchButtonUnClickable(parkingSpace_Button, false);
        }
        if (enterCarSpawnLevel >= parkingEnterCarSpawnMaxGrade)
        {
            enterCarSpawn_Button_NeedGoldNum.text    = GetL10NString("Ui_Text_47"); //升级模式需要的金钱
            enterCarSpawn_Button_ButtonLvUpText.text = GetL10NString("Ui_Text_46"); //升级模式要升的级数
            enterCarSpawn_Text3.text = GetL10NString("Ui_Text_47");                 //速度变化标签
            SwitchButtonUnClickable(enterCarSpawn_Button, false);
        }
        if (GlobalDataManager.GetInstance().playerData.playerZoo.isGuide)
        {
            UIGuidePage uIGuidePage = PageMgr.GetPage <UIGuidePage>();
            if (uIGuidePage == null)
            {
                string e = string.Format("新手引导界面  PageMgr.allPages里 UIGuidePage   为空");
                throw new System.Exception(e);
            }
            if (uIGuidePage.newBieGuild_step == NewBieGuild.Step_5)
            {
                SwitchButtonUnClickable(parkingSpace_Button, true);
                SwitchButtonUnClickable(profitCoins_Button, false);
                SwitchButtonUnClickable(enterCarSpawn_Button, false);
            }
            else if (uIGuidePage.newBieGuild_step == NewBieGuild.Step_8)
            {
                SwitchButtonUnClickable(parkingSpace_Button, false);
                SwitchButtonUnClickable(profitCoins_Button, false);
                SwitchButtonUnClickable(enterCarSpawn_Button, true);
            }
        }
        //else
        //{
        //    SwitchButtonUnclickable(parkingSpace_Button, true);
        //    SwitchButtonUnclickable(profitCoins_Button, true);
        //    SwitchButtonUnclickable(enterCarSpawn_Button, true);
        //}

        if (profitLevel >= parkingProfitMaxGrade)
        {
            lvText.text       = string.Format(GetL10NString("Ui_Text_2"), GetL10NString("Ui_Text_126"));;
            gradeSlider.value = 1;
            gradeText_2.text  = GetL10NString("Ui_Text_126"); //最大等级上限
            gradeSlider_IconBg.gameObject.SetActive(false);
            scoreNumTest.text = GetL10NString("Ui_Text_126");
        }
        else
        {
            gradeSlider_IconBg.gameObject.SetActive(true);
        }
    }