Ejemplo n.º 1
0
    public void Create(StaticShopVo staticShopVo)
    {
        this.staticShopVo = staticShopVo;
        switch (staticShopVo.type)
        {
        case 1:
            StaticItemVo staticItemVo = StaticDataPool.Instance.staticItemPool.GetStaticDataVo(staticShopVo.itemId);
            icon.sprite   = ResourceManager.Instance.GetItemIcon(staticItemVo.icon);
            itemName.text = staticItemVo.name;
            desc.text     = staticItemVo.desc;
            break;

        case 2:
            StaticEquipVo staticEquipVo = StaticDataPool.Instance.staticEquipPool.GetStaticDataVo(staticShopVo.itemId);
            icon.sprite   = ResourceManager.Instance.GetEquipIcon(staticEquipVo.icon);
            itemName.text = staticEquipVo.equipName;
            desc.text     = staticEquipVo.desc;
            break;

        case 3:
            StaticUnitVo staticUnitVo = StaticDataPool.Instance.staticUnitPool.GetStaticDataVo(staticShopVo.itemId);
            icon.sprite   = ResourceManager.Instance.GetCharactorIcon(staticUnitVo.icon);
            itemName.text = staticUnitVo.name;
            desc.text     = staticUnitVo.desc;
            break;
        }
        if (staticShopVo.priceType == 1)
        {
            price.text = "灵魂:" + staticShopVo.price;
        }
        else if (staticShopVo.priceType == 2)
        {
            price.text = "金币:" + staticShopVo.price;
        }
    }
Ejemplo n.º 2
0
    private void UpdateNow()
    {
        StaticUnitVo nowStaticVo = StaticDataPool.Instance.staticUnitPool.GetStaticDataVo(DataManager.Instance.servantModel.nowServant.unitId);

        nowServantIcon.sprite = ResourceManager.Instance.GetCharactorIcon(nowStaticVo.sprite);
        nowServantName.text   = nowStaticVo.name;
        nowServantLevel.text  = "Lv." + DataManager.Instance.servantModel.nowServant.level;
    }
Ejemplo n.º 3
0
    private void UpdateInfo(ServantVo vo)
    {
        StaticUnitVo staticUnitVo = StaticDataPool.Instance.staticUnitPool.GetStaticDataVo(nowVo.unitId);

        image.sprite = ResourceManager.Instance.GetCharactor(staticUnitVo.sprite);
        StaticUnitLevelVo nowLevelVo = StaticDataPool.Instance.staticUnitLevelPool.GetStaticDataVo(nowVo.unitId, nowVo.level);
        int nextLevel;

        if (nowLevelVo.level == 150)
        {
            nextLevel = 150;
            btnLevelUp.gameObject.SetActive(false);
        }
        else
        {
            nextLevel = nowLevelVo.level + 1;
        }
        {
            StaticUnitLevelVo nextVo = StaticDataPool.Instance.staticUnitLevelPool.GetStaticDataVo(nowLevelVo.unitId, nextLevel);
            roleName.text  = nowLevelVo.name;
            data1[0].text  = nowLevelVo.level.ToString();
            data1[1].text  = nextVo.needExp.ToString();
            data1[2].text  = ((int)(nowLevelVo.hp)).ToString();
            data1[3].text  = ((int)(nowLevelVo.mp)).ToString();
            data1[4].text  = ((int)(nowLevelVo.attackSmall)) + "~" + ((int)(nowLevelVo.attackBig));
            data1[5].text  = ((int)(nowLevelVo.magicAttack)).ToString();
            data1[6].text  = ((int)(nowLevelVo.defence)).ToString();
            data1[12].text = ((int)(nowLevelVo.magicDefance)).ToString();
            data1[7].text  = ((int)(nowLevelVo.critNum)).ToString();
            data1[8].text  = ((int)(nowLevelVo.duckNum)).ToString();
            data1[9].text  = (nowLevelVo.critDamage) * 100 + "%";
            data1[10].text = ((int)(nowLevelVo.speed)).ToString();
            data1[11].text = (nowLevelVo.magicRate) * 100 + "%";
            data1[13].text = ((int)(nowLevelVo.defanceRate)).ToString();

            data2[0].text  = nextLevel.ToString();
            data2[1].text  = "";
            data2[2].text  = ((int)(nextVo.hp)).ToString();
            data2[3].text  = ((int)(nextVo.mp)).ToString();
            data2[4].text  = ((int)(nextVo.attackSmall)) + "~" + ((int)(nowLevelVo.attackBig));
            data2[5].text  = ((int)(nextVo.magicAttack)).ToString();
            data2[6].text  = ((int)(nextVo.defence)).ToString();
            data2[12].text = ((int)(nextVo.magicDefance)).ToString();
            data2[7].text  = ((int)(nextVo.critNum)).ToString();
            data2[8].text  = ((int)(nextVo.duckNum)).ToString();
            data2[9].text  = (nextVo.critDamage) * 100 + "%";
            data2[10].text = ((int)(nextVo.speed)).ToString();
            data2[11].text = (nextVo.magicRate) * 100 + "%";
            data2[13].text = ((int)(nextVo.defanceRate)).ToString();
        }
        Tools.ClearChildFromParent(tsSkill);
        for (int i = 0; i < vo.skills.Count; i++)
        {
            GameObject obj = Tools.CreateGameObject("UI/ServantPanel/ServantSkillCell", tsSkill, new Vector3(-840f + 130 * i, -490f, 0), Vector3.one);
            obj.GetComponent <ServantSkillCell>().Create(vo.skills[i]);
        }
    }
