2024-10-14 14:40:39 +08:00
|
|
|
|
using NLDPB;
|
2024-10-16 15:56:35 +08:00
|
|
|
|
using System;
|
2024-10-08 18:55:13 +08:00
|
|
|
|
using PhxhSDK;
|
|
|
|
|
|
using Gameplay;
|
|
|
|
|
|
using Framework;
|
2024-10-08 16:35:07 +08:00
|
|
|
|
using System.Linq;
|
2024-10-08 18:55:13 +08:00
|
|
|
|
using Gameplay.Net;
|
2024-10-08 11:01:38 +08:00
|
|
|
|
using cfg.CharacterCfg;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
using Cysharp.Threading.Tasks;
|
2024-10-08 18:55:13 +08:00
|
|
|
|
using System.Collections.Generic;
|
2024-10-18 16:35:31 +08:00
|
|
|
|
using Constants = Framework.Constants;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
|
2024-10-08 16:35:07 +08:00
|
|
|
|
public class TeamEditStoreData
|
|
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
public int TeamSelectID = 0;
|
2024-10-08 16:35:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-08 18:55:13 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 编队系统管理器
|
|
|
|
|
|
/// </summary>
|
2024-10-15 16:30:20 +08:00
|
|
|
|
public class TeamEditManager : Singlenton<TeamEditManager>, IInitable
|
2024-10-08 18:55:13 +08:00
|
|
|
|
{
|
|
|
|
|
|
#region 常量
|
|
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
public const int MaxTeamCount = 10;
|
2024-10-08 18:55:13 +08:00
|
|
|
|
private const int DefaultConductorID = 0;
|
|
|
|
|
|
private const string DefaultTeamIndex = "DefaultTeamIndex";
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 私有成员变量
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 队伍列表
|
|
|
|
|
|
/// </summary>
|
2024-10-15 16:30:20 +08:00
|
|
|
|
private List<Team> _teamList;
|
2024-10-08 18:55:13 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 选择队伍
|
|
|
|
|
|
/// </summary>
|
2024-10-15 16:30:20 +08:00
|
|
|
|
private Team _selectTeam;
|
2024-10-08 18:55:13 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 选择队伍索引
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private int _selectTeamIdx;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 当前节点
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private TeamPreviewNode _teamPreviewNode;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 展示节点列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly List<string> previewNodeOpenList = new();
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 成员变量
|
|
|
|
|
|
|
2024-10-18 16:35:31 +08:00
|
|
|
|
public int VehicleBgmID = -1;
|
2024-10-15 16:30:20 +08:00
|
|
|
|
public List<Team> TeamList => _teamList;
|
2024-10-08 18:55:13 +08:00
|
|
|
|
public TeamPreviewNode TeamPreviewNode => _teamPreviewNode;
|
|
|
|
|
|
|
|
|
|
|
|
public int SelectTeamIdx
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
var teamStoreData = StorageMgr.Instance.GetStorage<TeamEditStoreData>(DefaultTeamIndex);
|
|
|
|
|
|
if (_selectTeamIdx > 0) return _selectTeamIdx;
|
|
|
|
|
|
if (teamStoreData != null)
|
|
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
_selectTeamIdx = teamStoreData.TeamSelectID;
|
2024-10-08 18:55:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return _selectTeamIdx;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 初始化与释放
|
|
|
|
|
|
|
|
|
|
|
|
void IInitable.Init()
|
|
|
|
|
|
{
|
2024-10-15 16:30:20 +08:00
|
|
|
|
_teamList = new List<Team>();
|
2024-10-08 18:55:13 +08:00
|
|
|
|
EventManager.Instance.Register(EventManager.EventName.TeamEditCreateSucc, OnTeamUpdate);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void IInitable.Release()
|
|
|
|
|
|
{
|
|
|
|
|
|
_teamList.Clear();
|
|
|
|
|
|
EventManager.Instance.Unregister(EventManager.EventName.TeamEditCreateSucc, OnTeamUpdate);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 对外方法
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 刷新队伍列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void RefreshTeams()
|
|
|
|
|
|
{
|
|
|
|
|
|
RefreshOwnTeams();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取当前选择队伍
|
|
|
|
|
|
/// </summary>
|
2024-10-15 16:30:20 +08:00
|
|
|
|
public Team GetSelectTeam()
|
2024-10-08 18:55:13 +08:00
|
|
|
|
{
|
|
|
|
|
|
if (_teamList.Count == 0)
|
|
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
DebugUtil.LogError("当前没有任何编队,返回测试编队");
|
|
|
|
|
|
return GetTestTeam();
|
2024-10-08 18:55:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_selectTeam = GetTeamByIndex(_selectTeamIdx);
|
|
|
|
|
|
return _selectTeam;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 根据索引获取队伍
|
|
|
|
|
|
/// </summary>
|
2024-10-15 16:30:20 +08:00
|
|
|
|
public Team GetTeamByIndex(int idx)
|
2024-10-08 18:55:13 +08:00
|
|
|
|
{
|
|
|
|
|
|
if (_teamList.Count == 0)
|
|
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
DebugUtil.LogError("当前没有任何编队,返回测试编队");
|
|
|
|
|
|
return GetTestTeam();
|
2024-10-08 18:55:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return _teamList.FirstOrDefault(team => team.TeamIndex == idx);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置当前选择的队伍
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void SetSelectTeam(int idx)
|
|
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
2024-10-08 18:55:13 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
if (_teamList.Count <= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("----- 当前编队列表为空,请检查!!!-----");
|
|
|
|
|
|
}
|
2024-10-08 18:55:13 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
// DebugUtil.LogError("更换队伍:{0}", idx);
|
|
|
|
|
|
_selectTeamIdx = idx;
|
2024-10-08 18:55:13 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
foreach (var team in _teamList.Where(team => team.TeamIndex == idx))
|
|
|
|
|
|
{
|
|
|
|
|
|
_selectTeam = team;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var teamStoreData = StorageMgr.Instance.GetStorage<TeamEditStoreData>(DefaultTeamIndex);
|
|
|
|
|
|
if (teamStoreData != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
teamStoreData.TeamSelectID = _selectTeamIdx;
|
|
|
|
|
|
}
|
2024-10-08 18:55:13 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
StorageMgr.Instance.SyncForce = true;
|
2024-10-16 17:40:49 +08:00
|
|
|
|
EventManager.Instance.Send(EventManager.EventName.SetSelectTeam);
|
2024-10-16 15:56:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
2024-10-08 18:55:13 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
DebugUtil.LogError("TeamEditManager.SetSelectTeam Error, Team Index:{0}, Exception:{1}", idx, e);
|
2024-10-08 18:55:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-12 18:29:02 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 检查默认队伍是否合法
|
|
|
|
|
|
/// </summary>
|
2024-10-15 16:30:20 +08:00
|
|
|
|
public bool CheckTeamIsLegal(Team team)
|
2024-10-12 18:29:02 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
return team.TeamIndex != 0 || !team.IsMemberEmpty();
|
2024-10-12 18:29:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-08 18:55:13 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 保存队伍
|
|
|
|
|
|
/// </summary>
|
2024-10-15 16:30:20 +08:00
|
|
|
|
public void SaveTeam(Team team)
|
2024-10-08 18:55:13 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
2024-10-08 18:55:13 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
if (team == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2024-10-08 18:55:13 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
/*DebugUtil.LogWarning("保存的第{0}队的队名:{1},Icon:{2}, 指挥官:{3}", team.TeamIndex, team.Name, (uint)team.IconNumber,
|
|
|
|
|
|
team.Commander);
|
2024-10-11 15:22:03 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
foreach (var unit in team.GetUnitIDs())
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogWarning("及其保存的成员有:{0}", unit);
|
|
|
|
|
|
}*/
|
2024-10-12 13:47:47 +08:00
|
|
|
|
|
2024-10-16 19:40:37 +08:00
|
|
|
|
NetHelper.CreateTeam((uint)team.TeamIndex, team.Name, (uint)team.IconNumber, team.Commander,
|
2024-10-16 15:56:35 +08:00
|
|
|
|
team.GetUnitIDs(), team.GetPlayerSkillIDs());
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("TeamEditManager.SaveTeam Error, Exception:{0}", e);
|
|
|
|
|
|
}
|
2024-10-08 18:55:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 判断两只队伍是否相同
|
|
|
|
|
|
/// </summary>
|
2024-10-15 16:30:20 +08:00
|
|
|
|
public bool SameTeamContent(Team team1, Team team2)
|
2024-10-12 18:29:02 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!team1.Name.Equals(team2.Name)) return false;
|
|
|
|
|
|
if (team1.IconNumber != team2.IconNumber) return false;
|
|
|
|
|
|
if (team1.Commander != team2.Commander) return false;
|
|
|
|
|
|
|
|
|
|
|
|
var units1 = team1.GetUnitIDs();
|
|
|
|
|
|
var units2 = team2.GetUnitIDs();
|
|
|
|
|
|
for (var i = 0; i < units1.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (units1[i] != units2[i])
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
2024-10-12 18:29:02 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
2024-10-12 18:29:02 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
DebugUtil.LogError("TeamEditManager.SameTeamContent Error, Exception:{0}", e);
|
|
|
|
|
|
return false;
|
2024-10-12 18:29:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 通过索引更换Team
|
|
|
|
|
|
/// </summary>
|
2024-10-15 16:30:20 +08:00
|
|
|
|
public void ChangeTeamByIndex(int idx, Team team)
|
2024-10-12 18:29:02 +08:00
|
|
|
|
{
|
|
|
|
|
|
if (idx < 0 || idx >= _teamList.Count) return;
|
2024-10-15 16:30:20 +08:00
|
|
|
|
_teamList[idx] = new Team(idx, team.Name, team.IconNumber, team.Commander, team.GetUnitIDs(),
|
|
|
|
|
|
team.GetPlayerSkillIDs());
|
2024-10-12 18:29:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 通过索引清空恢复队伍
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void EmptyTeamByIndex(int idx)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (idx < 0 || idx >= _teamList.Count) return;
|
|
|
|
|
|
var defaultName = CommonUtils.GetLocalizeText("team_edit_default" + (idx + 1));
|
2024-10-15 16:30:20 +08:00
|
|
|
|
_teamList[idx] = new Team(idx, defaultName, Team.DefaultMark, 0, new List<uint>(),
|
2024-10-17 15:18:31 +08:00
|
|
|
|
new uint[] { Team.DefaultSkillID });
|
2024-10-12 18:29:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-18 16:35:31 +08:00
|
|
|
|
public void PlayVehicleBgm()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (_selectTeam.IsContainsVehicle() && VehicleBgmID == -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
VehicleBgmID = AudioManager.Instance.PlayAudio(Constants.Sound.TEAM_VEHICLE,
|
|
|
|
|
|
AudioCriManager.EPlayType.Music, null, true);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (VehicleBgmID != -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
CloseVehicleBgm();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void CloseVehicleBgm()
|
|
|
|
|
|
{
|
|
|
|
|
|
AudioManager.Instance.StopMusicById(Instance.VehicleBgmID);
|
|
|
|
|
|
VehicleBgmID = -1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-08 18:55:13 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 内部函数
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 刷新队伍列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void RefreshOwnTeams()
|
|
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
2024-10-08 18:55:13 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
_teamList.Clear();
|
|
|
|
|
|
var partTeam = Actor.Instance.Team;
|
|
|
|
|
|
var teamInfos = partTeam.Get();
|
|
|
|
|
|
if (teamInfos != null)
|
2024-10-08 18:55:13 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
for (var i = 0; i < teamInfos.Length; i++)
|
2024-10-08 18:55:13 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
var info = teamInfos[i];
|
|
|
|
|
|
var defaultName = CommonUtils.GetLocalizeText("team_edit_default" + (i + 1));
|
|
|
|
|
|
// 获取队伍不为空
|
|
|
|
|
|
if (info != null)
|
2024-10-08 18:55:13 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
var name = info.Name;
|
|
|
|
|
|
if (string.IsNullOrEmpty(name))
|
|
|
|
|
|
{
|
|
|
|
|
|
name = defaultName;
|
|
|
|
|
|
}
|
2024-10-16 19:08:00 +08:00
|
|
|
|
|
2024-10-16 18:10:09 +08:00
|
|
|
|
// 技能暂时处理为默认技能
|
|
|
|
|
|
uint[] skillIDs = { Team.DefaultSkillID };
|
|
|
|
|
|
CreateTeam(i, name, (int)info.Icon, info.Conductor, info.UnitIDs, skillIDs);
|
2024-10-16 15:56:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2024-10-16 18:10:09 +08:00
|
|
|
|
uint[] skillIDs = { Team.DefaultSkillID };
|
2024-10-16 15:56:35 +08:00
|
|
|
|
CreateTeam(i, defaultName, Team.DefaultMark, DefaultConductorID, new List<uint>(),
|
2024-10-16 18:10:09 +08:00
|
|
|
|
skillIDs);
|
2024-10-16 15:56:35 +08:00
|
|
|
|
}
|
2024-10-08 18:55:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
var storeData = StorageMgr.Instance.GetStorage<TeamEditStoreData>(DefaultTeamIndex);
|
|
|
|
|
|
var storeIdx = 0;
|
|
|
|
|
|
if (storeData != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
storeIdx = storeData.TeamSelectID;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_selectTeamIdx = storeIdx;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
2024-10-08 18:55:13 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
DebugUtil.LogError("TeamEditManager.RefreshOwnTeams Error, Exception:{0}", e);
|
2024-10-08 18:55:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 内部创建Team
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void CreateTeam(int idx, string name, int icon, uint conductor, List<uint> unitIDs, uint[] playerSkillIDs)
|
|
|
|
|
|
{
|
2024-10-12 12:53:47 +08:00
|
|
|
|
/*DebugUtil.LogError("队伍:{0},队伍名字:{1},图标:{2},指挥官:{3},成员数量:{4}", idx, name, icon, conductor, unitIDs.Count);
|
|
|
|
|
|
foreach (var unit in unitIDs)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("发过来的队伍成员:{0}", unit);
|
|
|
|
|
|
}*/
|
2024-10-11 15:22:03 +08:00
|
|
|
|
/*if (unitIDs != null)
|
2024-10-08 18:55:13 +08:00
|
|
|
|
{
|
|
|
|
|
|
// 检索不合法成员
|
|
|
|
|
|
var illegalIDs = unitIDs.Where(unit =>
|
|
|
|
|
|
unit != 0 && !vehicleDataDic.ContainsKey(unit) && !characterDataDic.ContainsKey(unit)).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var illegalID in illegalIDs)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (unitIDs.Contains(illegalID))
|
|
|
|
|
|
{
|
|
|
|
|
|
unitIDs.Remove(illegalID);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-11 15:22:03 +08:00
|
|
|
|
}*/
|
2024-10-15 16:30:20 +08:00
|
|
|
|
if (icon == Team.NoneID)
|
|
|
|
|
|
icon = Team.DefaultMark;
|
2024-10-08 18:55:13 +08:00
|
|
|
|
|
2024-10-11 15:22:03 +08:00
|
|
|
|
//DebugUtil.LogError("创建:{0},索引:{1},指挥官:{2}", name, idx, conductor);
|
2024-10-15 16:30:20 +08:00
|
|
|
|
_teamList.Add(new Team(idx, name, icon, conductor, unitIDs, playerSkillIDs));
|
2024-10-08 18:55:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 模型展示相关
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 加载队伍成员展示节点
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public async UniTask LoadTeamPreviewNode(int teamIdx, string openPanel = "")
|
|
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
2024-10-08 18:55:13 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
if (string.IsNullOrEmpty(openPanel))
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("----- 请传入打开TeamPreviewNode的界面名!!!-----");
|
|
|
|
|
|
}
|
2024-10-08 18:55:13 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
var isRefresh = _teamPreviewNode && previewNodeOpenList.Count > 0;
|
2024-10-08 18:55:13 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
if (!previewNodeOpenList.Contains(openPanel))
|
|
|
|
|
|
{
|
|
|
|
|
|
previewNodeOpenList.Add(openPanel);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (isRefresh)
|
|
|
|
|
|
{
|
|
|
|
|
|
RefreshPreviewNode(teamIdx);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2024-10-08 18:55:13 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
await LoadNewTeamPreviewNode(teamIdx);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
2024-10-08 18:55:13 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
DebugUtil.LogError("TeamEditManager.LoadTeamPreviewNode Error, Exception:{0}", e);
|
2024-10-08 18:55:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 释放展示节点
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void ReleaseTeamPreviewNode(string releasePanel)
|
|
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
2024-10-08 18:55:13 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
if (string.IsNullOrEmpty(releasePanel))
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2024-10-08 18:55:13 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
previewNodeOpenList.Remove(releasePanel);
|
2024-10-08 18:55:13 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
if (_teamPreviewNode && previewNodeOpenList.Count <= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
DoReleaseTeamPreviewNode();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
2024-10-08 18:55:13 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
DebugUtil.LogError("TeamEditManager.ReleaseTeamPreviewNode Error, Exception:{0}", e);
|
2024-10-08 18:55:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 强制释放
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void CompulsoryReleasePreviewNode()
|
|
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
previewNodeOpenList.Clear();
|
|
|
|
|
|
DoReleaseTeamPreviewNode();
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("TeamEditManager.CompulsoryReleasePreviewNode Error, Exception:{0}", e);
|
|
|
|
|
|
}
|
2024-10-08 18:55:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 通过队伍索引加载队伍展示节点
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private async UniTask LoadNewTeamPreviewNode(int teamIdx)
|
|
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
DoReleaseTeamPreviewNode();
|
2024-10-08 18:55:13 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
var team = _teamList[teamIdx];
|
|
|
|
|
|
var charIDs = team.GetAllCharacters().ToArray();
|
|
|
|
|
|
var vehicleIDs = team.GetVehicleIDs().ToArray();
|
|
|
|
|
|
var node = await TeamPreviewNode.LoadNode();
|
|
|
|
|
|
_teamPreviewNode = node;
|
|
|
|
|
|
node.SetData(teamIdx, charIDs, vehicleIDs);
|
|
|
|
|
|
node.CreateRt();
|
2024-10-17 13:37:53 +08:00
|
|
|
|
await node.Refresh();
|
2024-10-16 15:56:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("TeamEditManager.LoadNewTeamPreviewNode Error, TeamIndex:{1}, Exception:{0}", e,
|
|
|
|
|
|
teamIdx);
|
|
|
|
|
|
}
|
2024-10-08 18:55:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 通过队伍索引刷新队伍展示节点
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private async void RefreshPreviewNode(int teamIdx)
|
|
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!_teamPreviewNode) return;
|
|
|
|
|
|
var team = _teamList[teamIdx];
|
|
|
|
|
|
if (team == null) return;
|
|
|
|
|
|
|
|
|
|
|
|
var charIDs = team.GetAllCharacters().ToArray();
|
|
|
|
|
|
var vehicleIDs = team.GetVehicleIDs().ToArray();
|
|
|
|
|
|
_teamPreviewNode.SetData(teamIdx, charIDs, vehicleIDs);
|
2024-10-17 13:37:53 +08:00
|
|
|
|
await _teamPreviewNode.Refresh();
|
2024-10-16 15:56:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("TeamEditManager.RefreshPreviewNode Error, Exception:{0}", e);
|
|
|
|
|
|
}
|
2024-10-08 18:55:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 释放展示节点
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void DoReleaseTeamPreviewNode()
|
|
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
if (_teamPreviewNode)
|
|
|
|
|
|
{
|
|
|
|
|
|
TeamPreviewNode.ReleaseNode(_teamPreviewNode);
|
|
|
|
|
|
_teamPreviewNode = null;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
2024-10-08 18:55:13 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
DebugUtil.LogError("TeamEditManager.DoReleaseTeamPreviewNode Error, Exception:{0}", e);
|
2024-10-08 18:55:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 事件监听
|
|
|
|
|
|
|
|
|
|
|
|
private void OnTeamUpdate()
|
|
|
|
|
|
{
|
|
|
|
|
|
RefreshOwnTeams();
|
|
|
|
|
|
EventManager.Instance.Send(EventManager.EventName.TeamUpdate);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 测试队伍
|
|
|
|
|
|
|
2024-10-15 16:30:20 +08:00
|
|
|
|
public Team GetTestTeam()
|
2024-10-08 18:55:13 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
var defalutIndex = 0;
|
|
|
|
|
|
var defaultName = CommonUtils.GetLocalizeText("team_edit_default" + defalutIndex);
|
|
|
|
|
|
var defaultIcon = TableManager.Instance.Tables.GlobalConfig.DefaultTeamIcon;
|
|
|
|
|
|
var defaultCommander = (uint)TableManager.Instance.Tables.GlobalConfig.DefaultCommander;
|
|
|
|
|
|
var unitIDs = TableManager.Instance.Tables.GlobalConfig.DefaultUnitIDs.Select(id => (uint)id).ToList();
|
|
|
|
|
|
var skills = new uint[] { 911, 0, 0 };
|
|
|
|
|
|
return new Team(defalutIndex, defaultName, defaultIcon, defaultCommander, unitIDs, skills);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("TeamEditManager.GetTestTeam Error, Exception:{0}", e);
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
2024-10-08 18:55:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-08 16:35:07 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 队列类
|
|
|
|
|
|
/// </summary>
|
2024-10-15 16:30:20 +08:00
|
|
|
|
public class Team
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
2024-10-11 15:22:03 +08:00
|
|
|
|
public const int ConductorIndex = -1;
|
|
|
|
|
|
public const uint NoneID = 0;
|
2024-10-12 14:33:24 +08:00
|
|
|
|
public const int DefaultMark = 510001;
|
2024-10-16 18:10:09 +08:00
|
|
|
|
public const int DefaultSkillID = 911;
|
2024-10-08 16:35:07 +08:00
|
|
|
|
|
|
|
|
|
|
#region 私有成员变量
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 队伍名称
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private string _name;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 队伍图标
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private int _icon;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 指挥官ID
|
|
|
|
|
|
/// </summary>
|
2024-10-11 15:22:03 +08:00
|
|
|
|
private uint _commander;
|
2024-10-08 16:35:07 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-10-17 13:37:53 +08:00
|
|
|
|
/// 队伍所有成员 (不包含指挥官)
|
2024-10-08 16:35:07 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
private List<uint> _unitIDs;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 队伍中角色成员
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private List<uint> _characterIDs;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 队伍中载具成员
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private List<uint> _vehicleIDs;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 角色技能
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private uint[] _playerSkillIDs;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 队伍索引
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private int _teamIdx;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 该队伍所花费领导力
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private int _allLeadership;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-10-11 15:22:03 +08:00
|
|
|
|
/// 指挥官所提供的列表
|
2024-10-08 16:35:07 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
private List<ProvideJob> _provideJob;
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 成员变量
|
|
|
|
|
|
|
2024-10-11 15:22:03 +08:00
|
|
|
|
public List<ProvideJob> ProvideJobs
|
2024-10-08 18:55:13 +08:00
|
|
|
|
{
|
2024-10-11 15:22:03 +08:00
|
|
|
|
get => _provideJob;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public uint Commander
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _commander;
|
2024-10-08 18:55:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-08 16:35:07 +08:00
|
|
|
|
public string Name
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _name;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int IconNumber
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _icon;
|
2024-10-12 14:33:24 +08:00
|
|
|
|
set => _icon = value;
|
2024-10-08 16:35:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int TeamIndex
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _teamIdx;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int AllLeaderShip
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _allLeadership;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-11 15:22:03 +08:00
|
|
|
|
public int ProvideJobCount
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
2024-10-14 12:39:42 +08:00
|
|
|
|
return _provideJob == null
|
2024-10-11 15:22:03 +08:00
|
|
|
|
? 0
|
|
|
|
|
|
: _provideJob.Count(job => job == cfg.CharacterCfg.ProvideJob.Job_Vehicle);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-08 16:35:07 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 构造函数
|
|
|
|
|
|
|
2024-10-15 16:30:20 +08:00
|
|
|
|
public Team(int teamIdx, string name, int icon, uint commander, List<uint> unitIDs, uint[] playerSkillIDs)
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
//DebugUtil.LogError("创建队伍:名字:{0},指挥官:{1},队标:{2}", name, commander, icon);
|
|
|
|
|
|
_teamIdx = teamIdx;
|
|
|
|
|
|
_name = name;
|
|
|
|
|
|
_icon = icon;
|
|
|
|
|
|
_commander = commander;
|
|
|
|
|
|
|
|
|
|
|
|
// 指挥合法
|
|
|
|
|
|
if (CheckConductorLegal(_commander) && unitIDs != null && unitIDs.Count > 0)
|
2024-10-11 15:22:03 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
_provideJob = CharacterDataInfoManager.Instance.GetCharacterInfo(_commander).Cfg.ProvideJob.ToList();
|
|
|
|
|
|
if (CheckTeamLegal(unitIDs))
|
|
|
|
|
|
{
|
|
|
|
|
|
_unitIDs = unitIDs;
|
|
|
|
|
|
//DebugUtil.LogError("有成员数量:{0}",unitIDs.Count);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
_unitIDs = new List<uint>();
|
|
|
|
|
|
foreach (var job in ProvideJobs)
|
|
|
|
|
|
{
|
|
|
|
|
|
_unitIDs.Add(NoneID);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-11 15:22:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
_commander = NoneID;
|
2024-10-11 15:22:03 +08:00
|
|
|
|
_unitIDs = new List<uint>();
|
2024-10-16 15:56:35 +08:00
|
|
|
|
_provideJob = new List<ProvideJob>();
|
2024-10-11 15:22:03 +08:00
|
|
|
|
}
|
2024-10-08 16:35:07 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
PartUnits();
|
|
|
|
|
|
RefreshSpendLeadership();
|
2024-10-08 16:35:07 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
// 技能
|
|
|
|
|
|
uint[] tempSkillIDs = { NoneID, NoneID, NoneID };
|
|
|
|
|
|
// 判断一下传入的技能列表是否达到固定长度,未达到后面添加0到满足固定长度
|
|
|
|
|
|
if (playerSkillIDs.Length < CommandSkillManager.COMMAND_SKILL_COUNT)
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
for (var i = 0; i < tempSkillIDs.Length; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (i < playerSkillIDs.Length)
|
|
|
|
|
|
tempSkillIDs[i] = playerSkillIDs[i];
|
|
|
|
|
|
}
|
2024-10-08 16:35:07 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
_playerSkillIDs = tempSkillIDs;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
_playerSkillIDs = (uint[])playerSkillIDs.Clone();
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("Team 构造函数 Error, Team Index:{0}, name:{1}, icon:{2}, commander:{3}, Exception:{4}",
|
|
|
|
|
|
teamIdx, name, icon, commander, e);
|
2024-10-08 16:35:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-15 16:30:20 +08:00
|
|
|
|
private Team()
|
2024-10-12 18:29:02 +08:00
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-08 16:35:07 +08:00
|
|
|
|
#endregion
|
2024-10-08 18:55:13 +08:00
|
|
|
|
|
2024-10-08 16:35:07 +08:00
|
|
|
|
#region 编辑队伍成员
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 上阵角色
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="idx">角色在队伍中的索引</param>
|
|
|
|
|
|
/// <param name="id">角色ID</param>
|
2024-10-18 15:50:53 +08:00
|
|
|
|
public async void DoCharacterUp(int idx, uint id = 0)
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
if (_unitIDs == null || _characterIDs == null) return;
|
|
|
|
|
|
if (idx == ConductorIndex)
|
|
|
|
|
|
{
|
|
|
|
|
|
DoCommanderUp(id);
|
|
|
|
|
|
AudioManager.Instance.StopAllSpeaks();
|
|
|
|
|
|
DialogueManager.Instance.PlayDiaogue((int)id, cfg.DialogueCfg.E_DialogueType.FightChoose);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2024-10-08 16:35:07 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
// 该索引不存在
|
|
|
|
|
|
if (idx >= _unitIDs.Count) return;
|
2024-10-11 15:22:03 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
// 替换队内角色
|
|
|
|
|
|
if (IsUnitInTeam(id))
|
2024-10-11 15:22:03 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
var oldIndex = _unitIDs.IndexOf(id);
|
|
|
|
|
|
if (oldIndex >= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
_unitIDs[oldIndex] = NoneID;
|
|
|
|
|
|
_characterIDs[oldIndex] = NoneID;
|
|
|
|
|
|
}
|
2024-10-11 15:22:03 +08:00
|
|
|
|
}
|
2024-10-08 16:35:07 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
_characterIDs[idx] = id;
|
|
|
|
|
|
_unitIDs[idx] = id;
|
|
|
|
|
|
//DebugUtil.LogError("在{0}位置换成{1}", idx, id);
|
2024-10-12 12:53:47 +08:00
|
|
|
|
|
2024-10-18 15:50:53 +08:00
|
|
|
|
AudioManager.Instance.PlayAudio(Framework.Constants.Sound.TEAM_INFO_CLICK);
|
|
|
|
|
|
await UniTask.WaitForSeconds(0.3f);
|
2024-10-16 15:56:35 +08:00
|
|
|
|
AudioManager.Instance.StopAllSpeaks();
|
|
|
|
|
|
DialogueManager.Instance.PlayDiaogue((int)id, cfg.DialogueCfg.E_DialogueType.FightChoose);
|
2024-10-14 15:58:07 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
RefreshSpendLeadership();
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("Team.DoCharacterUp, CharacterIndex:{0}, CharacterID:{1}, Exception:{2}", idx, id, e);
|
|
|
|
|
|
}
|
2024-10-08 16:35:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 通过索引下阵角色 (直接点空角色)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="idx">角色在队伍中的索引</param>
|
|
|
|
|
|
public void DoCharacterDown(int idx)
|
|
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
if (idx == ConductorIndex)
|
|
|
|
|
|
{
|
|
|
|
|
|
DoCommanderDown();
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2024-10-08 16:35:07 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
if (_unitIDs == null || _characterIDs == null) return;
|
2024-10-08 16:35:07 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
if (idx >= _unitIDs.Count)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("队伍{0}下阵角色时索引{1}错误", _teamIdx, idx);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2024-10-08 16:35:07 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
var oldCharacter = _unitIDs[idx];
|
|
|
|
|
|
_unitIDs[idx] = 0;
|
2024-10-11 15:22:03 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
var idxCharacter = _characterIDs.IndexOf(oldCharacter);
|
|
|
|
|
|
if (idxCharacter >= 0)
|
|
|
|
|
|
_characterIDs[idxCharacter] = 0;
|
2024-10-12 12:53:47 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
RefreshSpendLeadership();
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("Team.DoCharacterDown with Index, CharacterIndex:{0}, Exception:{1}", idx, e);
|
|
|
|
|
|
}
|
2024-10-08 16:35:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 通过ID下阵角色 (更换)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="id">角色ID</param>
|
|
|
|
|
|
public void DoCharacterDown(uint id)
|
|
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
if (_unitIDs == null || _characterIDs == null) return;
|
|
|
|
|
|
if (id >= _unitIDs.Count) return;
|
2024-10-11 15:22:03 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
var idxUnits = _unitIDs.IndexOf(id);
|
|
|
|
|
|
_unitIDs[idxUnits] = 0;
|
2024-10-11 15:22:03 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
var idxCharacter = _characterIDs.IndexOf(id);
|
|
|
|
|
|
if (idxCharacter >= 0)
|
|
|
|
|
|
_characterIDs[idxCharacter] = 0;
|
|
|
|
|
|
RefreshSpendLeadership();
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("Team.DoCharacterDown with ID, CharacterID:{0}, Exception:{1}", id, e);
|
|
|
|
|
|
}
|
2024-10-08 16:35:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 上阵载具
|
|
|
|
|
|
/// </summary>
|
2024-10-11 15:22:03 +08:00
|
|
|
|
/// <param name="idx">载具在队伍中的索引 载具排在角色后面</param>
|
2024-10-08 16:35:07 +08:00
|
|
|
|
/// <param name="id">载具ID</param>
|
|
|
|
|
|
public void DoVehicleUp(int idx, uint id = 0)
|
|
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
if (_unitIDs == null || _vehicleIDs == null) return;
|
|
|
|
|
|
|
|
|
|
|
|
if (IsUnitInTeam(id))
|
|
|
|
|
|
{
|
|
|
|
|
|
var unitIndex = _unitIDs.IndexOf(id);
|
|
|
|
|
|
var vehicleIndex = _vehicleIDs.IndexOf(id);
|
|
|
|
|
|
|
|
|
|
|
|
_unitIDs[unitIndex] = NoneID;
|
|
|
|
|
|
_vehicleIDs[vehicleIndex] = NoneID;
|
2024-10-11 15:22:03 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
// 添加到新位置
|
|
|
|
|
|
var newVehicleIndex = idx - _characterIDs.Count;
|
|
|
|
|
|
if (newVehicleIndex < _vehicleIDs.Count)
|
|
|
|
|
|
_vehicleIDs[newVehicleIndex] = id;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
var oldVehicle = _unitIDs[idx];
|
|
|
|
|
|
var oldVehicleIndex = _vehicleIDs.IndexOf(oldVehicle);
|
|
|
|
|
|
if (oldVehicleIndex >= 0)
|
|
|
|
|
|
_vehicleIDs[oldVehicleIndex] = id;
|
2024-10-18 16:35:31 +08:00
|
|
|
|
TeamEditManager.Instance.PlayVehicleBgm();
|
2024-10-16 15:56:35 +08:00
|
|
|
|
}
|
2024-10-11 15:22:03 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
_unitIDs[idx] = id;
|
2024-10-08 16:35:07 +08:00
|
|
|
|
}
|
2024-10-16 15:56:35 +08:00
|
|
|
|
catch (Exception e)
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
DebugUtil.LogError("Team.DoVehicleUp, VehicleIndex:{0}, VehicleID:{1}, Exception:{2}", idx, id, e);
|
2024-10-08 16:35:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 通过索引下阵载具 (直接点空载具)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="idx">载具在队伍中的索引</param>
|
|
|
|
|
|
public void DoVehicleDown(int idx)
|
|
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
if (_unitIDs == null || _vehicleIDs == null) return;
|
2024-10-08 16:35:07 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
if (idx >= _unitIDs.Count)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("队伍{0}下阵载具时索引{1}错误", _teamIdx, idx);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2024-10-11 15:22:03 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
var oldVehicle = _unitIDs[idx];
|
|
|
|
|
|
var vehicleIndex = _vehicleIDs.IndexOf(oldVehicle);
|
|
|
|
|
|
//DebugUtil.LogError("传来的载具的索引{0},找到的载具索引:{1}",idx,vehicleIndex);
|
|
|
|
|
|
if (vehicleIndex >= 0)
|
|
|
|
|
|
_vehicleIDs[vehicleIndex] = 0;
|
|
|
|
|
|
|
|
|
|
|
|
_unitIDs[idx] = NoneID;
|
2024-10-18 16:35:31 +08:00
|
|
|
|
TeamEditManager.Instance.CloseVehicleBgm();
|
2024-10-16 15:56:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("Team.DoVehicleDown with Index, VehicleIndex:{0}, Exception:{1}", idx, e);
|
|
|
|
|
|
}
|
2024-10-08 16:35:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 通过ID下阵载具 (更换)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="id">载具ID</param>
|
|
|
|
|
|
public void DoVehicleDown(uint id)
|
|
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
if (_unitIDs == null || _vehicleIDs == null) return;
|
2024-10-11 15:22:03 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
if (id >= _unitIDs.Count) return;
|
|
|
|
|
|
var idxUnits = _unitIDs.IndexOf(id);
|
|
|
|
|
|
_unitIDs[idxUnits] = 0;
|
2024-10-11 15:22:03 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
var idxVehicle = _vehicleIDs.IndexOf(id);
|
|
|
|
|
|
if (idxVehicle >= 0)
|
|
|
|
|
|
_vehicleIDs[idxVehicle] = 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("Team.DoVehicleDown with ID, VehicleIndex:{0}, Exception:{1}", id, e);
|
|
|
|
|
|
}
|
2024-10-08 16:35:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
private async void DoCommanderUp(uint id)
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
_commander = id;
|
|
|
|
|
|
var info = CharacterDataInfoManager.Instance.GetCharacterInfo(id);
|
|
|
|
|
|
if (info == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2024-10-08 16:35:07 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
var jobs = info.Cfg.ProvideJob;
|
|
|
|
|
|
if (jobs.Length == 0)
|
2024-10-11 15:22:03 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
DebugUtil.LogError("该指挥 {0} 提供职业为空", id);
|
|
|
|
|
|
return;
|
2024-10-11 15:22:03 +08:00
|
|
|
|
}
|
2024-10-16 15:56:35 +08:00
|
|
|
|
|
|
|
|
|
|
_provideJob = jobs.ToList();
|
|
|
|
|
|
// 重置队伍
|
|
|
|
|
|
ResetUnits();
|
|
|
|
|
|
|
|
|
|
|
|
RefreshSpendLeadership();
|
|
|
|
|
|
|
|
|
|
|
|
// 刷新一下节点
|
|
|
|
|
|
await TeamEditManager.Instance.LoadTeamPreviewNode(_teamIdx, UINameConst.UI_TeamAndSkillSelect);
|
|
|
|
|
|
|
|
|
|
|
|
/*DebugUtil.LogError("------上指挥官后-----------");
|
|
|
|
|
|
foreach (var job in _unitIDs)
|
2024-10-11 15:22:03 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
DebugUtil.LogError("有:{0}", job);
|
2024-10-11 15:22:03 +08:00
|
|
|
|
}
|
2024-10-16 15:56:35 +08:00
|
|
|
|
DebugUtil.LogError("-----------------");*/
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("Team.DoCommanderUp, ID:{0}, Exception:{1}", id, e);
|
2024-10-11 15:22:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 下阵指挥官
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void DoCommanderDown()
|
2024-10-11 15:22:03 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
2024-10-11 15:22:03 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
ClearUnits();
|
2024-10-17 13:37:53 +08:00
|
|
|
|
EventManager.Instance.Send(EventManager.EventName.TeamEditAllModelClear);
|
2024-10-16 15:56:35 +08:00
|
|
|
|
_commander = NoneID;
|
|
|
|
|
|
RefreshSpendLeadership();
|
2024-10-11 15:22:03 +08:00
|
|
|
|
}
|
2024-10-16 15:56:35 +08:00
|
|
|
|
catch (Exception e)
|
2024-10-11 15:22:03 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
DebugUtil.LogError("Team.DoCommanderUp, Exception:{0}", e);
|
2024-10-11 15:22:03 +08:00
|
|
|
|
}
|
2024-10-16 15:56:35 +08:00
|
|
|
|
}
|
2024-10-11 15:22:03 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 更新该队伍花费的领导力
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void RefreshSpendLeadership()
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
if (_commander == NoneID)
|
|
|
|
|
|
{
|
|
|
|
|
|
_allLeadership = 0;
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2024-10-11 15:22:03 +08:00
|
|
|
|
|
2024-10-18 12:26:36 +08:00
|
|
|
|
_allLeadership = 0;
|
2024-10-16 15:56:35 +08:00
|
|
|
|
foreach (var unitID in _unitIDs)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (unitID == NoneID)
|
|
|
|
|
|
continue;
|
|
|
|
|
|
if (VehicleCultivateDataManager.Instance.DataDic.ContainsKey(unitID))
|
|
|
|
|
|
{
|
|
|
|
|
|
_allLeadership += VehicleCultivateDataManager.Instance.GetSpendLeadership(unitID);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
_allLeadership += CharacterDataInfoManager.Instance.GetSpendLeadership(unitID);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-11 15:22:03 +08:00
|
|
|
|
|
2024-10-21 15:56:09 +08:00
|
|
|
|
EventManager.Instance.Send(EventManager.EventName.TeamLeadershipUpdate);
|
2024-10-16 15:56:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
2024-10-11 15:22:03 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
DebugUtil.LogError("Team.RefreshSpendLeadership, Exception:{0}", e);
|
2024-10-11 15:22:03 +08:00
|
|
|
|
}
|
2024-10-08 11:01:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-08 16:35:07 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 技能相关
|
|
|
|
|
|
|
2024-10-08 11:01:38 +08:00
|
|
|
|
/// <summary>
|
2024-10-08 16:35:07 +08:00
|
|
|
|
/// 更换技能
|
2024-10-08 11:01:38 +08:00
|
|
|
|
/// </summary>
|
2024-10-08 16:35:07 +08:00
|
|
|
|
public void ChangeSkill(int index, uint skillId)
|
2024-10-08 11:01:38 +08:00
|
|
|
|
{
|
2024-10-08 16:35:07 +08:00
|
|
|
|
if (_playerSkillIDs == null)
|
2024-10-08 11:01:38 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
DebugUtil.LogError("技能列表为空");
|
2024-10-08 16:35:07 +08:00
|
|
|
|
return;
|
2024-10-08 11:01:38 +08:00
|
|
|
|
}
|
2024-10-08 16:35:07 +08:00
|
|
|
|
|
|
|
|
|
|
if (index >= _playerSkillIDs.Length)
|
|
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
DebugUtil.LogError("传入索引越界错误,index:{0}", index);
|
2024-10-08 16:35:07 +08:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_playerSkillIDs[index] = skillId;
|
2024-10-08 11:01:38 +08:00
|
|
|
|
}
|
2023-11-07 15:12:31 +08:00
|
|
|
|
|
2024-10-08 16:35:07 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 修改队伍属性相关
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 更改队伍名称
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void ChangeName(string newName)
|
|
|
|
|
|
{
|
|
|
|
|
|
_name = newName;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 对外方法
|
|
|
|
|
|
|
2024-10-11 15:22:03 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取提供职业
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public List<ProvideJob> GetProvideJobs()
|
|
|
|
|
|
{
|
|
|
|
|
|
return _provideJob;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-08 16:35:07 +08:00
|
|
|
|
/// <summary>
|
2024-10-17 13:37:53 +08:00
|
|
|
|
/// 获取队伍成员 (不包含指挥官)
|
2024-10-08 16:35:07 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public List<uint> GetUnitIDs()
|
|
|
|
|
|
{
|
|
|
|
|
|
return _unitIDs;
|
|
|
|
|
|
}
|
2024-10-18 16:35:31 +08:00
|
|
|
|
|
2024-10-08 16:35:07 +08:00
|
|
|
|
/// <summary>
|
2024-10-17 13:37:53 +08:00
|
|
|
|
/// 获得队伍成员 (包含指挥官)
|
2024-10-08 16:35:07 +08:00
|
|
|
|
/// </summary>
|
2024-10-17 13:37:53 +08:00
|
|
|
|
public List<uint> GetUintIDsIncludeCommander()
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
2024-10-17 13:37:53 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
var allUints = new List<uint> { _commander };
|
|
|
|
|
|
allUints.AddRange(_vehicleIDs);
|
|
|
|
|
|
allUints.AddRange(_characterIDs);
|
|
|
|
|
|
return allUints;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("Team.GetAllCharacters Error, Exception:{0}", e);
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
2024-10-08 16:35:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-10-17 13:37:53 +08:00
|
|
|
|
/// 获取队伍载具
|
2024-10-08 16:35:07 +08:00
|
|
|
|
/// </summary>
|
2024-10-17 13:37:53 +08:00
|
|
|
|
public List<uint> GetVehicleIDs()
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
2024-10-17 13:37:53 +08:00
|
|
|
|
return _vehicleIDs;
|
2024-10-08 16:35:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-11 15:22:03 +08:00
|
|
|
|
/// <summary>
|
2024-10-17 13:37:53 +08:00
|
|
|
|
/// 获取队伍角色 (不包含指挥官)
|
2024-10-11 15:22:03 +08:00
|
|
|
|
/// </summary>
|
2024-10-17 13:37:53 +08:00
|
|
|
|
public List<uint> GetAllCharactersButCommander()
|
2024-10-11 15:22:03 +08:00
|
|
|
|
{
|
2024-10-17 13:37:53 +08:00
|
|
|
|
return _characterIDs;
|
2024-10-11 15:22:03 +08:00
|
|
|
|
}
|
2024-10-18 16:35:31 +08:00
|
|
|
|
|
2024-10-08 16:35:07 +08:00
|
|
|
|
/// <summary>
|
2024-10-17 13:37:53 +08:00
|
|
|
|
/// 获得所有角色 (包括指挥官)
|
2024-10-08 16:35:07 +08:00
|
|
|
|
/// </summary>
|
2024-10-16 15:56:35 +08:00
|
|
|
|
public List<uint> GetAllCharacters()
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
var characters = new List<uint>();
|
|
|
|
|
|
characters.Add(_commander);
|
|
|
|
|
|
foreach (var id in _characterIDs)
|
|
|
|
|
|
{
|
|
|
|
|
|
characters.Add(id);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return characters;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("Team.GetAllCharacters Error, Exception:{0}", e);
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
2024-10-08 16:35:07 +08:00
|
|
|
|
}
|
2024-10-18 16:35:31 +08:00
|
|
|
|
|
2024-10-08 16:35:07 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 队伍成员是否全为空
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool IsMemberEmpty()
|
|
|
|
|
|
{
|
|
|
|
|
|
// 只根据指挥判断
|
2024-10-11 15:22:03 +08:00
|
|
|
|
return _commander == NoneID;
|
2024-10-08 16:35:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-14 14:40:39 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 队伍领导力是否超过等级领导力
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public bool IsOverLeadership()
|
|
|
|
|
|
{
|
|
|
|
|
|
var level = Actor.Instance.Base.GetProp(ActorProp.Level);
|
|
|
|
|
|
var actorCfg = ActorLevelTableHelper.Instance.Get((int)level);
|
|
|
|
|
|
var leadership = actorCfg.Leadership;
|
|
|
|
|
|
return leadership < _allLeadership;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-08 16:35:07 +08:00
|
|
|
|
/// <summary>
|
2024-10-12 16:46:49 +08:00
|
|
|
|
/// 判断队伍中是否包含某成员(不含指挥)
|
2024-10-08 16:35:07 +08:00
|
|
|
|
/// </summary>
|
2024-10-11 15:22:03 +08:00
|
|
|
|
public bool IsUnitInTeam(uint id)
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
|
|
|
|
|
return _unitIDs.Contains(id);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-12 16:46:49 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 判断队伍中是否包含某成员(含指挥)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool IsInTeam(uint id)
|
|
|
|
|
|
{
|
|
|
|
|
|
var team = GetAllCharacters();
|
|
|
|
|
|
return team.Contains(id);
|
|
|
|
|
|
}
|
2024-10-18 16:35:31 +08:00
|
|
|
|
|
2024-10-17 13:37:53 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取指挥官技能id
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public uint[] GetPlayerSkillIDs()
|
|
|
|
|
|
{
|
|
|
|
|
|
return _playerSkillIDs;
|
|
|
|
|
|
}
|
2024-10-12 16:46:49 +08:00
|
|
|
|
|
2024-10-08 16:35:07 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 判断是否包含某个技能
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool IsSkillInTeam(uint id, ref int index)
|
|
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
for (var i = 0; i < _playerSkillIDs.Length; ++i)
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
|
|
|
|
|
if (id == _playerSkillIDs[i])
|
|
|
|
|
|
{
|
|
|
|
|
|
index = i;
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-10-12 13:47:47 +08:00
|
|
|
|
/// 获取所有角色数量
|
2024-10-08 16:35:07 +08:00
|
|
|
|
/// </summary>
|
2024-10-12 13:47:47 +08:00
|
|
|
|
public int GetAllCharacterCount()
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
2024-10-11 15:22:03 +08:00
|
|
|
|
return GetAllCharacters()?.Count ?? 0;
|
2024-10-08 16:35:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-16 19:08:00 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 通过ID获取角色在所有单位中的索引
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int GetCharacterIdxInAllUnits(uint id)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (id != NoneID)
|
2024-10-17 13:37:53 +08:00
|
|
|
|
return GetUintIDsIncludeCommander().IndexOf(id);
|
2024-10-16 19:08:00 +08:00
|
|
|
|
return -1;
|
|
|
|
|
|
}
|
2024-10-17 13:37:53 +08:00
|
|
|
|
|
2024-10-16 19:08:00 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 通过ID获取载具在所有单位中的索引
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int GetVehicleIdxInAllUnits(uint id)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (id != NoneID)
|
2024-10-17 13:37:53 +08:00
|
|
|
|
return GetUintIDsIncludeCommander().IndexOf(id);
|
2024-10-16 19:08:00 +08:00
|
|
|
|
return -1;
|
|
|
|
|
|
}
|
2024-10-17 13:37:53 +08:00
|
|
|
|
|
2024-10-08 16:35:07 +08:00
|
|
|
|
/// <summary>
|
2024-10-16 15:56:35 +08:00
|
|
|
|
/// 通过ID获取角色列表的索引(包含指挥官)
|
2024-10-08 16:35:07 +08:00
|
|
|
|
/// </summary>
|
2024-10-11 15:22:03 +08:00
|
|
|
|
public int GetAllCharacterIdx(uint id)
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
2024-10-11 15:22:03 +08:00
|
|
|
|
var characters = GetAllCharacters();
|
|
|
|
|
|
if (characters != null && id != NoneID)
|
|
|
|
|
|
return characters.IndexOf(id);
|
2024-10-08 16:35:07 +08:00
|
|
|
|
return -1;
|
|
|
|
|
|
}
|
2024-10-17 13:37:53 +08:00
|
|
|
|
|
2024-10-08 16:35:07 +08:00
|
|
|
|
/// <summary>
|
2024-10-16 19:08:00 +08:00
|
|
|
|
/// 通过ID获取载具列表的索引
|
2024-10-08 16:35:07 +08:00
|
|
|
|
/// </summary>
|
2024-10-16 19:08:00 +08:00
|
|
|
|
public int GetVehicleIdxInVehicles(uint id)
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
2024-10-11 15:22:03 +08:00
|
|
|
|
if (id != NoneID)
|
|
|
|
|
|
return _vehicleIDs.IndexOf(id);
|
2024-10-08 16:35:07 +08:00
|
|
|
|
return -1;
|
|
|
|
|
|
}
|
2024-10-17 13:37:53 +08:00
|
|
|
|
|
2024-10-11 15:22:03 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 通过units索引获取载具列表的索引
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int GetVehicleByUnitsIndex(int idx)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (idx < 0) return -1;
|
|
|
|
|
|
var vehicle = _unitIDs[idx];
|
|
|
|
|
|
return _vehicleIDs.IndexOf(vehicle);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-12 13:47:47 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 根据索引判断该位置是否为空角色
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool IsEmptyCharacter(int idx)
|
|
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
2024-10-12 13:47:47 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
if (idx == -1) return _commander == NoneID;
|
|
|
|
|
|
if (idx >= 0 && idx < _characterIDs.Count)
|
|
|
|
|
|
{
|
|
|
|
|
|
return _characterIDs[idx] == NoneID;
|
|
|
|
|
|
}
|
2024-10-12 13:47:47 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("Team.IsEmptyCharacter Error, Exception:{0}", e);
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
2024-10-12 13:47:47 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-18 16:35:31 +08:00
|
|
|
|
public bool IsContainsVehicle()
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var vehicle in _vehicleIDs)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (vehicle != NoneID)
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-15 16:30:20 +08:00
|
|
|
|
public Team Clone()
|
2024-10-12 18:29:02 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
return new Team(
|
|
|
|
|
|
_teamIdx,
|
|
|
|
|
|
_name,
|
|
|
|
|
|
_icon,
|
|
|
|
|
|
_commander,
|
|
|
|
|
|
new List<uint>(_unitIDs.Select(id => id)),
|
|
|
|
|
|
(uint[])_playerSkillIDs.Clone()
|
|
|
|
|
|
)
|
|
|
|
|
|
{
|
|
|
|
|
|
// 深拷贝其他字段
|
|
|
|
|
|
_characterIDs = new List<uint>(_characterIDs.Select(id => id)),
|
|
|
|
|
|
_vehicleIDs = new List<uint>(_vehicleIDs.Select(id => id)),
|
|
|
|
|
|
_allLeadership = _allLeadership,
|
|
|
|
|
|
_provideJob = new List<ProvideJob>(_provideJob.Select(job => job))
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
2024-10-12 18:29:02 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
DebugUtil.LogError("Team.Clone Error, Exception:{0}", e);
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
2024-10-12 18:29:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-15 20:05:34 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 清除队伍(但不保存)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void ClearTeam()
|
|
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
2024-10-15 20:05:34 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
_commander = NoneID;
|
2024-10-15 20:05:34 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
for (int i = 0; i < _unitIDs.Count; ++i)
|
|
|
|
|
|
{
|
|
|
|
|
|
_unitIDs[i] = NoneID;
|
|
|
|
|
|
}
|
2024-10-15 20:05:34 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
for (int i = 0; i < _characterIDs.Count; ++i)
|
|
|
|
|
|
{
|
|
|
|
|
|
_characterIDs[i] = NoneID;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < _vehicleIDs.Count; ++i)
|
|
|
|
|
|
{
|
|
|
|
|
|
_vehicleIDs[i] = NoneID;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
EventManager.Instance.Send(EventManager.EventName.TeamClear);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
2024-10-15 20:05:34 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
DebugUtil.LogError("Team.ClearTeam Error, Exception:{0}", e);
|
2024-10-15 20:05:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-16 15:56:35 +08:00
|
|
|
|
|
2024-10-08 16:35:07 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 内部函数
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 检查指挥官是否合法
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private bool CheckConductorLegal(uint conductorID)
|
|
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
if (conductorID == NoneID) return false;
|
|
|
|
|
|
var info = CharacterDataInfoManager.Instance.GetCharacterInfo(conductorID);
|
|
|
|
|
|
if (info == null)
|
|
|
|
|
|
return false;
|
|
|
|
|
|
return info.Cfg.Job == Ejob.Job_Commander;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("Team.CheckConductorLegal, CommanderID:{0}, Error, Exception:{1}", conductorID, e);
|
2024-10-08 16:35:07 +08:00
|
|
|
|
return false;
|
2024-10-16 15:56:35 +08:00
|
|
|
|
}
|
2024-10-08 16:35:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 检查队伍成员是否合法
|
|
|
|
|
|
/// </summary>
|
2024-10-11 15:22:03 +08:00
|
|
|
|
private bool CheckTeamLegal(List<uint> units)
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
2024-10-14 12:39:42 +08:00
|
|
|
|
if (units == null || units.Count <= 0) return false;
|
2024-10-08 16:35:07 +08:00
|
|
|
|
|
2024-10-11 18:51:10 +08:00
|
|
|
|
/*// 获取推荐职业
|
2024-10-11 15:22:03 +08:00
|
|
|
|
var jobs = CharacterDataInfoManager.Instance.GetCharacterInfo(_commander).Cfg.ProvideJob.ToList();
|
2024-10-11 18:51:10 +08:00
|
|
|
|
var index = 0;
|
|
|
|
|
|
if (jobs.Count != units.Count)
|
|
|
|
|
|
return false;
|
2024-10-08 16:35:07 +08:00
|
|
|
|
|
2024-10-11 15:22:03 +08:00
|
|
|
|
foreach (var unit in units)
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
2024-10-11 18:51:10 +08:00
|
|
|
|
if (jobs[index] == ProvideJob.Job_Unlimited)
|
|
|
|
|
|
{
|
|
|
|
|
|
index++;
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-11 15:22:03 +08:00
|
|
|
|
// 有角色职业不为指挥所提供
|
|
|
|
|
|
if (CharacterDataInfoManager.Instance.DataDic.ContainsKey(unit))
|
|
|
|
|
|
{
|
|
|
|
|
|
var job = CharacterDataInfoManager.Instance.GetCharacterJob(unit);
|
|
|
|
|
|
if (jobs.All(pJob => (int)pJob != (int)job))
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 有载具但是不为指挥所提供
|
|
|
|
|
|
if (VehicleCultivateDataManager.Instance.DataDic.ContainsKey(unit) &&
|
|
|
|
|
|
!jobs.Contains(ProvideJob.Job_Vehicle))
|
|
|
|
|
|
{
|
2024-10-08 16:35:07 +08:00
|
|
|
|
return false;
|
2024-10-11 15:22:03 +08:00
|
|
|
|
}
|
2024-10-11 18:51:10 +08:00
|
|
|
|
}*/
|
2024-10-08 16:35:07 +08:00
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-10-11 15:22:03 +08:00
|
|
|
|
/// 区分角色与载具
|
2024-10-08 16:35:07 +08:00
|
|
|
|
/// </summary>
|
2024-10-11 15:22:03 +08:00
|
|
|
|
private void PartUnits()
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
_characterIDs = new List<uint>();
|
|
|
|
|
|
_vehicleIDs = new List<uint>();
|
|
|
|
|
|
if (_provideJob?.Count <= 0) return;
|
|
|
|
|
|
var index = 0;
|
|
|
|
|
|
foreach (var unit in _unitIDs)
|
2024-10-12 19:53:06 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
if (index >= _provideJob.Count)
|
|
|
|
|
|
{
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
2024-10-12 19:53:06 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
//DebugUtil.LogError("索引「{0}」,推荐大小:「{1}」,units的大小:「{2}」", index, _provideJob.Count, _unitIDs.Count);
|
|
|
|
|
|
if (CharacterDataInfoManager.Instance.DataDic.ContainsKey(unit) ||
|
|
|
|
|
|
(unit == NoneID && _provideJob[index] != ProvideJob.Job_Vehicle))
|
|
|
|
|
|
{
|
|
|
|
|
|
//DebugUtil.LogError("添加角色:{0},其职业是:{1}", unit, _provideJob[index]);
|
|
|
|
|
|
_characterIDs.Add(unit);
|
|
|
|
|
|
}
|
2024-10-11 15:22:03 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
if (VehicleCultivateDataManager.Instance.DataDic.ContainsKey(unit) ||
|
|
|
|
|
|
(unit == NoneID && _provideJob[index] == ProvideJob.Job_Vehicle))
|
|
|
|
|
|
{
|
|
|
|
|
|
//DebugUtil.LogError("添加载具:{0},其职业是:{1}", unit, _provideJob[index]);
|
2024-10-11 15:22:03 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
_vehicleIDs.Add(unit);
|
|
|
|
|
|
}
|
2024-10-11 15:22:03 +08:00
|
|
|
|
|
2024-10-16 15:56:35 +08:00
|
|
|
|
index++;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("Team.PartUnits Error, Exception:{0}", e);
|
2024-10-08 16:35:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 清空队伍
|
|
|
|
|
|
/// </summary>
|
2024-10-11 15:22:03 +08:00
|
|
|
|
private void ClearUnits()
|
2024-10-08 16:35:07 +08:00
|
|
|
|
{
|
|
|
|
|
|
_unitIDs.Clear();
|
|
|
|
|
|
_characterIDs.Clear();
|
|
|
|
|
|
_vehicleIDs.Clear();
|
|
|
|
|
|
_provideJob.Clear();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-11 15:22:03 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 根据推荐职业重置队伍
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void ResetUnits()
|
|
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
try
|
2024-10-11 15:22:03 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
_unitIDs.Clear();
|
|
|
|
|
|
_characterIDs.Clear();
|
|
|
|
|
|
_vehicleIDs.Clear();
|
|
|
|
|
|
foreach (var job in ProvideJobs)
|
2024-10-11 15:22:03 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
// DebugUtil.LogError("指挥官更换后,提供的职业有:{0}", job);
|
|
|
|
|
|
_unitIDs.Add(NoneID);
|
|
|
|
|
|
if (job == ProvideJob.Job_Vehicle)
|
|
|
|
|
|
{
|
|
|
|
|
|
_vehicleIDs.Add(NoneID);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
_characterIDs.Add(NoneID);
|
|
|
|
|
|
}
|
2024-10-11 15:22:03 +08:00
|
|
|
|
}
|
2024-10-16 15:56:35 +08:00
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
DebugUtil.LogError("------更换指挥官后-----------");
|
|
|
|
|
|
foreach (var job in _provideJob)
|
2024-10-11 15:22:03 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
DebugUtil.LogError("职业有:{0}", job);
|
2024-10-11 15:22:03 +08:00
|
|
|
|
}
|
2024-10-16 15:56:35 +08:00
|
|
|
|
DebugUtil.LogError("-----------------");*/
|
2024-10-11 15:22:03 +08:00
|
|
|
|
}
|
2024-10-16 15:56:35 +08:00
|
|
|
|
catch (Exception e)
|
2024-10-11 15:22:03 +08:00
|
|
|
|
{
|
2024-10-16 15:56:35 +08:00
|
|
|
|
DebugUtil.LogError("Team.ResetUnits Error, Exception:{0}", e);
|
2024-10-11 15:22:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-08 16:35:07 +08:00
|
|
|
|
#endregion
|
2023-10-19 15:00:19 +08:00
|
|
|
|
}
|