Merge branch 'master' into 【1.4】聚魂功能
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Wednesday, January 17, 2018 |
| | | // [ Date ]: Wednesday, December 19, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using UnityEngine; |
| | |
| | | |
| | | public partial class ResourcesBackConfig : ConfigBase { |
| | | |
| | | public int ID { get ; private set ; } |
| | | public int RelatedID { get ; private set ; } |
| | | public int CanBackTimes { get ; private set ; } |
| | | public int NormalCostJade { get ; private set ; } |
| | | public int VipCostJade { get ; private set ; } |
| | | public string JadeReward { get ; private set; } |
| | | public int CostCopper { get ; private set ; } |
| | | public string CopperReward { get ; private set; } |
| | | public int ID { get ; private set ; }
|
| | | public int RelatedID { get ; private set ; }
|
| | | public int CanBackTimes { get ; private set ; }
|
| | | public int NormalCostJade { get ; private set ; }
|
| | | public int VipCostJade { get ; private set ; }
|
| | | public string JadeReward { get ; private set; } |
| | | public int CostCopper { get ; private set ; }
|
| | | public string CopperReward { get ; private set; } |
| | | public string JobItem { get ; private set; } |
| | | public string RewardList { get ; private set; } |
| | | |
| | | public override string getKey() |
| | |
| | | public override void Parse() { |
| | | try |
| | | { |
| | | ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; |
| | | |
| | | RelatedID=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; |
| | | |
| | | CanBackTimes=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; |
| | | |
| | | NormalCostJade=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; |
| | | |
| | | VipCostJade=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0; |
| | | |
| | | JadeReward = rawContents[5].Trim(); |
| | | |
| | | CostCopper=IsNumeric(rawContents[6]) ? int.Parse(rawContents[6]):0; |
| | | |
| | | CopperReward = rawContents[7].Trim(); |
| | | |
| | | RewardList = rawContents[8].Trim(); |
| | | ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; |
| | | |
| | | RelatedID=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; |
| | | |
| | | CanBackTimes=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; |
| | | |
| | | NormalCostJade=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; |
| | | |
| | | VipCostJade=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0; |
| | | |
| | | JadeReward = rawContents[5].Trim();
|
| | | |
| | | CostCopper=IsNumeric(rawContents[6]) ? int.Parse(rawContents[6]):0; |
| | | |
| | | CopperReward = rawContents[7].Trim();
|
| | | |
| | | JobItem = rawContents[8].Trim();
|
| | | |
| | | RewardList = rawContents[9].Trim(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 2fdee2899ae3d5d469aabc2daa6c744a |
| | | timeCreated: 1516157851 |
| | | timeCreated: 1545210998 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | extersion.ComboDamPer = (int)value;
|
| | | break;
|
| | | case PlayerDataRefresh.MaxProDef:
|
| | | extersion.MaxProDef = (int)value;
|
| | | extersion.MaxProDef = (int)value;
|
| | | break;
|
| | | case PlayerDataRefresh.ComboDamRate:
|
| | | extersion.ComboDamPerRate = (int)value;
|
| | |
| | | break;
|
| | | case PlayerDataRefresh.PlayerPKState:
|
| | | extersion.pkState = (int)value;
|
| | | if (hero != null)
|
| | | if (baseData.MapID != 31220)
|
| | | {
|
| | | if (value == 1)
|
| | | if (hero != null)
|
| | | {
|
| | | if (MapArea.IsOutMapArea(hero.CurMapArea, MapArea.E_Type.Neutral))
|
| | | if (value == 1)
|
| | | {
|
| | | hero.SwitchGrayName(true);
|
| | | if (MapArea.IsOutMapArea(hero.CurMapArea, MapArea.E_Type.Neutral))
|
| | | {
|
| | | hero.SwitchGrayName(true);
|
| | | }
|
| | | }
|
| | | }
|
| | | else if (value == 0)
|
| | | {
|
| | | hero.SwitchGrayName(false);
|
| | | if (StatusMgr.Instance.IsExist(PlayerId, StatusMgr.Instance.redNameBuffID))
|
| | | else if (value == 0)
|
| | | {
|
| | | hero.SwitchRedName(true);
|
| | | hero.SwitchGrayName(false);
|
| | | if (StatusMgr.Instance.IsExist(PlayerId, StatusMgr.Instance.redNameBuffID))
|
| | | {
|
| | | hero.SwitchRedName(true);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | using UnityEngine.Events;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using System.IO;
|
| | |
|
| | | [XLua.LuaCallCSharp]
|
| | | public class SDKUtility : SingletonMonobehaviour<SDKUtility>
|
| | |
| | |
|
| | | public void InstallAPK(string path)
|
| | | {
|
| | | if (Application.platform == RuntimePlatform.Android)
|
| | | {
|
| | | var dllPath1 = ResourcesPath.Instance.ExternalStorePath + "Assembly-CSharp-firstpass.dll";
|
| | | if (File.Exists(dllPath1))
|
| | | {
|
| | | File.Delete(dllPath1);
|
| | | }
|
| | |
|
| | | var dllPath2 = ResourcesPath.Instance.ExternalStorePath + "Assembly-CSharp.dll";
|
| | | if (File.Exists(dllPath2))
|
| | | {
|
| | | File.Delete(dllPath2);
|
| | | }
|
| | | }
|
| | |
|
| | | m_Json.Clear();
|
| | | m_Json["code"] = CodeU2A.InstallAPK;
|
| | | m_Json["path"] = path;
|
| | |
| | | {
|
| | | timer -= 1f;
|
| | | m_ProgressSlider.value = DownLoadAndDiscompressTask.Instance.progress;
|
| | | var downLoadedSize = ((float)RemoteFile.TotalDownloadedSize / DownLoadAndDiscompressTask.BYTE_PER_MILLIONBYTE).ToString("f1");
|
| | | var totalSize = ((float)DownLoadAndDiscompressTask.Instance.totalSize / DownLoadAndDiscompressTask.BYTE_PER_MILLIONBYTE).ToString("f1");
|
| | | m_Progress.text = Language.GetFromLocal(13, StringUtility.Contact(downLoadedSize, "M", "/", totalSize, "M"));
|
| | | var totalSizeString = ((float)DownLoadAndDiscompressTask.Instance.totalSize / DownLoadAndDiscompressTask.BYTE_PER_MILLIONBYTE).ToString("f1");
|
| | | var downLoadedSize = Mathf.Clamp(RemoteFile.TotalDownloadedSize, 0, DownLoadAndDiscompressTask.Instance.totalSize - 1);
|
| | | var downLoadedSizeString = ((float)downLoadedSize / DownLoadAndDiscompressTask.BYTE_PER_MILLIONBYTE).ToString("f1");
|
| | |
|
| | | m_Progress.text = Language.GetFromLocal(13, StringUtility.Contact(downLoadedSizeString, "M", "/", totalSizeString, "M"));
|
| | | }
|
| | |
|
| | | if (Time.frameCount % 2 == 0)
|
| | | {
|
| | | m_DownLoadSpeed.text = RemoteFile.DownloadSpeed;
|
| | | if (RemoteFile.TotalDownloadedSize >= DownLoadAndDiscompressTask.Instance.totalSize)
|
| | | {
|
| | | m_DownLoadSpeed.text = StringUtility.Contact(UnityEngine.Random.Range(5, 10), "KB/S");
|
| | | }
|
| | | else
|
| | | {
|
| | | m_DownLoadSpeed.text = RemoteFile.DownloadSpeed;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | timer -= 1f;
|
| | | m_ProgressSlider.value = InGameDownLoad.Instance.progress;
|
| | | var downLoadedSize = ((float)InGameDownLoad.Instance.showDownLoadedSize / InGameDownLoad.BYTE_PER_MILLIONBYTE).ToString("f1");
|
| | | var totalSize = ((float)InGameDownLoad.Instance.showTotalSize / InGameDownLoad.BYTE_PER_MILLIONBYTE).ToString("f1");
|
| | | m_Progress.text = Language.GetFromLocal(13, StringUtility.Contact(downLoadedSize, "M", "/", totalSize, "M"));
|
| | | var totalSizeString = ((float)InGameDownLoad.Instance.showTotalSize / InGameDownLoad.BYTE_PER_MILLIONBYTE).ToString("f1");
|
| | | var downLoadedSize = Mathf.Clamp(InGameDownLoad.Instance.showDownLoadedSize, 0, InGameDownLoad.Instance.showTotalSize - 1);
|
| | | var downLoadedSizeString = ((float)downLoadedSize / InGameDownLoad.BYTE_PER_MILLIONBYTE).ToString("f1");
|
| | | m_Progress.text = Language.GetFromLocal(13, StringUtility.Contact(downLoadedSizeString, "M", "/", totalSizeString, "M"));
|
| | | }
|
| | |
|
| | | if (Time.frameCount % 2 == 0)
|
| | | {
|
| | | m_DownLoadSpeed.text = RemoteFile.DownloadSpeed;
|
| | | if (InGameDownLoad.Instance.showDownLoadedSize >= InGameDownLoad.Instance.showTotalSize)
|
| | | {
|
| | | m_DownLoadSpeed.text = StringUtility.Contact(UnityEngine.Random.Range(5, 10), "KB/S");
|
| | | }
|
| | | else
|
| | | {
|
| | | m_DownLoadSpeed.text = RemoteFile.DownloadSpeed;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | m_ProgressSlider.value = VersionUtility.Instance.progress;
|
| | |
|
| | | var downLoadedSize = ((float)RemoteFile.TotalDownloadedSize / DownLoadAndDiscompressTask.BYTE_PER_MILLIONBYTE).ToString("f1");
|
| | | var totalSize = ((float)VersionUtility.Instance.GetApkSize() * 1024 / DownLoadAndDiscompressTask.BYTE_PER_MILLIONBYTE).ToString("f1");
|
| | | m_Progress.text = Language.GetFromLocal(13, StringUtility.Contact(downLoadedSize, "M", "/", totalSize, "M"));
|
| | | var totalSizeString = ((float)VersionUtility.Instance.GetApkSize() * 1024 / DownLoadAndDiscompressTask.BYTE_PER_MILLIONBYTE).ToString("f1");
|
| | | var downLoadedSize = Mathf.Clamp(RemoteFile.TotalDownloadedSize, 0, VersionUtility.Instance.GetApkSize());
|
| | | var downLoadedSizeString = ((float)downLoadedSize / DownLoadAndDiscompressTask.BYTE_PER_MILLIONBYTE).ToString("f1");
|
| | |
|
| | |
|
| | | m_Progress.text = StringUtility.Contact((VersionUtility.Instance.progress * 100).ToString("f0"), "%");
|
| | | m_Progress.text = Language.GetFromLocal(13, StringUtility.Contact(downLoadedSizeString, "M", "/", totalSizeString, "M"));
|
| | | }
|
| | |
|
| | | if (Time.frameCount % 2 == 0)
|
| | | {
|
| | | m_DownLoadSpeed.text = RemoteFile.DownloadSpeed;
|
| | | if (RemoteFile.TotalDownloadedSize >= VersionUtility.Instance.GetApkSize())
|
| | | {
|
| | | m_DownLoadSpeed.text = StringUtility.Contact(UnityEngine.Random.Range(5, 10), "KB/S");
|
| | | }
|
| | | else
|
| | | {
|
| | | m_DownLoadSpeed.text = RemoteFile.DownloadSpeed;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | step = Step.Completed;
|
| | | WindowCenter.Instance.CloseImmediately<VersionUpdateWin>();
|
| | |
|
| | | if (Application.platform == RuntimePlatform.Android)
|
| | | {
|
| | | var dllPath1 = ResourcesPath.Instance.ExternalStorePath + "Assembly-CSharp-firstpass.dll";
|
| | | if (File.Exists(dllPath1))
|
| | | {
|
| | | File.Delete(dllPath1);
|
| | | }
|
| | |
|
| | | var dllPath2 = ResourcesPath.Instance.ExternalStorePath + "Assembly-CSharp.dll";
|
| | | if (File.Exists(dllPath2))
|
| | | {
|
| | | File.Delete(dllPath2);
|
| | | }
|
| | | }
|
| | |
|
| | | SDKUtility.Instance.InstallAPK(GetApkLocalUrl());
|
| | | }
|
| | | else
|
| | |
| | | Button Btn1 = m_Coent.GetChild(type).Find("Image").GetComponent<Button>();
|
| | | Image Image_2 = m_Coent.GetChild(type).Find("Image").GetComponent<Image>();
|
| | | int ItemId = resourcesBackClass.JadeReward.item[j].ItemID;
|
| | | ItemId = ReplaceItemID(ItemId, resourcesBackClass);//根据职业替换物品ID
|
| | | string itemIcon = Config.Instance.Get<ItemConfig>(ItemId).IconKey;
|
| | | Icon1.SetSprite(itemIcon);
|
| | | Number1.text = packModelInterface.OnChangeCoinsUnit((ulong)ItemCount);
|
| | |
| | | Button Btn1 = m_Coent.GetChild(type).Find("Image").GetComponent<Button>();
|
| | | Image Image_2 = m_Coent.GetChild(type).Find("Image").GetComponent<Image>();
|
| | | int ItemId = resourcesBackClass.CopperReward.item[j].ItemID;
|
| | | ItemId = ReplaceItemID(ItemId, resourcesBackClass);//根据职业替换物品ID
|
| | | string itemIcon = Config.Instance.Get<ItemConfig>(ItemId).IconKey;
|
| | | var Item_2 = Config.Instance.Get<ItemConfig>(ItemId);
|
| | | Image_2.SetItemBackGround(Item_2.ItemColor);
|
| | |
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | }
|
| | | }
|
| | | private int ReplaceItemID(int itemID, ResourcesBackClass resourcesBackClass)
|
| | | {
|
| | | int ItemID = itemID;
|
| | | if (resourcesBackClass.ReplaceItemID.Contains(itemID))
|
| | | {
|
| | | int job = PlayerDatas.Instance.baseData.Job;
|
| | | if (job <= resourcesBackClass.ReplaceItemID.Count)
|
| | | {
|
| | | ItemID = resourcesBackClass.ReplaceItemID[(job - 1)];
|
| | | }
|
| | | }
|
| | | return ItemID;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | public ulong TjgExp;//经验(脱机挂)
|
| | | public int Times;//可找回时间
|
| | | public string DeadTime;//死亡时间
|
| | | public List<int> ReplaceItemID;//替换的物品ID
|
| | | }
|
| | | public class RewardRecovery
|
| | | {
|
| | |
| | | resourcesBackClass.DeadTime = BeKilledTime(TimeUtility.GetTime(vNetData.DeadTime));
|
| | | resourcesBackClass.TjgExp = Experience(vNetData.Exp, vNetData.Exp1);
|
| | | resourcesBackClass.RewardList = ConfigParse.GetMultipleStr(configRB.RewardList);
|
| | | resourcesBackClass.ReplaceItemID = ReplaceItemID(configRB.JobItem);
|
| | | ResourcesBackDic.Add(id, resourcesBackClass);
|
| | | }
|
| | | ResourcesBackRedPoint();
|
| | |
| | | resourcesBackClass.CostCopper = configRB.CostCopper;
|
| | | resourcesBackClass.CopperReward = LitJson.JsonMapper.ToObject<RewardRecovery>(configRB.CopperReward);
|
| | | resourcesBackClass.RewardList = ConfigParse.GetMultipleStr(configRB.RewardList);
|
| | | resourcesBackClass.ReplaceItemID = ReplaceItemID(configRB.JobItem);
|
| | | ResourcesBackDic.Add(id, resourcesBackClass);
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | private List<int> ReplaceItemID(string str)
|
| | | {
|
| | | List<int> list = new List<int>();
|
| | | if (str == string.Empty)
|
| | | {
|
| | | return list;
|
| | | }
|
| | | var _jsonData = LitJson.JsonMapper.ToObject(str);
|
| | | for (int i = 0; i < _jsonData.Count; i++)
|
| | | {
|
| | | list.Add(int.Parse(_jsonData[i][0].ToString()));
|
| | | list.Add(int.Parse(_jsonData[i][1].ToString()));
|
| | | }
|
| | | return list;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|