Ejemplo n.º 4
0
 public void AddData(string[] lineArray)
 {
     for (int i = 1; i < lineArray.Length; i++)
     {
         lineArray[i] = lineArray[i].Replace("\r", "");
         string[]     strArray = lineArray[i].Split(","[0]);
         StaticUnitVo vo       = new StaticUnitVo(strArray);
         _datapool.Add(vo);
     }
 }
Ejemplo n.º 5
0
    private void OnRemoveConfirm(object obj)
    {
        DataManager.Instance.servantModel.Remove(nowVo);
        StaticUnitVo staticUnitVo = StaticDataPool.Instance.staticUnitPool.GetStaticDataVo(nowVo.unitId);

        UIManager.Instance.CreateTipPanel("你驱逐了" + staticUnitVo.name);
        nowVo = DataManager.Instance.servantModel.nowServant;
        nowId = nowVo.id;
        OnUpdate(null);
    }
Ejemplo n.º 6
0
    public void Create(ServantVo servantVo, CallBackFunctionWithObject callback)
    {
        this.servantVo = servantVo;
        this.callback  = callback;
        StaticUnitLevelVo staticUnitLevelVo = StaticDataPool.Instance.staticUnitLevelPool.GetStaticDataVo(servantVo.unitId, servantVo.level);
        StaticUnitVo      staticUnitVo      = StaticDataPool.Instance.staticUnitPool.GetStaticDataVo(servantVo.unitId);

        textName.text = staticUnitVo.name;
        desc.text     = staticUnitVo.desc;
        level.text    = "Lv." + servantVo.level;
    }
Ejemplo n.º 7
0
    private void BtnClick()
    {
        UIManager.Instance.CreateConfirmPanel("确定购买这个商品?", delegate(object obj)
        {
            bool enough = false;
            if (staticShopVo.priceType == 1)
            {
                enough = DataManager.Instance.roleVo.exp >= staticShopVo.price;
            }
            else if (staticShopVo.priceType == 2)
            {
                enough = DataManager.Instance.roleVo.exp >= staticShopVo.price;
            }
            if (enough)
            {
                switch (staticShopVo.type)
                {
                case 1:
                    StaticItemVo staticItemVo = StaticDataPool.Instance.staticItemPool.GetStaticDataVo(staticShopVo.itemId);
                    DataManager.Instance.itemModel.Add(staticItemVo);
                    UIManager.Instance.CreateTipPanel("购买了" + staticItemVo.name);
                    break;

                case 2:
                    StaticEquipVo staticEquipVo           = StaticDataPool.Instance.staticEquipPool.GetStaticDataVo(staticShopVo.itemId);
                    StaticEquipLevelVo staticEquipLevelVo = StaticDataPool.Instance.staticEquipLevelPool.GetStaticDataVo(staticEquipVo.equipId, 1);
                    DataManager.Instance.equipModel.Add(staticEquipLevelVo);
                    UIManager.Instance.CreateTipPanel("购买了" + staticEquipVo.equipName);
                    break;

                case 3:
                    StaticUnitVo staticUnitVo           = StaticDataPool.Instance.staticUnitPool.GetStaticDataVo(staticShopVo.itemId);
                    StaticUnitLevelVo staticUnitLevelVo = StaticDataPool.Instance.staticUnitLevelPool.GetStaticDataVo(staticUnitVo.unitId, 1);
                    DataManager.Instance.servantModel.Add(staticUnitLevelVo);
                    UIManager.Instance.CreateTipPanel("购买了" + staticUnitVo.name);
                    break;
                }
            }
            else
            {
                if (staticShopVo.priceType == 1)
                {
                    UIManager.Instance.CreateTipPanel("灵魂不足");
                }
                else if (staticShopVo.priceType == 2)
                {
                    UIManager.Instance.CreateTipPanel("灵魂不足");
                }
            }
        });
    }