Ejemplo n.º 1
0
 void TenOrOne(int times)
 {
     _partType        = _partType;
     _currentUnitPart = _currentUnitPart;
     _units.TryGetValue(_currentUnitData.id, out _modelUnit);
     PBConnect_upgradeUnitPart.RESULT result = PBConnect_upgradeUnitPart.CheckUpgrade(_modelUnit.unitId, (int)_partType);
     if (result == PBConnect_upgradeUnitPart.RESULT.OK)
     {
         if (times == 1)
         {
             UpgradeOneUnitPart();
         }
         else
         {
             UpgradeTenUnitPart();
         }
     }
     else if (result == PBConnect_upgradeUnitPart.RESULT.LACK_ITEM1)
     {
         string str = "材料不足";
         UIHelper.ShowTextPromptPanel(this.gameObject, str);
     }
     else if (result == PBConnect_upgradeUnitPart.RESULT.LACK_ITEM2)
     {
         string str = "材料不足";
         UIHelper.ShowTextPromptPanel(this.gameObject, str);
     }
     else if (result == PBConnect_upgradeUnitPart.RESULT.LACK_MAIN_LEVEL)
     {
         string str = "车体系统等级不足,请升级!";
         UIHelper.ShowTextPromptPanel(this.gameObject, str);
     }
     else if (result == PBConnect_upgradeUnitPart.RESULT.LACK_PLAYER_LEVEL)
     {
         string str = "部件等级超过玩家等级!";
         UIHelper.ShowTextPromptPanel(this.gameObject, str);
     }
     else if (result == PBConnect_upgradeUnitPart.RESULT.MAX_LEVEL)
     {
         string str = "部件达到最大级别!";
         UIHelper.ShowTextPromptPanel(this.gameObject, str);
     }
     else if (result == PBConnect_upgradeUnitPart.RESULT.LACK_RESOURCE)
     {
         int[] resArr = Model_Helper.GetPlayerNeedBuyRes(_currentUnitPart.cost.costFood, _currentUnitPart.cost.costOil, _currentUnitPart.cost.costMetal, _currentUnitPart.cost.costRare);
         UIHelper.BuyResourcesUI(resArr, ResourcesBuyType.StrengThenPartType, times);
     }
     else if (result == PBConnect_upgradeUnitPart.RESULT.UNIT_LOCK)
     {
         string str = "UNIT_LOCK!";
         UIHelper.ShowTextPromptPanel(this.gameObject, str);
     }
 }
Ejemplo n.º 2
0
    void UpdataPromptPoint(TankDataManager.UnitData unitData)
    {
        if (unitData != null)
        {
            _units = InstancePlayer.instance.model_User.unlockUnits;
            _units.TryGetValue(_currentUnitData.id, out _modelUnit);

            _unitPart = _modelUnit.GetDataParts();
            int count = _unitPart.Length;
            for (int i = 0; i < count; i++)
            {
                PBConnect_upgradeUnitPart.RESULT result = PBConnect_upgradeUnitPart.CheckUpgrade(_modelUnit.unitId, i);
                if (result == PBConnect_upgradeUnitPart.RESULT.OK)
                {
                    _point_SpriteList[i].gameObject.SetActive(true);
                }
                else
                {
                    _point_SpriteList[i].gameObject.SetActive(false);
                }
            }
        }
    }
Ejemplo n.º 3
0
    void UpdataPromptPoint(TankDataManager.UnitData unitData)
    {
        if (unitData == null)
        {
            return;
        }

        DataUnitPart[] unitPart = _modelUnit.GetDataParts();
        bool           isshow   = false;

        int count = unitPart.Length;

        for (int i = 0; i < count; i++)
        {
            PBConnect_upgradeUnitPart.RESULT result = PBConnect_upgradeUnitPart.CheckUpgrade(_modelUnit.unitId, i);
            isshow = result == PBConnect_upgradeUnitPart.RESULT.OK ? true:false;
            if (isshow)
            {
                break;
            }
        }
        _redPoint.gameObject.SetActive(isshow);
    }