2023-10-19 15:00:19 +08:00
|
|
|
|
using cfg.LevelCfg;
|
|
|
|
|
|
using System.Collections.Generic;
|
2023-11-17 13:14:55 +08:00
|
|
|
|
using Code.Scripts.Gameplay.Utils;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
using Cysharp.Threading.Tasks;
|
|
|
|
|
|
using Framework;
|
|
|
|
|
|
using Gameplay.AI;
|
2023-12-14 14:42:27 +08:00
|
|
|
|
using Gameplay.Area;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
using Gameplay.Buff;
|
|
|
|
|
|
using Gameplay.Character;
|
|
|
|
|
|
using Gameplay.Effect;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
using Gameplay.Emoji;
|
|
|
|
|
|
using Gameplay.Pool;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
using Gameplay.Skill;
|
2023-11-20 14:10:18 +08:00
|
|
|
|
using Gameplay.SubSystems;
|
2023-12-13 16:20:41 +08:00
|
|
|
|
using Gameplay.Unit;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
using Gameplay.Vehicle;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
using PhxhSDK;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
using UnityEngine;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
using Constants = Framework.Constants;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
|
|
|
|
|
namespace Gameplay.Level
|
|
|
|
|
|
{
|
|
|
|
|
|
public partial class Level : IUpdatable, ILoadable
|
|
|
|
|
|
{
|
2023-10-19 15:00:19 +08:00
|
|
|
|
private int _id;
|
|
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
private LevelData _levelData;
|
2023-11-20 14:10:18 +08:00
|
|
|
|
private LevelInfo _currLevelInfo;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
private Map _map;
|
|
|
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
|
private StateMachine _stateMachine = new StateMachine();
|
2023-08-22 19:08:45 +08:00
|
|
|
|
public bool isInBattle = false;
|
2023-12-26 18:19:05 +08:00
|
|
|
|
private object _param;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
|
|
|
|
|
|
public int ID => _id;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
public Map Map => _map;
|
2023-10-26 16:04:03 +08:00
|
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
|
public float LevelTime { set; get; }
|
|
|
|
|
|
|
2023-12-26 18:19:05 +08:00
|
|
|
|
public bool IsPvPLevel => _id == TableManager.Instance.Tables.GlobalConfig.PVPLevelID;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
|
2023-12-26 18:19:05 +08:00
|
|
|
|
public Level(int leveId, object param = null)
|
2023-08-22 19:08:45 +08:00
|
|
|
|
{
|
2023-10-19 15:00:19 +08:00
|
|
|
|
_id = leveId;
|
2023-12-26 18:19:05 +08:00
|
|
|
|
_param = param;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
Init();
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
|
private Dictionary<string, DataLevel> _configLevelDic = new Dictionary<string, DataLevel>();
|
|
|
|
|
|
public Dictionary<string, DataLevel> ConfigLevelDic => _configLevelDic;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
|
private void LoadConfigLevel()
|
2023-08-22 19:08:45 +08:00
|
|
|
|
{
|
2023-11-20 14:10:18 +08:00
|
|
|
|
_currLevelInfo = LevelManager.Instance.GetLevelInfoByID(_id);
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-11-20 14:10:18 +08:00
|
|
|
|
private async UniTask LoadScene()
|
|
|
|
|
|
{
|
|
|
|
|
|
await GameSceneManager.Instance.LoadSceneAsync(_currLevelInfo.LevelScene);
|
|
|
|
|
|
}
|
2023-12-26 18:19:05 +08:00
|
|
|
|
|
2023-11-21 15:04:56 +08:00
|
|
|
|
private async UniTask UnLoadScene()
|
|
|
|
|
|
{
|
|
|
|
|
|
await GameSceneManager.Instance.UnLoadSceneAsync(_currLevelInfo.LevelScene);
|
|
|
|
|
|
}
|
2023-12-26 18:19:05 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
private async UniTask LoadData()
|
|
|
|
|
|
{
|
2024-01-10 13:40:07 +08:00
|
|
|
|
_levelData = await _currLevelInfo.GetLevelData();
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private async UniTask LoadMap()
|
|
|
|
|
|
{
|
2023-11-20 14:10:18 +08:00
|
|
|
|
// if (_levelData != null)
|
|
|
|
|
|
// {
|
2023-12-26 18:19:05 +08:00
|
|
|
|
// if (_map != null)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// MapUtils.RemoveCameraController(CameraManager.Instance.MainCamera);
|
|
|
|
|
|
// MapUtils.UnLoadMap(_map);
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
2024-01-10 13:40:07 +08:00
|
|
|
|
_map = await MapUtils.LoadMap(await _currLevelInfo.GetMapData());
|
2024-01-02 14:52:37 +08:00
|
|
|
|
NLDSceneManager.Instance.SceneCamera.gameObject.SetActive(false);
|
|
|
|
|
|
MapUtils.BindCameraController(CameraManager.Instance.MainCamera, _map);
|
2023-11-20 14:10:18 +08:00
|
|
|
|
//}
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private async UniTask LoadNpc()
|
2023-12-26 18:19:05 +08:00
|
|
|
|
{
|
|
|
|
|
|
if (!IsPvPLevel)
|
|
|
|
|
|
await LoadNPCFromLevelData();
|
|
|
|
|
|
else
|
2023-12-26 18:41:50 +08:00
|
|
|
|
await LoadNPCFromPVPData();
|
2023-12-26 18:19:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private async UniTask LoadNPCFromLevelData()
|
2023-08-22 19:08:45 +08:00
|
|
|
|
{
|
|
|
|
|
|
if (_levelData != null && _map != null)
|
|
|
|
|
|
{
|
2023-10-19 15:00:19 +08:00
|
|
|
|
for (var i = 0; i < _levelData.npcInfos.Count; i++)
|
2023-08-22 19:08:45 +08:00
|
|
|
|
{
|
|
|
|
|
|
var npcInfo = _levelData.npcInfos[i];
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: LT:临时处理,后续需要根据配置来
|
|
|
|
|
|
var teamId = ETroopsId.Enemy1;
|
2023-12-14 14:42:27 +08:00
|
|
|
|
var cellIndex = _map.BlockPosition2TGSCellIndex(npcInfo.position);
|
2023-10-25 14:09:09 +08:00
|
|
|
|
var yaw = LevelUtils.SetCharaterToward(npcInfo.npcToward);
|
2023-12-26 18:19:05 +08:00
|
|
|
|
var npcCharacter =
|
|
|
|
|
|
await GameUnitManager.instance.PrepareNpc(npcInfo, teamId) as Character.Character;
|
2023-12-14 14:42:27 +08:00
|
|
|
|
if (npcCharacter == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("创建npc失败");
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
2023-12-26 18:19:05 +08:00
|
|
|
|
|
2023-12-14 14:42:27 +08:00
|
|
|
|
npcCharacter.runtimeData.characterLevelData = new CharacterLevelData()
|
2023-08-22 19:08:45 +08:00
|
|
|
|
{
|
|
|
|
|
|
AttachAIName = npcInfo.attachAIType,
|
|
|
|
|
|
AIName = npcInfo.aIType,
|
2023-10-19 15:00:19 +08:00
|
|
|
|
BornPosition = npcInfo.position,
|
2023-08-22 19:08:45 +08:00
|
|
|
|
NpcToward = npcInfo.npcToward,
|
2023-10-19 15:00:19 +08:00
|
|
|
|
PatrolInfos = npcInfo.patrolInfos
|
2023-08-22 19:08:45 +08:00
|
|
|
|
};
|
2023-12-26 18:19:05 +08:00
|
|
|
|
|
2024-01-10 15:52:53 +08:00
|
|
|
|
npcCharacter.transData.bornCellIndex = cellIndex;
|
2023-12-14 14:42:27 +08:00
|
|
|
|
GameUnitManager.instance.MoveUnitToFight(npcCharacter.GetID(), cellIndex, yaw);
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-26 18:41:50 +08:00
|
|
|
|
private async UniTask LoadNPCFromPVPData()
|
2023-12-26 18:19:05 +08:00
|
|
|
|
{
|
|
|
|
|
|
var pvpDefenderData = _param as PVPDefenderData;
|
|
|
|
|
|
if (pvpDefenderData == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("pvp参数不合法!");
|
2024-01-03 16:40:57 +08:00
|
|
|
|
return;
|
2023-12-26 18:19:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-27 13:57:32 +08:00
|
|
|
|
for (var i = 0; i < pvpDefenderData.pvpRuntimeUnitInfos.Count; i++)
|
2023-12-26 18:19:05 +08:00
|
|
|
|
{
|
2023-12-27 13:57:32 +08:00
|
|
|
|
var pvpUnitData = pvpDefenderData.pvpRuntimeUnitInfos[i];
|
|
|
|
|
|
//var id = (uint)pvpUnitData.unitID;
|
|
|
|
|
|
|
|
|
|
|
|
var position = _map.TGSCellIndex2BlockPosition(pvpUnitData.cellIndex);
|
2023-12-26 18:19:05 +08:00
|
|
|
|
var teamId = ETroopsId.Enemy1;
|
|
|
|
|
|
GameUnit unit = null;
|
|
|
|
|
|
switch (pvpUnitData.type)
|
|
|
|
|
|
{
|
|
|
|
|
|
case Framework.Wrapper.Unit.UnitType.Charactor:
|
2023-12-27 13:57:32 +08:00
|
|
|
|
var cInfo = new CharacterDataInfo();
|
|
|
|
|
|
cInfo.Refresh(pvpUnitData.characterInfo);
|
2023-12-26 18:19:05 +08:00
|
|
|
|
unit = await GameUnitManager.instance.PrepareCharacter(cInfo, teamId);
|
|
|
|
|
|
var character = (Character.Character)unit;
|
|
|
|
|
|
character.runtimeData.characterLevelData = new CharacterLevelData()
|
|
|
|
|
|
{
|
|
|
|
|
|
AttachAIName = pvpUnitData.attachAIType,
|
|
|
|
|
|
AIName = pvpUnitData.aiType,
|
2023-12-27 13:57:32 +08:00
|
|
|
|
BornPosition = position,
|
2023-12-26 18:19:05 +08:00
|
|
|
|
NpcToward = _levelData.pvpDefendToward,
|
|
|
|
|
|
PatrolInfos = new(),
|
|
|
|
|
|
};
|
|
|
|
|
|
break;
|
|
|
|
|
|
case Framework.Wrapper.Unit.UnitType.Vehicle:
|
2023-12-27 13:57:32 +08:00
|
|
|
|
//todo VehicleCultivateData第二个参数
|
|
|
|
|
|
var vInfo = new VehicleCultivateData();
|
|
|
|
|
|
vInfo.Refresh(pvpUnitData.vehicleInfo);
|
2023-12-26 18:19:05 +08:00
|
|
|
|
unit = await GameUnitManager.instance.PrepareVehicle(vInfo, teamId);
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (unit == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("创建pvp unit失败");
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-27 13:57:32 +08:00
|
|
|
|
|
2023-12-26 18:19:05 +08:00
|
|
|
|
var yaw = LevelUtils.SetCharaterToward(_levelData.pvpDefendToward);
|
2023-12-27 13:57:32 +08:00
|
|
|
|
GameUnitManager.instance.MoveUnitToFight(unit.GetID(), pvpUnitData.cellIndex, yaw);
|
2023-12-26 18:19:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-11-15 16:24:53 +08:00
|
|
|
|
// public void BindMap(Map map)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// if (map != null)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// _map = map;
|
|
|
|
|
|
// }
|
|
|
|
|
|
//
|
|
|
|
|
|
// if (_map.MapData.name.Equals(_levelData.mapName))
|
|
|
|
|
|
// {
|
|
|
|
|
|
// DebugUtil.LogError("{0}.{1} Error:map name not match", GetType(),
|
|
|
|
|
|
// System.Reflection.MethodBase.GetCurrentMethod()?.Name);
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
|
|
|
|
|
public void Update(float deltaTime)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!_isPause)
|
|
|
|
|
|
{
|
|
|
|
|
|
_stateMachine.Update(deltaTime * _speed);
|
2023-12-26 18:26:00 +08:00
|
|
|
|
// GameUnitManager.instance.LogicUpdate(deltaTime * _speed);
|
2023-08-22 19:08:45 +08:00
|
|
|
|
AIManager.Instance.Update(deltaTime * _speed);
|
|
|
|
|
|
SelecterView.Instance.Update(deltaTime * _speed);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 这里是 level system的初始化,不是 level 场景的初始化
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void Init()
|
|
|
|
|
|
{
|
|
|
|
|
|
AIManager.Instance.Init();
|
2023-10-19 15:00:19 +08:00
|
|
|
|
|
2023-12-14 14:42:27 +08:00
|
|
|
|
GameUnitManager.CreateInstance();
|
2023-10-19 15:00:19 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
SkillManager.CreateInstance();
|
|
|
|
|
|
BuffManager.CreateInstance();
|
2023-10-19 15:00:19 +08:00
|
|
|
|
EmojiManager.CreateInstance();
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Release()
|
|
|
|
|
|
{
|
2023-12-27 13:04:02 +08:00
|
|
|
|
AreaManager.instance.Dispose();
|
2023-10-19 15:00:19 +08:00
|
|
|
|
EmojiManager.inst.Dispose();
|
|
|
|
|
|
|
|
|
|
|
|
SkillManager.instance.Dispose();
|
|
|
|
|
|
BuffManager.instance.Dispose();
|
|
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
_stateMachine?.ChangeState(null);
|
|
|
|
|
|
|
|
|
|
|
|
AIManager.Instance.Release();
|
2023-10-19 15:00:19 +08:00
|
|
|
|
|
|
|
|
|
|
EffectManager.instance.ClearPool();
|
|
|
|
|
|
ObjPoolManager.instance.Clear();
|
2023-12-22 13:19:20 +08:00
|
|
|
|
//GameUnitManager.instance.Dispose();
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public async UniTask Load()
|
|
|
|
|
|
{
|
2023-10-19 15:00:19 +08:00
|
|
|
|
LoadConfigLevel();
|
2023-12-26 18:19:05 +08:00
|
|
|
|
|
2023-12-14 14:42:27 +08:00
|
|
|
|
// GameUnitManager.instance.PrepareUnits();
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
2023-11-20 14:10:18 +08:00
|
|
|
|
await LoadScene();
|
2023-08-22 19:08:45 +08:00
|
|
|
|
await LoadData();
|
|
|
|
|
|
await LoadMap();
|
|
|
|
|
|
|
|
|
|
|
|
await _InitAfterLoadMap();
|
|
|
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
|
await _LoadOthers();
|
|
|
|
|
|
|
2023-12-14 14:42:27 +08:00
|
|
|
|
await LoadNpc();
|
|
|
|
|
|
|
2023-11-17 13:14:55 +08:00
|
|
|
|
_SetShadows();
|
|
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
RegisterAllEvent();
|
2023-11-06 18:20:55 +08:00
|
|
|
|
InitRules();
|
2023-08-22 19:08:45 +08:00
|
|
|
|
_stateMachine.ChangeState(new PrepareState(this));
|
|
|
|
|
|
SelecterView.Instance.Init();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-11-17 13:14:55 +08:00
|
|
|
|
private void _SetShadows()
|
|
|
|
|
|
{
|
2023-11-20 14:10:18 +08:00
|
|
|
|
var setDistance = _currLevelInfo.ShadowDistance;
|
2023-11-17 13:14:55 +08:00
|
|
|
|
ShadowEx.SetShadowDistance(setDistance);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
|
private async UniTask _LoadOthers()
|
|
|
|
|
|
{
|
|
|
|
|
|
AssetManager.Instance.PostPreload(Constants.TIREMARK_UNIT_PATH);
|
|
|
|
|
|
AssetManager.Instance.PostPreload(Constants.TIREMARK_MAT_PATH);
|
2023-10-25 13:59:08 +08:00
|
|
|
|
AssetManager.Instance.PostPreload(Constants.CHARACTER_SELECT_GROUND_GFX);
|
2023-10-27 13:59:26 +08:00
|
|
|
|
AssetManager.Instance.PostPreload(Constants.EMOJI_HEAD_MAT);
|
2023-10-19 15:00:19 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await AssetManager.Instance.WaitAllPreloads();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
private async UniTask _InitAfterLoadMap()
|
|
|
|
|
|
{
|
|
|
|
|
|
// 加载后处理
|
|
|
|
|
|
await _LoadPostProcess();
|
2023-12-26 18:19:05 +08:00
|
|
|
|
|
2023-12-14 14:42:27 +08:00
|
|
|
|
AreaManager.CreateInstance();
|
2023-10-19 15:00:19 +08:00
|
|
|
|
|
|
|
|
|
|
// 表情相关
|
|
|
|
|
|
AssetManager.Instance.PostPreload(Constants.EMOJI_PREFAB_PATH);
|
|
|
|
|
|
|
|
|
|
|
|
await AssetManager.Instance.WaitAllPreloads();
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private async UniTask _LoadPostProcess()
|
|
|
|
|
|
{
|
2023-10-19 15:00:19 +08:00
|
|
|
|
// 加载shader
|
|
|
|
|
|
AssetManager.Instance.PostPreload(Constants.SHADER_OUTLINE_PATH1);
|
|
|
|
|
|
AssetManager.Instance.PostPreload(Constants.SHADER_OUTLINE_PATH1_1);
|
|
|
|
|
|
AssetManager.Instance.PostPreload(Constants.SHADER_OUTLINE_PATH2);
|
|
|
|
|
|
AssetManager.Instance.PostPreload(Constants.SHADER_OUTLINE_PATH3);
|
|
|
|
|
|
await AssetManager.Instance.WaitAllPreloads();
|
|
|
|
|
|
var loadObj =
|
|
|
|
|
|
await AssetManager.Instance.LoadAssetAsync<GameObject>(Constants.OUTLINE_POSTPROCESS_PATH);
|
2023-08-22 19:08:45 +08:00
|
|
|
|
if (loadObj != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
Object.Instantiate(loadObj);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void BeginBattle()
|
|
|
|
|
|
{
|
|
|
|
|
|
_stateMachine.ChangeState(new BattleState(this));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool IsPreparing()
|
|
|
|
|
|
{
|
|
|
|
|
|
return _stateMachine.GetCurrentState() is PrepareState;
|
|
|
|
|
|
}
|
2023-10-19 15:00:19 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
public bool IsInBattle()
|
|
|
|
|
|
{
|
|
|
|
|
|
return isInBattle;
|
|
|
|
|
|
}
|
2023-10-19 15:00:19 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
public bool IsEnd()
|
|
|
|
|
|
{
|
|
|
|
|
|
return _stateMachine.GetCurrentState() is EndState;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-11-21 15:04:56 +08:00
|
|
|
|
public async UniTask Unload()
|
2023-08-22 19:08:45 +08:00
|
|
|
|
{
|
2024-01-02 14:52:37 +08:00
|
|
|
|
MapUtils.RemoveCameraController(CameraManager.Instance.MainCamera);
|
2023-10-19 15:00:19 +08:00
|
|
|
|
MapUtils.UnLoadMap(_map);
|
2023-08-22 19:08:45 +08:00
|
|
|
|
UnRegisterAllEvent();
|
2023-11-06 18:20:55 +08:00
|
|
|
|
ReleaseRules();
|
2023-08-22 19:08:45 +08:00
|
|
|
|
SelecterView.Instance.Release();
|
2023-11-21 15:04:56 +08:00
|
|
|
|
await UnLoadScene();
|
|
|
|
|
|
await UniTask.NextFrame();
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public LevelData GetLevelData()
|
|
|
|
|
|
{
|
|
|
|
|
|
return _levelData;
|
|
|
|
|
|
}
|
2023-10-19 15:00:19 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private const string DescKey = "LevelDesc{0}";
|
|
|
|
|
|
private const string NameKey = "LevelName{0}";
|
|
|
|
|
|
|
|
|
|
|
|
public string GetLevelName()
|
|
|
|
|
|
{
|
|
|
|
|
|
return StringManager.Instance.GetLocalizeTextByKey(string.Format(NameKey, _id));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string GetLevelDesc(LevelData levelData)
|
|
|
|
|
|
{
|
|
|
|
|
|
return StringManager.Instance.GetLocalizeTextByKey(string.Format(DescKey, _id));
|
|
|
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
2023-12-26 18:19:05 +08:00
|
|
|
|
}
|