Example #1
0
 public void deblockModel(int id)
 {
     m_bossTag.bossUse[id - 1] = true;
     RoleProTable.rolePro tmpPro = RoleProTable.GetFromRoleID(id);
     m_roleData.bosshp[id - 1] = tmpPro.MaxHp;
     saveModelData();
 }
Example #2
0
    private void initData()
    {
        uiRole = new List <roleInfo>();
        int nCount = 0;

        gameDataMgr.bossTag tmpTag = gameDataMgr.gameData().m_bossTag;
        for (int i = 0; i < tmpTag.bossUse.Length; i++)
        {
            if (tmpTag.bossUse[i] == true)
            {
                roleInfo tmpInfo = new roleInfo();

                tmpInfo.hp = gameDataMgr.gameData().m_roleData.bosshp[i];

                RoleProTable.rolePro tmpPro = RoleProTable.GetFromRoleID(i);
                tmpInfo.maxHp  = tmpPro.MaxHp;
                tmpInfo.roleID = tmpPro.ID;

                ShopItemTable.shopElements tmpEle = ShopItemTable.Get(i);
                //RoleInfoTable.roleElements tmpEle = RoleInfoTable.Get(i+1);
                tmpInfo.picName = tmpEle.Pic;

                uiRole.Add(tmpInfo);
                nCount++;
            }
        }

        //OKBtnClick
        btnOK.onClick.AddListener(delegate()
        {
            this.OKBtnClick();
        });
    }
Example #3
0
    /*
     * private GameObject getHpPoint(Transform parent)
     * {
     *  GameObject res = parent.gameObject;
     *  int nCount = parent.childCount;
     *  for (int i = 0; i < nCount; i++)
     *  {
     *      Transform tmp = parent.GetChild(i);
     *      if (tmp.name == "HpPoint")
     *      {
     *          res = tmp.gameObject;
     *          break;
     *      }
     *  }
     *
     *  return res;
     * }
     */
    private void addRoleProperty(GameObject obj, int roleID)
    {
        roleProperty pro = obj.AddComponent <roleProperty>();

        RoleProTable.rolePro tmpPro = RoleProTable.GetFromRoleID(roleID);
        pro.roleSort = 1;
        pro.hpMax    = tmpPro.MaxHp;
        pro.hp       = gameDataMgr.gameData().m_roleData.bosshp[roleID];
        pro.attack   = tmpPro.Atk;
        pro.def      = tmpPro.Def;
        pro.element  = tmpPro.Ele;
        pro.roleID   = roleID;
        pro.level    = 1;
        pro.speed    = 0.5f;
        //  pro.turnTime = 0.0f;
        pro.HpUIPoint = GameObjCommon.getObjNode(obj.transform, "HpPoint");
    }
Example #4
0
    //怪物属性
    private roleProperty addRolePro(GameObject obj, int roleID)
    {
        roleProperty pro = obj.AddComponent <roleProperty>();

        RoleProTable.rolePro tmpPro = RoleProTable.GetFromRoleID(roleID);
        pro.roleSort  = 0;
        pro.hpMax     = tmpPro.MaxHp;
        pro.hp        = pro.hpMax;
        pro.attack    = tmpPro.Atk;
        pro.def       = tmpPro.Def;
        pro.element   = tmpPro.Ele;
        pro.roleID    = roleID;
        pro.level     = 1;
        pro.speed     = 0.5f;
        pro.HpUIPoint = GameObjCommon.getObjNode(obj.transform, "HpPoint");

        return(pro);
    }
Example #5
0
    private const string csElement6 = "暗";  //purple,darkblue

    public void showData(int pRoleID, int pCost, Action pEvent)
    {
        //roleID用于展现UI
        callEvent = pEvent;
        RoleProTable.rolePro tmpPro = RoleProTable.GetFromRoleID(pRoleID);
        refreshData(tmpPro);

        //RoleInfoTable.roleElements tmpEle = RoleInfoTable.Get(pRoleID);
        //monText.text = tmpEle.Name;
        string tmpEleName = "";
        CSVRow lRow       = RoleInfoTable.GetRowFromID(pRoleID);

        tmpEleName = lRow.GetString("Name");
        //RoleInfoTable.GetKeyString("ID", pRoleID.ToString(), "Name", out tmpEleName);
        monText.text = tmpEleName;

        roleID = pRoleID;
        cost   = pCost;
        btnBuySet();
    }