Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | EditorGUILayout.EndHorizontal();
|
| | |
|
| | | EditorGUILayout.Space();
|
| | |
|
| | | EditorGUILayout.Space();
|
| | | EditorGUILayout.Space();
|
| | | #if UNITY_ANDROID
|
| | | GUILayout.BeginHorizontal();
|
| | | EditorGUILayout.TextField("Apk Output Path", ApkOutputPath);
|
| | |
| | |
|
| | | EditorGUILayout.Space();
|
| | |
|
| | | ClientPackage.auditOutTime = EditorGUILayout.TextField("AppStore Review OutTime",ClientPackage.auditOutTime, GUILayout.Height(20));
|
| | | #if UNITY_IOS
|
| | | ClientPackage.auditOutTime = EditorGUILayout.TextField("AppStore OutTime", ClientPackage.auditOutTime, GUILayout.Height(20));
|
| | | EditorGUILayout.Space();
|
| | | #endif
|
| | | GUILayout.BeginHorizontal();
|
| | | ClientPackage.AssetPrior = EditorGUILayout.IntField("AssetPrior", ClientPackage.AssetPrior, GUILayout.Height(50), GUILayout.Width(250));
|
| | | publishers = EditorGUILayout.TextField("Publishers", publishers, GUILayout.Height(50));
|
| | | GUILayout.EndHorizontal();
|
| | |
|
| | | EditorGUILayout.Space();
|
| | | GUILayout.BeginHorizontal();
|
| | |
|
| | | ClientPackage.obfuscatorEnabled = EditorGUILayout.Toggle("obfuscator enable ", ClientPackage.obfuscatorEnabled);
|
| | | ClientPackage.obfuscatorEnabled = EditorGUILayout.Toggle("Obfuscator Enable ", ClientPackage.obfuscatorEnabled, GUILayout.Width(250));
|
| | |
|
| | | #if UNITY_ANDROID
|
| | | if (GUILayout.Button("APK"))
|
| | |
| | | #if UNITY_ANDROID && !UNITY_EDITOR
|
| | | if (!SDKUtility.builtinAssetCopyFinished)
|
| | | {
|
| | | SDKUtility.Instance.CopyOneAsset("builtin_assetbundle");
|
| | | SDKUtility.Instance.CopyOneAsset("builtin_assetbundle.manifest");
|
| | | SDKUtility.Instance.CopyOneAsset("builtin/music");
|
| | | SDKUtility.Instance.CopyOneAsset("builtin/music.manifest");
|
| | | SDKUtility.Instance.CopyOneAsset("builtin/prefabs");
|
| | | SDKUtility.Instance.CopyOneAsset("builtin/prefabs.manifest");
|
| | | SDKUtility.Instance.CopyOneAsset("builtin/sprite");
|
| | | SDKUtility.Instance.CopyOneAsset("builtin/sprite.manifest");
|
| | | SDKUtility.Instance.CopyOneAsset("config/Contact.txt");
|
| | | SDKUtility.Instance.CopyOneAsset("config/HelpInfo.txt");
|
| | | SDKUtility.Instance.CopyOneAsset("config/PriorBundle.txt");
|
| | | SDKUtility.Instance.CopyOneAsset("config/PriorLanguage.txt");
|
| | | SDKUtility.Instance.CopyOneAsset("builtin_assetbundle.7z");
|
| | | SDKUtility.Instance.CopyOneAsset("builtin_assetbundle.manifest.7z");
|
| | | SDKUtility.Instance.CopyOneAsset("builtin/music.7z");
|
| | | SDKUtility.Instance.CopyOneAsset("builtin/music.manifest.7z");
|
| | | SDKUtility.Instance.CopyOneAsset("builtin/prefabs.7z");
|
| | | SDKUtility.Instance.CopyOneAsset("builtin/prefabs.manifest.7z");
|
| | | SDKUtility.Instance.CopyOneAsset("builtin/sprite.7z");
|
| | | SDKUtility.Instance.CopyOneAsset("builtin/sprite.manifest.7z");
|
| | | SDKUtility.Instance.CopyOneAsset("config/Contact.txt.7z");
|
| | | SDKUtility.Instance.CopyOneAsset("config/HelpInfo.txt.7z");
|
| | | SDKUtility.Instance.CopyOneAsset("config/PriorBundle.txt.7z");
|
| | | SDKUtility.Instance.CopyOneAsset("config/PriorLanguage.txt.7z");
|
| | |
|
| | | AssetDeCompressTask.Decompress(ResourcesPath.Instance.ExternalStorePath);
|
| | | LocalSave.SetString("BuiltInAssetCopyCompleted_Android", VersionConfig.Get().version);
|
| | | }
|
| | | #endif
|
| | |
| | | progress = Mathf.Clamp(progressBuf + timer / duration * 0.3f, progressBuf, progressBuf + 0.3f);
|
| | | yield return null;
|
| | | }
|
| | |
|
| | | progressBuf = progress;
|
| | | var decompressProgress = AssetDeCompressTask.DecompressAync(ResourcesPath.Instance.ExternalStorePath);
|
| | | while (!decompressProgress.done)
|
| | | {
|
| | | progress = progressBuf + decompressProgress.progress * 0.1f;
|
| | | yield return null;
|
| | | }
|
| | | }
|
| | | break;
|
| | | case InstalledAsset.NullAsset:
|
| | |
| | | DirtyNameConfig.Init();
|
| | | NewBieCenter.Instance.Init();
|
| | |
|
| | | if (Application.isMobilePlatform)
|
| | | {
|
| | | AssetDeCompressTask.Delete7zFiles(ResourcesPath.Instance.ExternalStorePath);
|
| | | }
|
| | |
|
| | | DebugEx.LogFormat("解析配置表耗时:{0}", Time.time - startTime);
|
| | | }
|
| | | catch (Exception ex)
|
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Wednesday, July 25, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using UnityEngine; |
| | | using System; |
| | | |
| | | namespace TableConfig { |
| | | |
| | | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Thursday, November 01, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using UnityEngine;
|
| | | using System;
|
| | |
|
| | | namespace TableConfig {
|
| | |
|
| | | |
| | | public partial class PriorBundleConfig : ConfigBase {
|
| | |
|
| | | public int id { get ; private set ; }
|
| | | public string AssetABName { get ; private set; }
|
| | | public int AssetType { get ; private set ; }
|
| | | |
| | | public int Prior { get ; private set ; }
|
| | |
|
| | | public override string getKey()
|
| | | {
|
| | | return id.ToString();
|
| | | } |
| | | |
| | | public override void Parse() { |
| | | }
|
| | |
|
| | | public override void Parse() {
|
| | | try
|
| | | {
|
| | | id=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0;
|
| | |
| | | AssetABName = rawContents[1].Trim();
|
| | |
|
| | | AssetType=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0;
|
| | | |
| | | Prior=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; |
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | DebugEx.Log(ex);
|
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | }
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
| | | fileFormatVersion: 2 |
| | | guid: 949b242ddea04fe418ea4647b082dcb7 |
| | | timeCreated: 1532484855 |
| | | timeCreated: 1541037151 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | {
|
| | | public partial class PriorBundleConfig : ConfigBase
|
| | | {
|
| | | static List<string> m_Audios;
|
| | | public static List<string> audios {
|
| | | get {
|
| | | if (!inited)
|
| | | {
|
| | | Init();
|
| | | }
|
| | | return m_Audios;
|
| | | }
|
| | | }
|
| | |
|
| | | static List<string> m_Effects;
|
| | | public static List<string> effects {
|
| | | get {
|
| | | if (!inited)
|
| | | {
|
| | | Init();
|
| | | }
|
| | | return m_Effects;
|
| | | }
|
| | | }
|
| | |
|
| | | static List<string> m_Scenes;
|
| | | public static List<string> scenes {
|
| | | get {
|
| | | if (!inited)
|
| | | {
|
| | | Init();
|
| | | }
|
| | | return m_Scenes;
|
| | | }
|
| | | }
|
| | |
|
| | | static List<string> m_Mobs;
|
| | | public static List<string> mobs {
|
| | | get {
|
| | | if (!inited)
|
| | | {
|
| | | Init();
|
| | | }
|
| | | return m_Mobs;
|
| | | }
|
| | | }
|
| | | static Dictionary<string, PriorBundleConfig> m_Audios = new Dictionary<string, PriorBundleConfig>();
|
| | | static Dictionary<string, PriorBundleConfig> m_Effects = new Dictionary<string, PriorBundleConfig>();
|
| | | static Dictionary<string, PriorBundleConfig> m_Scenes = new Dictionary<string, PriorBundleConfig>();
|
| | | static Dictionary<string, PriorBundleConfig> m_Mobs = new Dictionary<string, PriorBundleConfig>();
|
| | |
|
| | | static bool inited = false;
|
| | |
|
| | | static void Init()
|
| | | {
|
| | | var values = Config.Instance.GetAllValues<PriorBundleConfig>();
|
| | | m_Audios = new List<string>();
|
| | | m_Effects = new List<string>();
|
| | | m_Scenes = new List<string>();
|
| | | m_Mobs = new List<string>();
|
| | |
|
| | | foreach (var value in values)
|
| | | {
|
| | | switch (value.AssetType)
|
| | | {
|
| | | case 1:
|
| | | m_Scenes.Add(value.AssetABName.ToLower());
|
| | | m_Scenes[value.AssetABName.ToLower()] = value;
|
| | | break;
|
| | | case 2:
|
| | | m_Mobs.Add(value.AssetABName.ToLower());
|
| | | m_Mobs[value.AssetABName.ToLower()] = value;
|
| | | break;
|
| | | case 3:
|
| | | m_Audios.Add(value.AssetABName.ToLower());
|
| | | m_Audios[value.AssetABName.ToLower()] = value;
|
| | | break;
|
| | | case 4:
|
| | | m_Effects.Add(value.AssetABName.ToLower());
|
| | | m_Effects[value.AssetABName.ToLower()] = value;
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | inited = true;
|
| | | }
|
| | |
|
| | | public static int GetAssetPrior(AssetVersion.AssetCategory category, string fileName)
|
| | | {
|
| | | if (!inited) |
| | | { |
| | | Init(); |
| | | }
|
| | | fileName = fileName.ToLower();
|
| | | switch (category) |
| | | {
|
| | | case AssetVersion.AssetCategory.Scene:
|
| | | return m_Scenes.ContainsKey(fileName) ? m_Scenes[fileName].Prior : 100; |
| | | case AssetVersion.AssetCategory.Mob:
|
| | | return m_Mobs.ContainsKey(fileName) ? m_Mobs[fileName].Prior : 101;
|
| | | case AssetVersion.AssetCategory.Effect:
|
| | | return m_Effects.ContainsKey(fileName) ? m_Effects[fileName].Prior : 102;
|
| | | case AssetVersion.AssetCategory.Audio:
|
| | | return m_Audios.ContainsKey(fileName) ? m_Audios[fileName].Prior : 103;
|
| | | case AssetVersion.AssetCategory.UI:
|
| | | if (fileName == "loadingbg") |
| | | { |
| | | return 3; |
| | | }
|
| | | else
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | default:
|
| | | return 0;
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | } |
| | |
| | |
|
| | | public static bool Send_WorldTransfer(int mapId, Vector3 position, MapTransferType type, byte lineID = 255, int _npcId = 0)
|
| | | {
|
| | | if (!AssetSource.sceneFromEditor && !AssetVersionUtility.IsUnpriorAssetDownLoadOk())
|
| | | if (!AssetSource.sceneFromEditor)
|
| | | {
|
| | | var mapResConfig = DTCA127_tagMCStartChangeMap.GetMapResourcesConfig(mapId, 0);
|
| | | var assetVersion = AssetVersionUtility.GetAssetVersion(StringUtility.Contact("maps/", mapResConfig.MapResources.ToLower()));
|
| | |
|
| | | if (assetVersion != null && !assetVersion.IsPriorAsset())
|
| | | var assetValid = AssetVersionUtility.IsAssetValid(StringUtility.Contact("maps/", mapResConfig.MapResources.ToLower()));
|
| | | if (!assetValid)
|
| | | {
|
| | | InGameDownLoad.Instance.TryDownLoad(InGameDownLoad.Dominant.Whole);
|
| | | return false;
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | var assetVersion = AssetVersionUtility.GetAssetVersion(StringUtility.Contact("maps/", mapResConfig.MapResources.ToLower()));
|
| | | if (assetVersion != null && assetVersion.IsPriorAsset())
|
| | | var assetValid = AssetVersionUtility.IsAssetValid(StringUtility.Contact("maps/", mapResConfig.MapResources.ToLower()));
|
| | | if (assetValid)
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(LoadCoroutine<T>(stageId, mapResConfig.ID, mapResConfig.MapResources, true));
|
| | | }
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | switch (GetAssetCategory())
|
| | | {
|
| | | case AssetCategory.Scene:
|
| | | return PriorBundleConfig.scenes.Contains(m_FileName);
|
| | | case AssetCategory.Mob:
|
| | | return PriorBundleConfig.mobs.Contains(m_FileName);
|
| | | case AssetCategory.Audio:
|
| | | return PriorBundleConfig.audios.Contains(m_FileName);
|
| | | case AssetCategory.Effect:
|
| | | return PriorBundleConfig.effects.Contains(m_FileName);
|
| | | default:
|
| | | return true;
|
| | | }
|
| | | var category = GetAssetCategory();
|
| | | var prior = PriorBundleConfig.GetAssetPrior(category, m_FileName);
|
| | | return prior <= 1;
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | | return assetVersions;
|
| | | } |
| | | |
| | | public static AssetVersion GetAssetVersion(string _assetBundleName)
|
| | | public static AssetVersion GetAssetVersion(string assetKey)
|
| | | {
|
| | | if (assetVersions.ContainsKey(_assetBundleName))
|
| | | if (assetVersions.ContainsKey(assetKey))
|
| | | {
|
| | | return assetVersions[_assetBundleName];
|
| | | return assetVersions[assetKey];
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | }
|
| | | } |
| | | |
| | | public static bool IsAssetValid(string assetKey)
|
| | | {
|
| | | if (assetVersions.ContainsKey(assetKey)) |
| | | { |
| | | return assetVersions[assetKey].localValid; |
| | | }
|
| | | else
|
| | | {
|
| | | if (VersionUtility.Instance.NeedDownAsset()) |
| | | { |
| | | return false; |
| | | }
|
| | | else
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | } |
| | | |
| | | public static string GetAssetFilePath(string _assetKey)
|
| | | {
|
| | | var path = string.Empty;
|
| | |
| | |
|
| | | public bool inGameDownLoadAllow = false;
|
| | |
|
| | | public float progress
|
| | | {
|
| | | get
|
| | | {
|
| | | public float progress {
|
| | | get {
|
| | | return Mathf.Clamp01((float)showDownLoadedSize / showTotalSize);
|
| | | }
|
| | | }
|
| | |
| | | int totalCount = 0;
|
| | |
|
| | | int m_OkCount = 0;
|
| | | int okCount
|
| | | {
|
| | | int okCount {
|
| | | get { return m_OkCount; }
|
| | | set
|
| | | {
|
| | | set {
|
| | | m_OkCount = value;
|
| | | }
|
| | | }
|
| | |
| | | Action onDownLoadOk;
|
| | |
|
| | | Dominant m_DominantState = Dominant.None;
|
| | | public Dominant dominantState
|
| | | {
|
| | | public Dominant dominantState {
|
| | | get { return m_DominantState; }
|
| | | private set
|
| | | {
|
| | | private set {
|
| | | if (m_DominantState != value)
|
| | | {
|
| | | m_DominantState = value;
|
| | |
| | | }
|
| | |
|
| | | State m_State = State.None;
|
| | | public State state
|
| | | {
|
| | | public State state {
|
| | | get { return m_State; }
|
| | | set
|
| | | {
|
| | | set {
|
| | | if (m_State != value)
|
| | | {
|
| | | m_State = value;
|
| | |
| | |
|
| | | public List<Reward> rewards = new List<Reward>();
|
| | | public bool hasReward { get; private set; }
|
| | | public string completeDownLoadAccount
|
| | | {
|
| | | public string completeDownLoadAccount {
|
| | | get { return LocalSave.GetString("InGameDownLoadCompleteAccount"); }
|
| | | set { LocalSave.SetString("InGameDownLoadCompleteAccount", value); }
|
| | | }
|
| | |
| | | {
|
| | | inGameDownLoadAllow = false;
|
| | | tasks = _tasks;
|
| | | tasks.Sort(AssetDownLoadPriorCompare);
|
| | | onDownLoadOk = _onDownLoadOk;
|
| | |
|
| | | totalCount = tasks.Count;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | IEnumerator Co_StartDownLoad()
|
| | | {
|
| | | downLoadedSizeRecord += RemoteFile.TotalDownloadedSize;
|
| | |
| | |
|
| | | Clock netSwitchClock;
|
| | | NetworkReachability m_NetworkReachability = NetworkReachability.NotReachable;
|
| | | NetworkReachability networkReachability
|
| | | {
|
| | | NetworkReachability networkReachability {
|
| | | get { return m_NetworkReachability; }
|
| | | set
|
| | | {
|
| | | set {
|
| | | if (m_NetworkReachability != value)
|
| | | {
|
| | | m_NetworkReachability = value;
|
| | |
| | |
|
| | |
|
| | | bool m_SimulateWifi = true;
|
| | | public bool simulateWifi
|
| | | {
|
| | | public bool simulateWifi {
|
| | | get { return m_SimulateWifi; }
|
| | | set
|
| | | {
|
| | | set {
|
| | | if (m_SimulateWifi != value)
|
| | | {
|
| | | m_SimulateWifi = value;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private int AssetDownLoadPriorCompare(AssetVersion lhs, AssetVersion rhs)
|
| | | {
|
| | | var categoryA = lhs.GetAssetCategory();
|
| | | var categoryB = rhs.GetAssetCategory();
|
| | | var priorA = PriorBundleConfig.GetAssetPrior(categoryA, lhs.fileName);
|
| | | var priorB = PriorBundleConfig.GetAssetPrior(categoryB, rhs.fileName);
|
| | |
|
| | | return priorA < priorB ? -1 : 1;
|
| | | }
|
| | |
|
| | | public struct Reward
|
| | | {
|
| | |
| | | {
|
| | | ParseConfig();
|
| | | SetDogzAndEquipPlaceRedKey();
|
| | | playerPack.RefreshPackAct += UpdateDogzEquipInfo;
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | |
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | SetDogzEquipInfo(); |
| | | playerPack.RefreshItemCountAct += RefreshDogzEquipInfo;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += UpdateDogzState;
|
| | | UpdateDogzAssistRed();
|
| | |
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | |
|
| | | playerPack.RefreshPackAct -= UpdateDogzEquipInfo;
|
| | | }
|
| | |
|
| | | #region 配置
|
| | |
| | |
|
| | | #endregion
|
| | |
|
| | | private void UpdateDogzEquipInfo(PackType type)
|
| | | {
|
| | | if (type != PackType.rptDogzEquip) return;
|
| | |
|
| | | SetDogzEquipInfo();
|
| | | }
|
| | |
|
| | | public int GetAssistItemCnt()
|
| | | {
|
| | | if(!IsAddMaxAssist())
|
| | |
| | | }
|
| | | if (Index > -1)
|
| | | {
|
| | | if (Index + 1 >=7)
|
| | | if (Index + 1 >= 7)
|
| | | {
|
| | | if(7-mainModel.WaHuangHighestFloor>=0)
|
| | | mainModel.LayerNumber = 7 - mainModel.WaHuangHighestFloor;
|
| | | if (7 - mainModel.WaHuangHighestFloor >= 0)
|
| | | mainModel.LayerNumber = 7 - mainModel.WaHuangHighestFloor;
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | |
|
| | | public void RequestChallangeDungeon(int _dataMapId, int _lineId)
|
| | | {
|
| | | if (!AssetSource.sceneFromEditor && !AssetVersionUtility.IsUnpriorAssetDownLoadOk())
|
| | | if (!AssetSource.sceneFromEditor)
|
| | | {
|
| | | var mapResConfig = DTCA127_tagMCStartChangeMap.GetMapResourcesConfig(_dataMapId, _lineId);
|
| | | var assetVersion = AssetVersionUtility.GetAssetVersion(StringUtility.Contact("maps/", mapResConfig.MapResources.ToLower()));
|
| | | var assetValid = AssetVersionUtility.IsAssetValid(StringUtility.Contact("maps/", mapResConfig.MapResources.ToLower()));
|
| | |
|
| | | if (assetVersion != null && !assetVersion.IsPriorAsset())
|
| | | if (!assetValid)
|
| | | {
|
| | | InGameDownLoad.Instance.TryDownLoad(InGameDownLoad.Dominant.Whole);
|
| | | return;
|
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using System.IO; |
| | | using System.Threading; |
| | | |
| | | public class AssetDeCompressTask |
| | | { |
| | | |
| | | public static void Decompress(string path) |
| | | { |
| | | var files = new List<FileInfo>(); |
| | | FileExtersion.GetAllDirectoryFileInfos(path, files); |
| | | foreach (var item in files) |
| | | { |
| | | var fullName = item.FullName; |
| | | if (fullName.EndsWith(".7z")) |
| | | { |
| | | SevenZipUtility.DeCompress(fullName, Path.GetDirectoryName(fullName)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static DecompressProgress DecompressAync(string path) |
| | | { |
| | | var progress = new DecompressProgress(); |
| | | var files = new List<FileInfo>(); |
| | | FileExtersion.GetAllDirectoryFileInfos(path, files); |
| | | |
| | | for (var i = files.Count - 1; i >= 0; i--) |
| | | { |
| | | var fullName = files[i].FullName; |
| | | if (!fullName.EndsWith(".7z")) |
| | | { |
| | | files.RemoveAt(i); |
| | | } |
| | | } |
| | | |
| | | var total = files.Count; |
| | | if (total == 0) |
| | | { |
| | | progress.progress = 1f; |
| | | progress.done = true; |
| | | return progress; |
| | | } |
| | | |
| | | ThreadPool.QueueUserWorkItem((object a) => |
| | | { |
| | | var index = 0; |
| | | foreach (var item in files) |
| | | { |
| | | var fullName = item.FullName; |
| | | if (fullName.EndsWith(".7z")) |
| | | { |
| | | SevenZipUtility.DeCompress(fullName, Path.GetDirectoryName(fullName)); |
| | | index++; |
| | | progress.progress = index / (float)total; |
| | | } |
| | | } |
| | | |
| | | progress.done = true; |
| | | }); |
| | | |
| | | return progress; |
| | | } |
| | | |
| | | public static void Delete7zFiles(string path) |
| | | { |
| | | var files = new List<FileInfo>(); |
| | | FileExtersion.GetAllDirectoryFileInfos(path, files); |
| | | |
| | | for (var i = files.Count - 1; i >= 0; i--) |
| | | { |
| | | var fullName = files[i].FullName; |
| | | if (fullName.EndsWith(".7z")) |
| | | { |
| | | files[i].Delete(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public class DecompressProgress |
| | | { |
| | | object progressLock = new object(); |
| | | float m_Progress = 0f; |
| | | public float progress { |
| | | get { |
| | | return m_Progress; |
| | | } |
| | | set { |
| | | lock (progressLock) |
| | | { |
| | | m_Progress = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | object doneLock = new object(); |
| | | bool m_Done = false; |
| | | public bool done { |
| | | get { |
| | | return m_Done; |
| | | } |
| | | set { |
| | | lock (doneLock) |
| | | { |
| | | m_Done = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 2ca4a4bf756f36248be9ddbbf60e835a |
| | | timeCreated: 1541123413 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | var mapResConfig = Config.Instance.Get<MapResourcesConfig>(targetMapResId);
|
| | | if (mapResConfig != null && mapResConfig.LoadingBG.Length > 0)
|
| | | var useDefautBackGround = false;
|
| | | if (!AssetSource.uiFromEditor)
|
| | | {
|
| | | var randomIndex = UnityEngine.Random.Range(0, mapResConfig.LoadingBG.Length > 1 ? mapResConfig.LoadingBG.Length + 1 : 1);
|
| | | if (randomIndex == mapResConfig.LoadingBG.Length)
|
| | | var assetValid = AssetVersionUtility.IsAssetValid("ui/sprite/loadingbg");
|
| | | useDefautBackGround = !assetValid;
|
| | | }
|
| | |
|
| | | if (useDefautBackGround)
|
| | | {
|
| | | var sprite = BuiltInLoader.LoadSprite("Launch");
|
| | | m_BackGround.overrideSprite = sprite;
|
| | | m_ContainerMapName.gameObject.SetActive(false);
|
| | | m_ContainerMapDescription.gameObject.SetActive(false);
|
| | | m_ContainerFunctions.gameObject.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | var mapResConfig = Config.Instance.Get<MapResourcesConfig>(targetMapResId);
|
| | | if (mapResConfig != null && mapResConfig.LoadingBG.Length > 0)
|
| | | {
|
| | | m_BackGround.SetSprite(GeneralDefine.LoadLV);
|
| | | m_ContainerFunctions.gameObject.SetActive(true);
|
| | | var functions = GetShowFunctions(PlayerDatas.Instance.baseData.LV == 0 ? PlayerDatas.Instance.loginInfo.LV : PlayerDatas.Instance.baseData.LV);
|
| | | for (int i = 0; i < m_FunctionShows.Length; i++)
|
| | | var randomIndex = UnityEngine.Random.Range(0, mapResConfig.LoadingBG.Length > 1 ? mapResConfig.LoadingBG.Length + 1 : 1);
|
| | | if (randomIndex == mapResConfig.LoadingBG.Length)
|
| | | {
|
| | | var show = m_FunctionShows[i];
|
| | | show.Display(functions[i]);
|
| | | m_BackGround.SetSprite(GeneralDefine.LoadLV);
|
| | | m_ContainerFunctions.gameObject.SetActive(true);
|
| | | var functions = GetShowFunctions(PlayerDatas.Instance.baseData.LV == 0 ? PlayerDatas.Instance.loginInfo.LV : PlayerDatas.Instance.baseData.LV);
|
| | | for (int i = 0; i < m_FunctionShows.Length; i++)
|
| | | {
|
| | | var show = m_FunctionShows[i];
|
| | | show.Display(functions[i]);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | m_BackGround.SetSprite(mapResConfig.LoadingBG[randomIndex]);
|
| | | m_ContainerFunctions.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | if (mapResConfig != null && !string.IsNullOrEmpty(mapResConfig.LoadName))
|
| | | {
|
| | | m_ContainerMapName.gameObject.SetActive(true);
|
| | | m_MapName.SetSprite(mapResConfig.LoadName);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_BackGround.SetSprite(mapResConfig.LoadingBG[randomIndex]);
|
| | | m_ContainerFunctions.gameObject.SetActive(false);
|
| | | m_ContainerMapName.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | if (mapResConfig != null && !string.IsNullOrEmpty(mapResConfig.LoadName))
|
| | | {
|
| | | m_ContainerMapName.gameObject.SetActive(true);
|
| | | m_MapName.SetSprite(mapResConfig.LoadName);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_ContainerMapName.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | if (mapResConfig != null && !string.IsNullOrEmpty(mapResConfig.LoadDescription))
|
| | | {
|
| | | m_ContainerMapDescription.gameObject.SetActive(true);
|
| | | m_MapDescription.SetSprite(mapResConfig.LoadDescription);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_ContainerMapDescription.gameObject.SetActive(false);
|
| | | if (mapResConfig != null && !string.IsNullOrEmpty(mapResConfig.LoadDescription))
|
| | | {
|
| | | m_ContainerMapDescription.gameObject.SetActive(true);
|
| | | m_MapDescription.SetSprite(mapResConfig.LoadDescription);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_ContainerMapDescription.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | m_ProgressSlider.value = refProgress = 0f;
|
| | |
| | | {
|
| | | m_ProgressSlider.value = refProgress = Mathf.Max(_progress, refProgress);
|
| | | }
|
| | |
|
| | |
|
| | | private List<int> GetShowFunctions(int _level)
|
| | | {
|
| | |
| | | int openTag = config.FuncId;
|
| | | if (!FuncOpen.Instance.IsFuncOpen(openTag))
|
| | | {
|
| | | featureNoticeModel.FunctionForecastIndex = config.OpenNumber;
|
| | | featureNoticeModel.FunctionForecastIndex = config.FuncId;
|
| | | return;
|
| | | }
|
| | | }
|
| | |
| | | //FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
|
| | | //treasureModel.treasureStateChangeEvent -= treasureStateChangeEvent;
|
| | | //treasureModel.treasureStageUpEvent -= treasureStageUpEvent;
|
| | | FunctionForecastIndex = 0;
|
| | | DicOpenFuncState.Clear();
|
| | | StageManager.Instance.onStageLoadFinish -= OnStageLoadFinish;
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | |
| | | //FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
|
| | | //PlayerDatas.Instance.PlayerDataRefreshInfoEvent += OnPlayersUpLV;
|
| | | //treasureModel.treasureStateChangeEvent += treasureStateChangeEvent;
|
| | | //treasureModel.treasureStageUpEvent += treasureStageUpEvent;
|
| | | StageManager.Instance.onStageLoadFinish -= OnStageLoadFinish;
|
| | | //treasureModel.treasureStageUpEvent += treasureStageUpEvent; |
| | | StageManager.Instance.onStageLoadFinish += OnStageLoadFinish;
|
| | | RedPoint_State();
|
| | | // RedDotStatus();
|
| | |
| | | foreach (var _key in DicOpenFuncState.Keys)
|
| | | {
|
| | | if (DicRedPoint.ContainsKey(_key) && DicOpenFuncState[_key].State==1
|
| | | && DicOpenFuncState[_key].AwardState==0)
|
| | | && DicOpenFuncState[_key].AwardState==0 && DicAwardItem.ContainsKey(_key))
|
| | | {
|
| | | DicRedPoint[_key].state = RedPointState.Simple;
|
| | | }
|
| | |
| | | [SerializeField] Text _NameText;//标题名
|
| | | [SerializeField] Text _Information;//信息内容
|
| | | [SerializeField] GameObject m_FeatureNoticeTipObj;
|
| | | [SerializeField] Text m_Information_reward;//有奖励可领取
|
| | | FeatureNoticeModel featureNoticeModel { get { return ModelCenter.Instance.GetModel<FeatureNoticeModel>(); } }
|
| | | public GameObject FeatureNoticeTipObj
|
| | | {
|
| | | get { return m_FeatureNoticeTipObj; }
|
| | |
| | | return;
|
| | | }
|
| | | }
|
| | | if (featureNoticeModel.redPointStre1.state == RedPointState.Simple)//预告完毕还有奖励能领取
|
| | | {
|
| | | _FunctionIcon.SetSprite("PersonBossIcon");
|
| | | m_Information_reward.gameObject.SetActive(true);
|
| | | _NameText.gameObject.SetActive(false);
|
| | | _Information.gameObject.SetActive(false);
|
| | | return;
|
| | | }
|
| | | return;
|
| | | }
|
| | | void OpenPanel(int ID)
|
| | | {
|
| | | m_Information_reward.gameObject.SetActive(false);
|
| | | _NameText.gameObject.SetActive(true);
|
| | | _Information.gameObject.SetActive(true);
|
| | | _FunctionIcon.SetSprite(Config.Instance.Get<FunctionForecastConfig>(ID).FuncIconKey);
|
| | | _NameText.text = Config.Instance.Get<FunctionForecastConfig>(ID).Describe;
|
| | | FuncOpenLVConfig funcoPenConfig = Config.Instance.Get<FuncOpenLVConfig>(ID);
|
| | |
| | | }
|
| | | if (!FuncOpen.Instance.IsFuncOpen(funcId) && Type && NeedLv > playerLv)
|
| | | {
|
| | | m_FunctionName.text = "?";
|
| | | m_FunctionName.gameObject.SetActive(false);
|
| | | // m_FunctionName.text = "?";
|
| | | m_FeaturesTypeIcon.SetSprite("UnKnowIcon");
|
| | | m_Award.SetActive(false);
|
| | | m_Content.gameObject.SetActive(true);
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | m_FunctionName.gameObject.SetActive(true);
|
| | | m_FunctionName.text = functionForecastConfig.FuncName;
|
| | | m_FeaturesTypeIcon.SetSprite(functionForecastConfig.FuncIconKey);
|
| | | if (featureNoticeModel.DicAwardItem.ContainsKey(funcId))
|
| | |
| | | [SerializeField] Button _FunctionIconBtn;//面板开关按钮
|
| | | [SerializeField] Text _NameText;//标题名
|
| | | [SerializeField] Text _Information;//信息内容
|
| | | [SerializeField] Text m_Information_reward;//有奖励可领取
|
| | | public static Action<int> FunctionOpenTagEvent;
|
| | | FeatureNoticeModel featureNoticeModel { get { return ModelCenter.Instance.GetModel<FeatureNoticeModel>(); } }
|
| | | public void Init()//初始化
|
| | | {
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += OnPlayersUpLV;
|
| | |
| | | return;
|
| | | }
|
| | | }
|
| | | _FunctionForecastPanel.gameObject.SetActive(false);
|
| | | if (featureNoticeModel.redPointStre1.state == RedPointState.Simple)//预告完毕还有奖励能领取
|
| | | {
|
| | | _FunctionForecastPanel.gameObject.SetActive(true);
|
| | | _FunctionIcon.SetSprite("PersonBossIcon");
|
| | | m_Information_reward.gameObject.SetActive(true);
|
| | | _NameText.gameObject.SetActive(false);
|
| | | _Information.gameObject.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | _FunctionForecastPanel.gameObject.SetActive(false);
|
| | | }
|
| | | |
| | | return;
|
| | | }
|
| | |
|
| | | void OpenPanel(int ID)
|
| | | {
|
| | | _FunctionForecastPanel.gameObject.SetActive(true);
|
| | | m_Information_reward.gameObject.SetActive(false);
|
| | | _NameText.gameObject.SetActive(true);
|
| | | _Information.gameObject.SetActive(true);
|
| | | _FunctionIcon.SetSprite(Config.Instance.Get<FunctionForecastConfig>(ID).FuncIconKey);
|
| | | _NameText.text = Config.Instance.Get<FunctionForecastConfig>(ID).Describe;
|
| | | FuncOpenLVConfig funcoPenConfig = Config.Instance.Get<FuncOpenLVConfig>(ID);
|
| | |
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | playerPack.ItemCntAddAct -= ItemCntAddAct;
|
| | | playerPack.ItemCntReduceAct -= ItemCntReduceAct;
|
| | | dogz_model.UpdateAssistDogzEvent -= UpdateAssistDogzEvent;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
|
| | | DTC0721_tagMakeItemAnswer.MakeItemAnswerEvent -= MakeItemAnswerEvent;
|
| | |
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | { |
| | | DTC0721_tagMakeItemAnswer.MakeItemAnswerEvent += MakeItemAnswerEvent;
|
| | | playerPack.ItemCntAddAct += ItemCntAddAct;//物品数量增加
|
| | | playerPack.ItemCntReduceAct += ItemCntReduceAct;//物品数量减少
|
| | |
| | | case JumpUIType.BlastFurnaceFunc1:
|
| | | SetJumpLogic<BlastFurnaceWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.MyTeamType1:
|
| | | case JumpUIType.TeamListType1:
|
| | | SetJumpLogic<TeamFrameWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.Team_EmperorRelic:
|
| | | case JumpUIType.Team_TrialDungeon:
|
| | | var model = ModelCenter.Instance.GetModel<TeamModel>();
|
| | | model.missionBuf = new TeamMission(int.Parse(_tagWinSearchModel.SelectActive),0);
|
| | | SetJumpLogic<TeamFrameWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.VipExperience:
|
| | | SetJumpLogic<VipExperienceWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | |
| | | MarketFunc2 = 88,
|
| | | MarketFunc3 = 89,
|
| | | BlastFurnaceFunc1 = 92,
|
| | | MyTeamType1 = 93, //我的队伍界面
|
| | | TeamListType1 = 94, //组队列表界面
|
| | | VipExperience = 98,
|
| | | RuneTower = 99,//符印塔
|
| | | WelfareFunc1 = 102, //签到
|
| | |
| | | BindGoldWheel = 252, //绑玉转盘界面
|
| | | FlashRushToBuy = 253, //精彩活动—限时抢购界面
|
| | | EquipHighSuit = 254, //强化套装界面
|
| | | Team_TrialDungeon = 255, //组队列表-宗门试炼标签
|
| | | Team_EmperorRelic = 256, //组队列表-娲皇遗迹标签
|
| | | DhszTs = 1001,//定海神针功法提升界面
|
| | | HyqTs = 1002,//皓月枪功法提升界面
|
| | | GyzTs = 1003,//鬼牙刃功法提升界面
|
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using System.IO; |
| | | |
| | | public class SevenZipUtility |
| | | { |
| | | static string m_SevenZipToolPath = string.Empty; |
| | | static string sevenZipToolPath { |
| | | get { |
| | | if (string.IsNullOrEmpty(m_SevenZipToolPath)) |
| | | { |
| | | if (Directory.Exists("C:/Program Files/7-Zip")) |
| | | { |
| | | m_SevenZipToolPath = "C:/Program Files/7-Zip"; |
| | | } |
| | | else |
| | | { |
| | | m_SevenZipToolPath = "C:/Program Files (x86)/7-Zip"; |
| | | } |
| | | } |
| | | |
| | | return m_SevenZipToolPath; |
| | | } |
| | | } |
| | | |
| | | public static void Compress(string from, string to) |
| | | { |
| | | if (File.Exists(to)) |
| | | { |
| | | File.Delete(to); |
| | | } |
| | | |
| | | var cmd = string.Format("\"{0}\\7z\" a {1} {2} -mx9", sevenZipToolPath, to, from); |
| | | SystemCMD.RunCmd(cmd); |
| | | } |
| | | |
| | | public static void DeCompress(string from, string to) |
| | | { |
| | | lzma.doDecompress7zip(from, to, false, true); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f144847788b6f254083b077d968bc6f4 |
| | | timeCreated: 1541055675 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class SystemCMD |
| | | { |
| | | /// <summary> |
| | | /// 调用终端执行命令 |
| | | /// </summary> |
| | | /// <param name="command"></param> |
| | | /// <returns></returns> |
| | | public static string RunCmd(string command) |
| | | { |
| | | System.Diagnostics.Process p = new System.Diagnostics.Process(); |
| | | p.StartInfo.FileName = "cmd.exe"; //确定程序名 |
| | | p.StartInfo.Arguments = "/c " + command; //确定程式命令行 |
| | | p.StartInfo.UseShellExecute = false; //Shell的使用 |
| | | p.StartInfo.RedirectStandardInput = true; //重定向输入 |
| | | p.StartInfo.RedirectStandardOutput = true; //重定向输出 |
| | | p.StartInfo.RedirectStandardError = true; //重定向输出错误 |
| | | p.StartInfo.CreateNoWindow = true; //设置置不显示示窗口 |
| | | p.Start(); |
| | | p.WaitForExit(); |
| | | string err = p.StandardError.ReadToEnd(); |
| | | string standoutput = p.StandardOutput.ReadToEnd(); |
| | | if (string.IsNullOrEmpty(err)) |
| | | { |
| | | return standoutput; |
| | | } |
| | | else |
| | | { |
| | | return err; //输出出流取得命令行结果果 |
| | | } |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6de2d4b13bfadaf419c682196b36e001 |
| | | timeCreated: 1541043601 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |