Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public static bool GetActoreShowConfigByMapIdAndLineId(int mapId, int lineId, out ActorShowConfig config)
|
| | | {
|
| | | foreach (var item in actorShowDic.Values)
|
| | | {
|
| | | if (item.MapID == mapId && (item.line == lineId || item.line == 1000))
|
| | | {
|
| | | config = item;
|
| | | return true;
|
| | | }
|
| | | }
|
| | |
|
| | | config = null;
|
| | | return false;
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
| | | if (!AssetSource.sceneFromEditor)
|
| | | {
|
| | | var mapResConfig = DTCA127_tagMCStartChangeMap.GetMapResourcesConfig(mapId, 0);
|
| | | var assetValid = AssetVersionUtility.IsAssetValid(StringUtility.Contact("maps/", mapResConfig.MapResources.ToLower()));
|
| | | var assetValid = AssetVersionUtility.IsSceneAssetValid(mapId, 0);
|
| | | if (!assetValid)
|
| | | {
|
| | | InGameDownLoad.Instance.TryDownLoad(InGameDownLoad.Dominant.Whole);
|
| | |
| | | public event Action<float> loadingProgressEvent;
|
| | |
|
| | | bool m_IsServerPreparing = false;
|
| | | public bool isServerPreparing
|
| | | {
|
| | | public bool isServerPreparing {
|
| | | get { return m_IsServerPreparing; }
|
| | | set { m_IsServerPreparing = value; }
|
| | | }
|
| | |
|
| | | public Stage.E_StageType StageType
|
| | | {
|
| | | get
|
| | | {
|
| | | public Stage.E_StageType StageType {
|
| | | get {
|
| | | return m_StageType;
|
| | | }
|
| | | }
|
| | |
|
| | | public Stage CurrentStage
|
| | | {
|
| | | get
|
| | | {
|
| | | public Stage CurrentStage {
|
| | | get {
|
| | | return m_CurrentStage;
|
| | | }
|
| | | }
|
| | |
|
| | | int m_CurrentMapId;
|
| | | public int currentMapId
|
| | | {
|
| | | public int currentMapId {
|
| | | get { return m_CurrentMapId; }
|
| | | private set { m_CurrentMapId = value; }
|
| | | }
|
| | |
|
| | | int m_CurrentMapResID;
|
| | | public int currentMapResId
|
| | | {
|
| | | get
|
| | | {
|
| | | public int currentMapResId {
|
| | | get {
|
| | | return m_CurrentMapResID;
|
| | | }
|
| | | private set { m_CurrentMapResID = value; }
|
| | |
| | |
|
| | |
|
| | | float m_LoadingProgress = 0f;
|
| | | float loadingProgress
|
| | | {
|
| | | float loadingProgress {
|
| | | get { return m_LoadingProgress; }
|
| | | set
|
| | | {
|
| | | set {
|
| | | m_LoadingProgress = value;
|
| | | if (loadingProgressEvent != null)
|
| | | {
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | var assetValid = AssetVersionUtility.IsAssetValid(StringUtility.Contact("maps/", mapResConfig.MapResources.ToLower()));
|
| | | var assetValid = AssetVersionUtility.IsSceneAssetValid(PlayerDatas.Instance.baseData.MapID, DTCA127_tagMCStartChangeMap.LineID);
|
| | | if (assetValid)
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(LoadCoroutine<T>(stageId, mapResConfig.ID, mapResConfig.MapResources, true));
|
| | |
| | | using System.IO; |
| | | using Snxxz.UI; |
| | | using System.Threading; |
| | | using TableConfig; |
| | | |
| | | public class AssetVersionUtility
|
| | | { |
| | |
| | | }
|
| | | } |
| | | |
| | | public static bool IsSceneAssetValid(int mapId, int lineId)
|
| | | {
|
| | | var dataMapId = 0;
|
| | | var mapConfig = Config.Instance.Get<MapConfig>(mapId);
|
| | |
|
| | | if (mapConfig.MapFBType != 0)
|
| | | {
|
| | | var model = ModelCenter.Instance.GetModel<DungeonModel>();
|
| | | dataMapId = model.GetDataMapIdByMapId(mapId);
|
| | | }
|
| | | else
|
| | | {
|
| | | dataMapId = mapId;
|
| | | }
|
| | |
|
| | | var mapResConfig = DTCA127_tagMCStartChangeMap.GetMapResourcesConfig(dataMapId, lineId);
|
| | | if (!IsAssetValid(StringUtility.Contact("maps/", mapResConfig.MapResources.ToLower()))) |
| | | {
|
| | | return false; |
| | | }
|
| | |
|
| | | ActorShowConfig actorShowConfig = null;
|
| | | if (ActorShowConfig.GetActoreShowConfigByMapIdAndLineId(dataMapId, lineId, out actorShowConfig)) |
| | | { |
| | | var npcs = actorShowConfig.showNpcs;
|
| | | foreach (var item in npcs) |
| | | { |
| | | var npcConfig = Config.Instance.Get<NPCConfig>(item); |
| | | var assetbundleName = StringUtility.Contact("prefab_race_", npcConfig.MODE.ToLower());
|
| | | if (!IsAssetValid(assetbundleName)) |
| | | { |
| | | return false; |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | return true;
|
| | | } |
| | | |
| | | public static string GetAssetFilePath(string _assetKey)
|
| | | {
|
| | | var path = string.Empty;
|
| | |
| | | {
|
| | | if (!AssetSource.sceneFromEditor)
|
| | | {
|
| | | var mapResConfig = DTCA127_tagMCStartChangeMap.GetMapResourcesConfig(_dataMapId, _lineId);
|
| | | var assetValid = AssetVersionUtility.IsAssetValid(StringUtility.Contact("maps/", mapResConfig.MapResources.ToLower()));
|
| | | var dungeonConfig = Config.Instance.Get<DungeonConfig>(GetDungeonId(_dataMapId, _lineId));
|
| | | var assetValid = true;
|
| | | if (dungeonConfig != null)
|
| | | {
|
| | | assetValid = AssetVersionUtility.IsSceneAssetValid(dungeonConfig.MapID, _lineId);
|
| | | }
|
| | |
|
| | | if (!assetValid)
|
| | | {
|
| | |
| | |
|
| | | public void SetPlayerSyncCount(int _syncCount)
|
| | | {
|
| | | SettingMgr.Instance.SetAccountSetStr("PlayerSyncCount", _syncCount.ToString());
|
| | |
|
| | | LocalSave.SetInt("PlayerSyncCount", _syncCount);
|
| | | if (m_PlayerSyncCount != _syncCount)
|
| | | {
|
| | | m_PlayerSyncCount = _syncCount;
|
| | |
| | | {
|
| | | if (m_PlayerSyncCount == -1)
|
| | | {
|
| | | var result = SettingMgr.Instance.GetAccountSetIntInfo("PlayerSyncCount");
|
| | | var result = LocalSave.GetInt("PlayerSyncCount", -1);
|
| | | if (result == -1)
|
| | | {
|
| | | var quality = GetCurrentQualityLevel();
|
| | |
| | | m_PlayerSyncCount = 15;
|
| | | break;
|
| | | case GameQuality.Low:
|
| | | m_PlayerSyncCount = 10;
|
| | | m_PlayerSyncCount = 5;
|
| | | break;
|
| | | case GameQuality.Medium:
|
| | | m_PlayerSyncCount = 5;
|
| | | m_PlayerSyncCount = 10;
|
| | | break;
|
| | | }
|
| | | }
|