少年修仙传客户端代码仓库
client_Wu Xijin
2019-01-31 2b0784e7658b7bf198a09f6996e7ca07dd09d449
3335 场景切换重构
3个文件已修改
69 ■■■■ 已修改文件
Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0403_tagPlayerLoginLoadOK.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Stage/StageLoadProcessor.cs 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Utility/ActorShadowCaster.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0403_tagPlayerLoginLoadOK.cs
@@ -18,6 +18,8 @@
        StageLoadTimeOutCatcher.RecordProtocol(vNetPack.socketType, "0403", DateTime.Now);
        GameNetSystem.Instance.netState = GameNetSystem.NetState.Connected;
        StageLoad.Instance.UpdateServerFlag(StageLoad.ServerFlagType.Flag_0403, vNetData.socketType, true);
        finishedLogin = true;
        GA_Hero.s_MapSwitching = false;
Fight/Stage/StageLoadProcessor.cs
@@ -294,24 +294,54 @@
        {
            var mapId = command.toMapId;
            var lineId = command.toLineId;
            var assetBundleName = GetAssetBundleNameByMapId(mapId, lineId);
            AssetBundleUtility.Instance.Sync_LoadAll(assetBundleName);
            if (!AssetSource.sceneFromEditor)
            {
                var assetBundleName = GetAssetBundleNameByMapId(mapId, lineId);
                AssetBundleUtility.Instance.Sync_LoadAll(assetBundleName);
            }
            var dataMapId = MapUtility.GetDataMapId(mapId);
            var config = MapResourcesConfig.GetConfig(dataMapId, lineId);
            operation = SceneManager.LoadSceneAsync(config.MapResources);
            switch (command.toMapId)
            {
                case 1:
                    operation = SceneManager.LoadSceneAsync("Level_Login");
                    break;
                case 2:
                case 3:
                    operation = SceneManager.LoadSceneAsync("CreateRole_001");
                    break;
                default:
                    var dataMapId = MapUtility.GetDataMapId(mapId);
                    var config = MapResourcesConfig.GetConfig(dataMapId, lineId);
                    operation = SceneManager.LoadSceneAsync(config.MapResources);
                    break;
            }
        }
        public override void End()
        {
            StageLoad.Instance.InitHero();
            var mapId = command.toMapId;
            var lineId = command.toLineId;
            var dataMapId = MapUtility.GetDataMapId(mapId);
            var config = MapResourcesConfig.GetConfig(dataMapId, lineId);
            var stageGameObject = new GameObject(string.Format("__Stage_{0}_", config.MapResources));
            var levelName = string.Empty;
            switch (mapId)
            {
                case 1:
                    levelName = "__Stage_Level_Login_";
                    break;
                case 2:
                case 3:
                    levelName = "__Stage_CreateRole_001_";
                    break;
                default:
                    StageLoad.Instance.InitHero();
                    var dataMapId = MapUtility.GetDataMapId(mapId);
                    var config = MapResourcesConfig.GetConfig(dataMapId, lineId);
                    levelName = string.Format("__Stage_{0}_", config.MapResources);
                    break;
            }
            var stageGameObject = new GameObject(levelName);
            Stage stage;
            switch (mapId)
            {
Utility/ActorShadowCaster.cs
@@ -41,14 +41,17 @@
        m_DrawTargetObject.followTarget = false;
        m_DrawTargetObject.SetCommandBufferDirty();
        var dataMapId = MapUtility.GetDataMapId();
        var lineId = MapUtility.GetLineId();
        var mapResourcesConfig = MapResourcesConfig.GetConfig(dataMapId, lineId);
        var config = Config.Instance.Get<SceneShadowConfig>(mapResourcesConfig.MapResources);
        if (config != null)
        if (PlayerDatas.Instance.baseData.MapID>100)
        {
            m_Projector.transform.localEulerAngles = config.Rotation;
            m_Projector.material.SetFloat("_Alpha", config.Intensity);
            var dataMapId = MapUtility.GetDataMapId();
            var lineId = MapUtility.GetLineId();
            var mapResourcesConfig = MapResourcesConfig.GetConfig(dataMapId, lineId);
            var config = Config.Instance.Get<SceneShadowConfig>(mapResourcesConfig.MapResources);
            if (config != null)
            {
                m_Projector.transform.localEulerAngles = config.Rotation;
                m_Projector.material.SetFloat("_Alpha", config.Intensity);
            }
        }
    }