Exemplo n.º 1
0
 public static void Show(BookData book, ExpAndSecretData expAndSecret)
 {
     if (Ctrl == null)
     {
         InstantiateView("Prefabs/UI/Role/BookDetailPanelView", "BookDetailPanelCtrl", 0, 0, UIModel.FrameCanvas.transform);
         Ctrl.Pop();
     }
     Ctrl.UpdateData(book, expAndSecret);
     Ctrl.RefreshView();
 }
Exemplo n.º 2
0
        /// <summary>
        /// 获取秘籍的修为和已领悟的诀要集合
        /// </summary>
        /// <returns>The book exp and secrets.</returns>
        public ExpAndSecretData GetBookExpAndSecrets(string bookId)
        {
            ExpAndSecretData data = new ExpAndSecretData();

            db = OpenDb();
            SqliteDataReader sqReader = db.ExecuteQuery("select ExpData, SecretsData from BookExpsTable where BookId = '" + bookId + "' and BelongToRoleId = '" + currentRoleId + "'");

            if (sqReader.Read())
            {
                data.Exp     = JsonManager.GetInstance().DeserializeObject <ExpData>(DESStatics.StringDecder(sqReader.GetString(sqReader.GetOrdinal("ExpData"))));
                data.Secrets = JsonManager.GetInstance().DeserializeObject <List <SecretData> >(DESStatics.StringDecder(sqReader.GetString(sqReader.GetOrdinal("SecretsData"))));
            }
            db.CloseSqlConnection();
            return(data);
        }
Exemplo n.º 3
0
 public void UpdateData(BookData book, ExpAndSecretData expAndSecret)
 {
     bookData = book;
     bookData.MakeJsonToModel();
     expAndSecretData = expAndSecret;
     info             = "";
     if (bookData.MaxHPPlus != 0)
     {
         info += string.Format("最大气血:{0}", (bookData.MaxHPPlus > 0 ? "+" : "") + bookData.MaxHPPlus.ToString());
     }
     if (bookData.PhysicsDefensePlus != 0)
     {
         info += info == "" ? "" : ", ";
         info += string.Format("外防:{0}", (bookData.PhysicsDefensePlus > 0 ? "+" : "") + bookData.PhysicsDefensePlus.ToString());
     }
     if (bookData.MagicAttackPlus != 0)
     {
         info += info == "" ? "" : ", ";
         info += string.Format("内功:{0}", (bookData.MagicAttackPlus > 0 ? "+" : "") + bookData.MagicAttackPlus.ToString());
     }
     if (bookData.MagicDefensePlus != 0)
     {
         info += info == "" ? "" : ", ";
         info += string.Format("内防:{0}", (bookData.MagicDefensePlus > 0 ? "+" : "") + bookData.MagicDefensePlus.ToString());
     }
     if (bookData.DodgePlus != 0)
     {
         info += info == "" ? "" : ", ";
         info += string.Format("轻功:{0}", (bookData.DodgePlus > 0 ? "+" : "") + bookData.DodgePlus.ToString());
     }
     if (bookData.HurtCutRatePlus != 0)
     {
         info += info == "" ? "" : ", ";
         info += string.Format("减伤:{0}%", (bookData.HurtCutRatePlus > 0 ? "+" : "") + (bookData.HurtCutRatePlus * 100).ToString());
     }
     if (bookData.DrugResistance > 0)
     {
         info += info == "" ? "" : ", ";
         info += string.Format("抗中毒:抵消{0}秒", bookData.DrugResistance);
     }
     if (bookData.DisarmResistance > 0)
     {
         info += info == "" ? "" : ", ";
         info += string.Format("抗缴械:抵消{0}秒", bookData.DisarmResistance);
     }
     if (bookData.CanNotMoveResistance > 0)
     {
         info += info == "" ? "" : ", ";
         info += string.Format("抗定身:抵消{0}秒", bookData.CanNotMoveResistance);
     }
     if (bookData.VertigoResistance > 0)
     {
         info += info == "" ? "" : ", ";
         info += string.Format("抗眩晕:抵消{0}秒", bookData.VertigoResistance);
     }
     if (bookData.SlowResistance > 0)
     {
         info += info == "" ? "" : ", ";
         info += string.Format("抗迟缓:抵消{0}秒", bookData.SlowResistance);
     }
     if (bookData.ChaosResistance > 0)
     {
         info += info == "" ? "" : ", ";
         info += string.Format("抗混乱:抵消{0}秒", bookData.ChaosResistance);
     }
     secretInfo = "";
     if (expAndSecretData.Secrets.Count > 0)
     {
         for (int i = 0, len = expAndSecretData.Secrets.Count; i < len; i++)
         {
             secretInfo += expAndSecretData.Secrets[i].GetDesc();
             if (i < len - 1)
             {
                 secretInfo += ", ";
             }
         }
     }
 }