2023-08-22 19:08:45 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
2024-09-30 12:21:25 +08:00
|
|
|
|
using System.Linq;
|
2024-10-28 13:27:21 +08:00
|
|
|
|
using cfg.CharacterCfg;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
using cfg.VehicleCfg;
|
|
|
|
|
|
using Cysharp.Threading.Tasks;
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
using Framework;
|
|
|
|
|
|
using Gameplay;
|
2023-12-18 16:14:18 +08:00
|
|
|
|
using Gameplay.Area;
|
|
|
|
|
|
using Gameplay.Area.Ready;
|
2023-12-14 16:14:30 +08:00
|
|
|
|
using Gameplay.Character;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
using Gameplay.Level;
|
2023-12-13 16:20:41 +08:00
|
|
|
|
using Gameplay.Unit;
|
|
|
|
|
|
using Gameplay.Unit.Data;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
using PhxhSDK;
|
|
|
|
|
|
using Constants = Framework.Constants;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
using EventManager = Framework.EventManager;
|
|
|
|
|
|
|
|
|
|
|
|
//队伍管理器
|
2024-03-20 19:58:18 +08:00
|
|
|
|
public partial class TeamManager
|
2023-08-22 19:08:45 +08:00
|
|
|
|
{
|
|
|
|
|
|
private static TeamManager m_instance;
|
|
|
|
|
|
private TeamManager()
|
|
|
|
|
|
{
|
2024-01-03 16:09:24 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-09-30 12:21:25 +08:00
|
|
|
|
public int TotalLimit
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return 7;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-10-19 15:00:19 +08:00
|
|
|
|
private const int FIGHT_LIMIT = 5;
|
2024-09-30 12:21:25 +08:00
|
|
|
|
private const int VEHICLE_FIGHT_LIMIT = 3;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
private const int WAIT_LIMIT = 7;
|
2024-05-24 12:10:41 +08:00
|
|
|
|
public const int TOTAL_LIMIT = 6;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
|
2023-12-07 16:16:28 +08:00
|
|
|
|
//指挥官技能
|
|
|
|
|
|
private CommandSkillManager _commonSkillMgr;
|
|
|
|
|
|
public CommandSkillManager CommonSkillMgr => _commonSkillMgr;
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
//进入时初始队列,队伍信息池
|
|
|
|
|
|
private Dictionary<uint, SingleTeamCharacterInfo> m_allCharactersMap;
|
|
|
|
|
|
private List<uint> m_allIDList;
|
|
|
|
|
|
//上阵角色ID队列
|
|
|
|
|
|
private List<uint> m_onFightIDList;
|
|
|
|
|
|
//下阵角色ID队列
|
|
|
|
|
|
private List<uint> m_waitFightIDList;
|
|
|
|
|
|
//死亡角色ID队列
|
|
|
|
|
|
private List<uint> m_deadIDList;
|
|
|
|
|
|
//敌方NPCID列表
|
|
|
|
|
|
private List<uint> m_enemyIDList;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
//载具上的成员
|
|
|
|
|
|
private List<uint> _inVehicleIDList;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
2023-12-14 14:47:14 +08:00
|
|
|
|
private int _lastVehicleCellIdx = Constants.INVALID_ID;
|
|
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
//当前选择ID
|
2023-12-18 16:14:18 +08:00
|
|
|
|
private uint m_selectID = Constants.INVALID_UINT_ID;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
//战斗进行时间,战斗开始时开始计时
|
|
|
|
|
|
private float m_fightPastTimeCount = 0;
|
|
|
|
|
|
|
|
|
|
|
|
private bool _isChanging = false;
|
|
|
|
|
|
|
2024-01-10 15:21:05 +08:00
|
|
|
|
private static bool _isHideAllUI = false;
|
|
|
|
|
|
|
|
|
|
|
|
public static bool IsHideAllUI
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return _isHideAllUI;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
_isHideAllUI = value;
|
|
|
|
|
|
if (_isHideAllUI)
|
|
|
|
|
|
{
|
2024-07-05 16:14:23 +08:00
|
|
|
|
UIManager.Instance.HideAllUI(UINameConst.UIFightScene, UINameConst.UI_Guide, UINameConst.UI_GuideTip);
|
2024-01-10 15:21:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
UIManager.Instance.ShowAllUI();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
public uint SelectID
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_selectID; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static TeamManager Instance
|
|
|
|
|
|
{
|
2023-12-18 16:14:18 +08:00
|
|
|
|
get
|
|
|
|
|
|
{
|
2023-08-22 19:08:45 +08:00
|
|
|
|
if (m_instance == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_instance = new TeamManager();
|
|
|
|
|
|
}
|
|
|
|
|
|
return m_instance;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-14 16:10:28 +08:00
|
|
|
|
public async void Init()
|
|
|
|
|
|
{
|
|
|
|
|
|
await _Init();
|
|
|
|
|
|
}
|
|
|
|
|
|
private async UniTask _Init()
|
|
|
|
|
|
{
|
2024-10-15 16:30:20 +08:00
|
|
|
|
Team team = TeamEditManager.Instance.GetSelectTeam();
|
2024-09-30 12:21:25 +08:00
|
|
|
|
if (SROptions.Current.UseTestTeam)
|
|
|
|
|
|
{
|
2024-10-15 16:30:20 +08:00
|
|
|
|
team = TeamEditManager.Instance.GetTestTeam();
|
2024-09-30 12:21:25 +08:00
|
|
|
|
}
|
2024-07-04 18:41:23 +08:00
|
|
|
|
if (null == team)
|
|
|
|
|
|
_commonSkillMgr = new CommandSkillManager();
|
|
|
|
|
|
else
|
|
|
|
|
|
_commonSkillMgr = new CommandSkillManager(team.GetPlayerSkillIDs());
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-12-14 16:10:28 +08:00
|
|
|
|
var selectList = await GetSelectList();
|
|
|
|
|
|
m_allIDList = new List<uint>();
|
|
|
|
|
|
m_waitFightIDList = new List<uint>();
|
|
|
|
|
|
m_allCharactersMap = new Dictionary<uint, SingleTeamCharacterInfo>();
|
|
|
|
|
|
m_onFightIDList = new List<uint>();
|
|
|
|
|
|
m_deadIDList = new List<uint>();
|
|
|
|
|
|
m_enemyIDList = new List<uint>();
|
|
|
|
|
|
_inVehicleIDList = new List<uint>();
|
|
|
|
|
|
for (int i = 0; i < selectList.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
uint uid = selectList[i].Uid;
|
|
|
|
|
|
m_allIDList.Add(uid);
|
|
|
|
|
|
m_allCharactersMap.Add(uid, selectList[i]);
|
|
|
|
|
|
if (selectList[i].IsVehicle())
|
|
|
|
|
|
{
|
|
|
|
|
|
m_waitFightIDList.Insert(0, uid);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
m_waitFightIDList.Add(uid);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private async UniTask<List<SingleTeamCharacterInfo>> GetSelectList()
|
|
|
|
|
|
{
|
|
|
|
|
|
//测试数据
|
|
|
|
|
|
//AllCharacterInfo allChaInfo = AllCharacterInfo.Instance;
|
|
|
|
|
|
|
|
|
|
|
|
var useFullCharacters = SROptions.Current.UseFullCharacters;
|
2024-09-30 12:21:25 +08:00
|
|
|
|
var useTestTeam = SROptions.Current.UseTestTeam;
|
2023-12-14 16:10:28 +08:00
|
|
|
|
|
|
|
|
|
|
if (useFullCharacters)
|
|
|
|
|
|
{
|
|
|
|
|
|
CharacterDataInfoManager.Instance.AddAllCfgCharacter();
|
2024-01-11 14:12:39 +08:00
|
|
|
|
VehicleCultivateDataManager.Instance.AddAllCfgVehicles();
|
2023-12-14 16:10:28 +08:00
|
|
|
|
}
|
2024-10-15 16:30:20 +08:00
|
|
|
|
Team defaultTeam = TeamEditManager.Instance.GetSelectTeam();
|
2024-09-30 12:21:25 +08:00
|
|
|
|
|
2024-10-11 15:22:03 +08:00
|
|
|
|
var cIDs = defaultTeam.GetAllCharacters();
|
2023-12-14 16:10:28 +08:00
|
|
|
|
if (useFullCharacters)
|
|
|
|
|
|
{
|
2024-10-11 15:22:03 +08:00
|
|
|
|
cIDs = CharacterDataInfoManager.Instance.DataList.ConvertAll((info) => info.ID);
|
2023-12-14 16:10:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var vInfos = new List<VehicleCultivateData>();
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2024-01-11 14:12:39 +08:00
|
|
|
|
if (useFullCharacters)
|
|
|
|
|
|
{
|
|
|
|
|
|
var dataList = VehicleCultivateDataManager.Instance.DataList;
|
|
|
|
|
|
vInfos.AddRange(dataList);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
2023-12-14 16:16:39 +08:00
|
|
|
|
{
|
2024-10-11 15:22:03 +08:00
|
|
|
|
foreach (var vehicleID in defaultTeam.GetVehicleIDs())
|
2024-01-11 14:12:39 +08:00
|
|
|
|
{
|
2024-10-11 15:22:03 +08:00
|
|
|
|
if (ValueValidator.IsIdValid( vehicleID))
|
|
|
|
|
|
{
|
|
|
|
|
|
var vInfo = VehicleCultivateDataManager.Instance.DataDic[ vehicleID];
|
|
|
|
|
|
vInfos.Add(vInfo);
|
|
|
|
|
|
}
|
2024-01-11 14:12:39 +08:00
|
|
|
|
}
|
2024-10-11 15:22:03 +08:00
|
|
|
|
|
2023-12-14 16:16:39 +08:00
|
|
|
|
}
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2024-09-30 12:21:25 +08:00
|
|
|
|
if (useTestTeam)
|
|
|
|
|
|
{
|
2024-10-15 16:30:20 +08:00
|
|
|
|
var team = TeamEditManager.Instance.GetTestTeam();
|
2024-10-11 15:22:03 +08:00
|
|
|
|
cIDs = team.GetAllCharacters();
|
2024-09-30 12:21:25 +08:00
|
|
|
|
var vIDs = team.GetVehicleIDs();
|
|
|
|
|
|
vInfos = new List<VehicleCultivateData>(VehicleCultivateDataManager.Instance.DataList.Where(
|
|
|
|
|
|
data => vIDs.Contains(data.nID)));
|
|
|
|
|
|
}
|
2024-01-11 14:12:39 +08:00
|
|
|
|
|
2023-12-14 16:10:28 +08:00
|
|
|
|
List<SingleTeamCharacterInfo> selectList = new List<SingleTeamCharacterInfo>();
|
2024-10-11 15:22:03 +08:00
|
|
|
|
int allCount = cIDs.Count + vInfos.Count;
|
2023-12-14 16:10:28 +08:00
|
|
|
|
var count = allCount > WAIT_LIMIT ? WAIT_LIMIT : allCount;
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2024-10-09 13:23:07 +08:00
|
|
|
|
var workUIIndex = 1;
|
2023-12-14 16:10:28 +08:00
|
|
|
|
//Test
|
2024-10-11 15:22:03 +08:00
|
|
|
|
for (int i = 0; i < cIDs.Count; i++)
|
2023-12-14 16:10:28 +08:00
|
|
|
|
{
|
2024-10-11 15:22:03 +08:00
|
|
|
|
if (i < cIDs.Count)
|
2023-12-14 16:10:28 +08:00
|
|
|
|
{
|
|
|
|
|
|
var id = cIDs[i];
|
|
|
|
|
|
if (id > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
SingleTeamCharacterInfo singleInfo;
|
|
|
|
|
|
var charInfo = CharacterDataInfoManager.Instance.DataDic[id];
|
|
|
|
|
|
var unit = await GameUnitManager.instance.PrepareCharacter(charInfo, ETroopsId.Self);
|
2024-01-03 13:04:36 +08:00
|
|
|
|
if (unit == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("创建角色失败!!!");
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
2023-12-14 16:10:28 +08:00
|
|
|
|
singleInfo = new SingleTeamCharacterInfo(CharacterDataInfoManager.Instance.DataDic[id], unit.GetID());
|
2024-10-16 19:08:00 +08:00
|
|
|
|
unit.unitUIData.uiIndex = defaultTeam.GetCharacterIdxInAllUnits(id);
|
2024-10-09 13:19:06 +08:00
|
|
|
|
workUIIndex++;
|
2023-12-14 16:10:28 +08:00
|
|
|
|
selectList.Add(singleInfo);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2024-01-11 14:12:39 +08:00
|
|
|
|
for (int i = 0; i < vInfos.Count; i++)
|
2023-12-14 16:10:28 +08:00
|
|
|
|
{
|
|
|
|
|
|
if (i < vInfos.Count)
|
|
|
|
|
|
{
|
|
|
|
|
|
SingleTeamCharacterInfo singleInfo;
|
|
|
|
|
|
var unit = await GameUnitManager.instance.PrepareVehicle(vInfos[i], ETroopsId.Self);
|
2024-01-04 13:45:27 +08:00
|
|
|
|
singleInfo = new SingleTeamCharacterInfo(unit.GetID(), vInfos[i]);
|
2024-10-16 19:08:00 +08:00
|
|
|
|
unit.unitUIData.uiIndex = defaultTeam.GetVehicleIdxInAllUnits(vInfos[i].nID);
|
2024-10-09 13:19:06 +08:00
|
|
|
|
workUIIndex++;
|
2023-12-14 16:10:28 +08:00
|
|
|
|
selectList.Add(singleInfo);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return selectList;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
private void InitData()
|
|
|
|
|
|
{
|
|
|
|
|
|
Release();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool IsDead(uint uid)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!m_allCharactersMap.ContainsKey(uid))
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("传入ID有误!!!");
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
return m_allCharactersMap[uid].GetIsDead();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-03 16:09:24 +08:00
|
|
|
|
private List<uint> GetCharacterIDs()
|
|
|
|
|
|
{
|
|
|
|
|
|
List<uint> retList = new List<uint>();
|
|
|
|
|
|
for (int i = 0; i < m_allIDList.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
var id = m_allIDList[i];
|
|
|
|
|
|
if (GetUnitType(id) == SingleTeamCharacterInfo.CharacType.Hero)
|
|
|
|
|
|
{
|
|
|
|
|
|
retList.Add(id);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return retList;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private List<uint> GetVehicleIDs()
|
|
|
|
|
|
{
|
|
|
|
|
|
List<uint> retList = new List<uint>();
|
|
|
|
|
|
for (int i = 0; i < m_allIDList.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
var id = m_allIDList[i];
|
|
|
|
|
|
if (GetUnitType(id) == SingleTeamCharacterInfo.CharacType.Vehicle)
|
|
|
|
|
|
{
|
|
|
|
|
|
retList.Add(id);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return retList;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
//战前上阵队列变化
|
|
|
|
|
|
void SendWaitToFightBefore(uint toFightUId)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var uid in m_waitFightIDList)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (toFightUId == uid)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (GetCharacterDataInfo(uid).IsVehicle())
|
|
|
|
|
|
{
|
|
|
|
|
|
m_onFightIDList.Insert(0, uid);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
m_onFightIDList.Add(toFightUId);
|
|
|
|
|
|
}
|
|
|
|
|
|
m_waitFightIDList.Remove(toFightUId);
|
|
|
|
|
|
EventManager.Instance.Send(EventManager.EventName.LevelFightStartChange);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
//战斗中上阵
|
|
|
|
|
|
void SendWaitToFightFighting(uint toFightUId)
|
|
|
|
|
|
{
|
2023-12-26 12:44:45 +08:00
|
|
|
|
if (!m_allCharactersMap.ContainsKey(toFightUId))
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
|
if (IsDead(toFightUId))
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
foreach (var uid in m_waitFightIDList)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (toFightUId == uid)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (GetCharacterDataInfo(uid).IsVehicle())
|
|
|
|
|
|
{
|
|
|
|
|
|
m_onFightIDList.Insert(0, uid);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
m_onFightIDList.Add(toFightUId);
|
|
|
|
|
|
}
|
|
|
|
|
|
m_waitFightIDList.Remove(toFightUId);
|
|
|
|
|
|
//EventSystem.Instance.Send(EventSystem.EventName.LevelFightStartChange);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//战前下阵队列变化
|
2023-12-19 16:17:55 +08:00
|
|
|
|
void SendFightToWaitBefore(uint toWaitUid, bool fightDontMove = true)
|
2023-08-22 19:08:45 +08:00
|
|
|
|
{
|
|
|
|
|
|
foreach (var uid in m_onFightIDList)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (toWaitUid == uid)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (GetCharacterDataInfo(uid).IsVehicle())
|
|
|
|
|
|
{
|
|
|
|
|
|
m_waitFightIDList.Insert(0, uid);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
m_waitFightIDList.Add(toWaitUid);
|
|
|
|
|
|
}
|
|
|
|
|
|
m_onFightIDList.Remove(toWaitUid);
|
|
|
|
|
|
EventManager.Instance.Send(EventManager.EventName.LevelFightStartChange);
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-12-19 16:17:55 +08:00
|
|
|
|
if (fightDontMove)
|
|
|
|
|
|
{
|
|
|
|
|
|
GameUnitManager.instance.MoveUnitToPrepare(toWaitUid);
|
|
|
|
|
|
}
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
//战斗中下阵
|
|
|
|
|
|
void SendFightToWaitFighting(uint toWaitUid)
|
|
|
|
|
|
{
|
|
|
|
|
|
//LevelManager.Instance.CurrentLevel.CharacterManager.Remove(toWaitUid);
|
2023-12-26 12:44:45 +08:00
|
|
|
|
if (!m_allCharactersMap.ContainsKey(toWaitUid))
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
|
bool isDead = false;
|
|
|
|
|
|
if (IsDead(toWaitUid) && !m_deadIDList.Contains(toWaitUid))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (GetCharacterDataInfo(toWaitUid).IsVehicle())
|
|
|
|
|
|
{
|
|
|
|
|
|
m_deadIDList.Insert(0, toWaitUid);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
m_deadIDList.Add(toWaitUid);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
isDead = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int idx = m_onFightIDList.FindIndex((id) =>
|
|
|
|
|
|
{
|
2023-10-19 15:00:19 +08:00
|
|
|
|
if (m_deadIDList.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_deadIDList[0] == id;
|
|
|
|
|
|
}
|
|
|
|
|
|
return false;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
});
|
2023-10-19 15:00:19 +08:00
|
|
|
|
idx = idx < 0 ? m_waitFightIDList.Count - m_deadIDList.Count : idx;
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
if (isDead)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (m_deadIDList.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (m_allCharactersMap[toWaitUid].IsVehicle())
|
|
|
|
|
|
{
|
|
|
|
|
|
m_waitFightIDList.Insert(idx, toWaitUid);
|
|
|
|
|
|
m_onFightIDList.Remove(toWaitUid);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
m_waitFightIDList.Add(toWaitUid);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
m_waitFightIDList.Insert(idx, toWaitUid);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m_onFightIDList.Remove(toWaitUid);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Release()
|
|
|
|
|
|
{
|
2024-02-22 12:48:35 +08:00
|
|
|
|
UnLoadAllPost();
|
|
|
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
|
m_allIDList.Clear();
|
2023-08-22 19:08:45 +08:00
|
|
|
|
m_onFightIDList.Clear();
|
|
|
|
|
|
m_waitFightIDList.Clear();
|
|
|
|
|
|
m_allCharactersMap.Clear();
|
2023-10-19 15:00:19 +08:00
|
|
|
|
_inVehicleIDList.Clear();
|
2023-08-22 19:08:45 +08:00
|
|
|
|
if (m_deadIDList != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_deadIDList.Clear();
|
|
|
|
|
|
}
|
|
|
|
|
|
m_instance = null;
|
2024-01-10 15:21:05 +08:00
|
|
|
|
|
2024-02-22 12:48:35 +08:00
|
|
|
|
//InputManager.Instance.OnFingerUp -= _OnFingerUp;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public async UniTask TeamUIInit()
|
|
|
|
|
|
{
|
2023-12-14 16:10:28 +08:00
|
|
|
|
await _Init();
|
2024-02-22 12:48:35 +08:00
|
|
|
|
//InputManager.Instance.OnFingerUp += _OnFingerUp;
|
2024-01-10 15:21:05 +08:00
|
|
|
|
|
2023-12-18 16:14:18 +08:00
|
|
|
|
if (LevelManager.Instance.CurrentLevel.IsPreparing())
|
2023-08-22 19:08:45 +08:00
|
|
|
|
{
|
2024-09-30 15:57:57 +08:00
|
|
|
|
var window = await UIManager.Instance.LoadWindow(UINameConst.UIFightScene);
|
|
|
|
|
|
UIManager.Instance.PushWindow(window);
|
|
|
|
|
|
window = await UIManager.Instance.LoadWindow(UINameConst.UI_StartBtn_CMSBtn);
|
|
|
|
|
|
UIManager.Instance.PushWindow(window);
|
|
|
|
|
|
window = await UIManager.Instance.LoadWindow(UINameConst.UITeamFight);
|
|
|
|
|
|
UIManager.Instance.PushWindow(window);
|
|
|
|
|
|
window = await UIManager.Instance.LoadWindow(UINameConst.UIFightClock);
|
|
|
|
|
|
UIManager.Instance.PushWindow(window);
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
|
AssetManager.Instance.PostPreload(string.Format(UIManager.UI_PREFAB_PATH, UINameConst.UICharacterStateBar));
|
|
|
|
|
|
AssetManager.Instance.PostPreload(string.Format(UIManager.UI_PREFAB_PATH, UINameConst.UIVehicleStateBar));
|
|
|
|
|
|
AssetManager.Instance.PostPreload(string.Format(UIManager.UI_PREFAB_PATH, UINameConst.UIEnemyStateBar));
|
|
|
|
|
|
AssetManager.Instance.PostPreload(string.Format(UIManager.UI_PREFAB_PATH, UINameConst.UICharacterDamage));
|
|
|
|
|
|
|
|
|
|
|
|
//预加载士气值图片
|
|
|
|
|
|
AssetManager.Instance.PostPreload<Sprite>(LevelUIManager.GetMoralePic(true));
|
|
|
|
|
|
AssetManager.Instance.PostPreload<Sprite>(LevelUIManager.GetMoralePic(false));
|
|
|
|
|
|
//预加载数字图片
|
|
|
|
|
|
for (int i = 0; i < 10; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
AssetManager.Instance.PostPreload<Sprite>(LevelUIManager.GetNumberImage(i));
|
|
|
|
|
|
}
|
2024-10-12 13:05:37 +08:00
|
|
|
|
for (int i = 0; i < 7; i++)
|
2024-09-30 15:57:57 +08:00
|
|
|
|
{
|
|
|
|
|
|
AssetManager.Instance.PostPreload<Sprite>(LevelUIManager.GetNumberImgPath(i));
|
|
|
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
2024-01-03 16:09:24 +08:00
|
|
|
|
var teamCharacterIDs = GetCharacterIDs();
|
|
|
|
|
|
var vehicleIDs = GetVehicleIDs();
|
|
|
|
|
|
for (int i = 0; i < teamCharacterIDs.Count; i++)
|
|
|
|
|
|
{
|
2024-01-04 13:45:27 +08:00
|
|
|
|
var uid = teamCharacterIDs[i];
|
|
|
|
|
|
var singleData = m_allCharactersMap[uid];
|
|
|
|
|
|
var cfg = singleData.GetConfigInfo();
|
2024-10-23 15:08:29 +08:00
|
|
|
|
var str = CommonUtils.GetCharacterPicPath(cfg.Cfg.RoleID, CommonUtils.ECharacterPicPathType.HeadPic, (int)cfg.SkinID);//CommonUtils.GetDefaultHeadPathByUid((uint)cfg.Cfg.RoleID);
|
2024-01-04 13:45:27 +08:00
|
|
|
|
var posterStr = CommonUtils.GetCharacterPicPath(cfg.Cfg.RoleID,CommonUtils.ECharacterPicPathType.Poster);
|
2024-01-03 16:09:24 +08:00
|
|
|
|
AssetManager.Instance.PostPreload<Sprite>(str);
|
2024-01-04 13:45:27 +08:00
|
|
|
|
AssetManager.Instance.PostPreload<Sprite>(posterStr);
|
2024-01-03 16:09:24 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-28 13:27:21 +08:00
|
|
|
|
for (int i = 0; i < vehicleIDs.Count; i++)
|
2023-10-19 15:00:19 +08:00
|
|
|
|
{
|
2024-10-28 13:27:21 +08:00
|
|
|
|
var uid = vehicleIDs[i];
|
2024-01-04 13:45:27 +08:00
|
|
|
|
var singleData = m_allCharactersMap[uid];
|
2024-07-31 14:30:54 +08:00
|
|
|
|
AssetManager.Instance.PostPreload<Sprite>(CommonUtils.GetDefaultVehicleHeadPath((uint)singleData.GetVehicleInfo().Cfg.ID));//singleData.GetVehicleInfo().Cfg.UIHeadPath
|
2023-10-19 15:00:19 +08:00
|
|
|
|
}
|
2024-01-03 16:09:24 +08:00
|
|
|
|
|
2024-10-28 13:27:21 +08:00
|
|
|
|
//预加载职业图标
|
|
|
|
|
|
for (var i = Ejob.Job_Commander; i < Ejob.Job_Other; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
var path = JobHelper.GetJobSpritePathFight(i);
|
|
|
|
|
|
AssetManager.Instance.PostPreload<Sprite>(path);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
|
//预加载状态图片
|
|
|
|
|
|
AssetManager.Instance.PostPreload<Sprite>(Constants.UI_RETREATE_STATE);
|
|
|
|
|
|
AssetManager.Instance.PostPreload<Sprite>(Constants.UI_SUPPRESS_STATE);
|
|
|
|
|
|
AssetManager.Instance.PostPreload<Sprite>(Constants.UI_RETREATE_STATE_MAP);
|
|
|
|
|
|
AssetManager.Instance.PostPreload<Sprite>(Constants.UI_SUPPRESS_STATE_MAP);
|
|
|
|
|
|
AssetManager.Instance.PostPreload<Sprite>(Constants.UI_INVEHICLE_STATE);
|
2024-06-18 19:57:07 +08:00
|
|
|
|
|
|
|
|
|
|
//预加载血条Prefab
|
2024-09-27 19:42:19 +08:00
|
|
|
|
AssetManager.Instance.PostPreload<GameObject>(Constants.UI_STATE_BAR_SELF_CHARACTER);
|
|
|
|
|
|
AssetManager.Instance.PostPreload<GameObject>(Constants.UI_STATE_BAR_SELF_VEHICLE);
|
|
|
|
|
|
AssetManager.Instance.PostPreload<GameObject>(Constants.UI_STATE_BAR_ENEMY_VEHICLE);
|
|
|
|
|
|
AssetManager.Instance.PostPreload<GameObject>(Constants.UI_STATE_BAR_SELF_SUMMON);
|
|
|
|
|
|
AssetManager.Instance.PostPreload<GameObject>(Constants.UI_STATE_BAR_SELF_PROTECTED);
|
|
|
|
|
|
AssetManager.Instance.PostPreload<GameObject>(Constants.UI_STATE_BAR_ENEMY_CHARACTER);
|
2024-09-30 12:21:25 +08:00
|
|
|
|
AssetManager.Instance.PostPreload<GameObject>(Constants.UI_STATE_BAR_ENEMY_BUILDING);
|
2023-10-19 15:00:19 +08:00
|
|
|
|
|
|
|
|
|
|
await AssetManager.Instance.WaitAllPreloads();
|
2024-09-30 12:21:25 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-02-22 12:48:35 +08:00
|
|
|
|
public void UnLoadAllPost()
|
|
|
|
|
|
{
|
2024-05-08 12:44:22 +08:00
|
|
|
|
AssetManager.Instance.Unload(string.Format(UIManager.UI_PREFAB_PATH, UINameConst.UICharacterStateBar), true);
|
|
|
|
|
|
AssetManager.Instance.Unload(string.Format(UIManager.UI_PREFAB_PATH, UINameConst.UIVehicleStateBar), true);
|
|
|
|
|
|
AssetManager.Instance.Unload(string.Format(UIManager.UI_PREFAB_PATH, UINameConst.UIEnemyStateBar), true);
|
|
|
|
|
|
AssetManager.Instance.Unload(string.Format(UIManager.UI_PREFAB_PATH, UINameConst.UICharacterDamage), true);
|
2024-02-22 12:48:35 +08:00
|
|
|
|
|
2024-05-08 12:44:22 +08:00
|
|
|
|
AssetManager.Instance.Unload(LevelUIManager.GetMoralePic(true), true);
|
|
|
|
|
|
AssetManager.Instance.Unload(LevelUIManager.GetMoralePic(false), true);
|
2024-02-22 12:48:35 +08:00
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 10; i++)
|
|
|
|
|
|
{
|
2024-05-08 12:44:22 +08:00
|
|
|
|
AssetManager.Instance.Unload(LevelUIManager.GetNumberImage(i), true);
|
2024-02-22 12:48:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-05-08 12:44:22 +08:00
|
|
|
|
var teamCharacterIDs = GetCharacterIDs();
|
|
|
|
|
|
var vehicleIDs = GetVehicleIDs();
|
|
|
|
|
|
for (int i = 0; i < teamCharacterIDs.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
var uid = teamCharacterIDs[i];
|
|
|
|
|
|
var singleData = m_allCharactersMap[uid];
|
|
|
|
|
|
var cfg = singleData.GetConfigInfo();
|
2024-10-23 15:08:29 +08:00
|
|
|
|
var str = CommonUtils.GetCharacterPicPath(cfg.Cfg.RoleID, CommonUtils.ECharacterPicPathType.HeadPic, (int)cfg.SkinID);//CommonUtils.GetDefaultHeadPathByUid((uint)cfg.Cfg.RoleID);
|
2024-05-08 12:44:22 +08:00
|
|
|
|
var posterStr = CommonUtils.GetCharacterPicPath(cfg.Cfg.RoleID,CommonUtils.ECharacterPicPathType.Poster);
|
|
|
|
|
|
AssetManager.Instance.Unload(str);
|
|
|
|
|
|
AssetManager.Instance.Unload(posterStr);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (vehicleIDs.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
var uid = vehicleIDs[0];
|
|
|
|
|
|
var singleData = m_allCharactersMap[uid];
|
2024-07-31 14:30:54 +08:00
|
|
|
|
AssetManager.Instance.Unload(CommonUtils.GetDefaultVehicleHeadPath((uint)singleData.GetVehicleInfo().Cfg.ID));//singleData.GetVehicleInfo().Cfg.UIHeadPath
|
2024-05-08 12:44:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
AssetManager.Instance.Unload(Constants.UI_RETREATE_STATE, true);
|
|
|
|
|
|
AssetManager.Instance.Unload(Constants.UI_SUPPRESS_STATE, true);
|
|
|
|
|
|
AssetManager.Instance.Unload(Constants.UI_RETREATE_STATE_MAP, true);
|
|
|
|
|
|
AssetManager.Instance.Unload(Constants.UI_SUPPRESS_STATE_MAP, true);
|
|
|
|
|
|
AssetManager.Instance.Unload(Constants.UI_INVEHICLE_STATE, true);
|
2024-02-22 12:48:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-10 15:21:05 +08:00
|
|
|
|
private void _OnFingerUp(Vector2 pos)
|
|
|
|
|
|
{
|
|
|
|
|
|
// if (IsHideAllUI)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// IsHideAllUI = false;
|
|
|
|
|
|
// }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
public void TeamUIOpen()
|
|
|
|
|
|
{
|
|
|
|
|
|
UIManager.Instance.OpenLoadedNormalUI(UINameConst.UI_StartBtn_CMSBtn);
|
|
|
|
|
|
UIManager.Instance.OpenLoadedNormalUI(UINameConst.UITeamFight);
|
|
|
|
|
|
UIManager.Instance.OpenLoadedNormalUI(UINameConst.UIFightClock);
|
|
|
|
|
|
UIManager.Instance.OpenLoadedNormalUI(UINameConst.UIFightScene);
|
2024-03-21 16:08:31 +08:00
|
|
|
|
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.Map.ShowInfo(Map.InfoMask.ShowCells, true);
|
|
|
|
|
|
AreaManager.instance.readyAreaManager.ShowReadyArea();
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-03-28 16:13:10 +08:00
|
|
|
|
public void TeamUIClose()
|
|
|
|
|
|
{
|
|
|
|
|
|
UIManager.Instance.CloseWindow(UINameConst.UI_StartBtn_CMSBtn);
|
|
|
|
|
|
UIManager.Instance.CloseWindow(UINameConst.UITeamFight);
|
|
|
|
|
|
UIManager.Instance.CloseWindow(UINameConst.UIFightClock);
|
|
|
|
|
|
UIManager.Instance.CloseWindow(UINameConst.UIFightScene);
|
2024-10-30 18:52:22 +08:00
|
|
|
|
LevelManager.Instance.SkillInfoClose(true);
|
2024-03-28 16:13:10 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-18 16:14:18 +08:00
|
|
|
|
public void SetSelectID(uint uid = Constants.INVALID_UINT_ID)
|
2023-08-22 19:08:45 +08:00
|
|
|
|
{
|
|
|
|
|
|
m_selectID = uid;
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
bool isNeedShow = ValueValidator.IsIdValid(m_selectID);
|
|
|
|
|
|
if (LevelManager.Instance.CurrentLevel.IsPreparing())
|
|
|
|
|
|
{
|
2024-03-21 16:08:31 +08:00
|
|
|
|
//AreaManager.instance.readyAreaManager.ShowReadyArea();
|
|
|
|
|
|
// if (!isNeedShow)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// AreaManager.instance.readyAreaManager.HideReadyArea();
|
|
|
|
|
|
// }
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
2023-12-18 16:14:18 +08:00
|
|
|
|
else if (LevelManager.Instance.CurrentLevel.IsInBattle())
|
2023-10-19 15:00:19 +08:00
|
|
|
|
{
|
|
|
|
|
|
if (m_waitFightIDList.Contains(uid))
|
|
|
|
|
|
{
|
2023-12-18 16:14:18 +08:00
|
|
|
|
if (GameUnitManager.instance.infightUnits.Contains(uid))
|
|
|
|
|
|
{
|
2024-03-28 16:13:10 +08:00
|
|
|
|
var unit = GameUnitManager.instance.infightUnits.Search(uid);
|
|
|
|
|
|
if (unit.statusData.isOnVehicle)
|
|
|
|
|
|
{
|
|
|
|
|
|
// 在战斗中
|
2024-09-29 18:22:23 +08:00
|
|
|
|
AreaManager.instance.readyAreaManager.ShowReadyArea(EReadyAreaStatus.AroundVehicle, unit);
|
2024-03-28 16:13:10 +08:00
|
|
|
|
}
|
2023-12-18 16:14:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
else if (GameUnitManager.instance.prepareUnits.Contains(uid))
|
|
|
|
|
|
{
|
|
|
|
|
|
// 备战席
|
|
|
|
|
|
AreaManager.instance.readyAreaManager.ShowReadyArea();
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (GameUnitManager.instance.deadUnits.Contains(uid))
|
|
|
|
|
|
{
|
|
|
|
|
|
// 已死亡
|
|
|
|
|
|
AreaManager.instance.readyAreaManager.HideReadyArea();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
// 未知情况
|
|
|
|
|
|
DebugUtil.LogError("未知上阵情况!");
|
|
|
|
|
|
}
|
2023-10-19 15:00:19 +08:00
|
|
|
|
}
|
2023-12-18 16:14:18 +08:00
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
AreaManager.instance.readyAreaManager.HideReadyArea();
|
|
|
|
|
|
}
|
2024-03-21 16:08:31 +08:00
|
|
|
|
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.Map.ShowInfo(Map.InfoMask.ShowCells, isNeedShow);
|
2023-10-19 15:00:19 +08:00
|
|
|
|
}
|
2024-03-21 16:08:31 +08:00
|
|
|
|
|
2024-01-11 13:54:58 +08:00
|
|
|
|
if (uid == Constants.INVALID_UINT_ID)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (IsHideAllUI)
|
|
|
|
|
|
{
|
|
|
|
|
|
IsHideAllUI = false;
|
2024-03-21 19:02:37 +08:00
|
|
|
|
CloseFightPosterUI();
|
2024-01-11 13:54:58 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//获取某一个角色的信息
|
|
|
|
|
|
public SingleTeamCharacterInfo GetCharacterDataInfo(uint uid)
|
|
|
|
|
|
{
|
2023-12-14 19:42:05 +08:00
|
|
|
|
if (m_allCharactersMap.TryGetValue(uid, out var result))
|
|
|
|
|
|
{
|
|
|
|
|
|
return result;
|
|
|
|
|
|
}
|
|
|
|
|
|
return null;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
//获取各个队列
|
|
|
|
|
|
public List<uint> GetWaitList()
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_waitFightIDList;
|
|
|
|
|
|
}
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
public List<uint> GetFightList()
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_onFightIDList;
|
|
|
|
|
|
}
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
public List<uint> GetDeadList()
|
|
|
|
|
|
{
|
2024-10-10 20:01:31 +08:00
|
|
|
|
if (m_deadIDList == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("Null!");
|
|
|
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
|
return m_deadIDList;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
|
public List<uint> GetInVehicleList()
|
|
|
|
|
|
{
|
|
|
|
|
|
return _inVehicleIDList;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
public List<uint> GetEnemyList()
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_enemyIDList;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void AddEnemyID(uint uid)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_enemyIDList.Add(uid);
|
|
|
|
|
|
}
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
public void ClearEnemyID(uint uid)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_enemyIDList.Remove(uid);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public SingleTeamCharacterInfo GetSingleCharacByUid(uint uid)
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_allCharactersMap[uid];
|
|
|
|
|
|
}
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
|
//上下载具
|
|
|
|
|
|
public void InVehicleAdd(uint id)
|
|
|
|
|
|
{
|
|
|
|
|
|
_inVehicleIDList.Add(id);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void InVehicleRemove(uint id)
|
|
|
|
|
|
{
|
|
|
|
|
|
_inVehicleIDList.Remove(id);
|
|
|
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
|
|
|
|
|
//选中一个准备上阵
|
|
|
|
|
|
public void SelectToFight(uint selectUid = Constants.INVALID_UINT_ID)
|
|
|
|
|
|
{
|
|
|
|
|
|
SetSelectID(selectUid);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//从Level中选择的传入到UI层
|
|
|
|
|
|
public void SelectToWait(uint selectUid = Constants.INVALID_UINT_ID)
|
|
|
|
|
|
{
|
|
|
|
|
|
SetSelectID(selectUid);
|
|
|
|
|
|
}
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
//上阵成功
|
|
|
|
|
|
public void SendToFight(uint toFightUId)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (LevelManager.Instance.CurrentLevel.IsPreparing())
|
|
|
|
|
|
{
|
|
|
|
|
|
SendWaitToFightBefore(toFightUId);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
|
SendWaitToFightFighting(toFightUId);
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//下阵成功
|
2023-12-19 16:17:55 +08:00
|
|
|
|
public void SendToWait(uint toWaitUid, bool fightDontMove = true)
|
2023-08-22 19:08:45 +08:00
|
|
|
|
{
|
|
|
|
|
|
if (LevelManager.Instance.CurrentLevel.IsPreparing())
|
|
|
|
|
|
{
|
2023-12-19 16:17:55 +08:00
|
|
|
|
SendFightToWaitBefore(toWaitUid, fightDontMove);
|
2023-08-22 19:08:45 +08:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// if (LevelManager.Instance.CurrentLevel.IsInBattle())
|
|
|
|
|
|
// {
|
|
|
|
|
|
SendFightToWaitFighting(toWaitUid);
|
|
|
|
|
|
// }
|
|
|
|
|
|
}
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
//战斗时选中已上阵
|
|
|
|
|
|
public void SelectCharacterFighting(int uid)
|
|
|
|
|
|
{
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//记录战斗开始时间
|
|
|
|
|
|
public void StartFightTime()
|
|
|
|
|
|
{
|
|
|
|
|
|
//InitFightTime();
|
|
|
|
|
|
//MonoHelper.instance.AddAction(EActionType.UPDATE, FightPassAddDeltaTime);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void FightPassAddDeltaTime()
|
|
|
|
|
|
{
|
|
|
|
|
|
bool isPause = LevelManager.Instance.CurrentLevel.IsPause();
|
|
|
|
|
|
if (!isPause)
|
|
|
|
|
|
{
|
|
|
|
|
|
FightPastTimeAddSecond(Time.deltaTime);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void InitFightTime()
|
|
|
|
|
|
{
|
|
|
|
|
|
m_fightPastTimeCount = 0;
|
|
|
|
|
|
}
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
public void SetFightPastTime(float time)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_fightPastTimeCount = time;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void FightPastTimeAddMs(float ms)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_fightPastTimeCount += ms / 1000f;
|
|
|
|
|
|
}
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
void FightPastTimeAddSecond(float second)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_fightPastTimeCount += second;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public float GetFightPastTime()
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_fightPastTimeCount;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int GetFightPastHour()
|
|
|
|
|
|
{
|
2024-10-31 14:37:12 +08:00
|
|
|
|
if (LevelManager.Instance.CurrentLevel == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
|
var time = LevelManager.Instance.CurrentLevel.LevelTime;
|
|
|
|
|
|
int curTimeSecond = Convert.ToInt32(Math.Floor(time));
|
|
|
|
|
|
int hour = Convert.ToInt32(Math.Floor(curTimeSecond / 3600f));
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
return hour;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int GetFightPastMinute()
|
|
|
|
|
|
{
|
2024-10-31 14:37:12 +08:00
|
|
|
|
if (LevelManager.Instance.CurrentLevel == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
|
var time = LevelManager.Instance.CurrentLevel.LevelTime;
|
|
|
|
|
|
int curTimeSecond = Convert.ToInt32(Math.Floor(time));
|
|
|
|
|
|
int hour = GetFightPastHour();
|
|
|
|
|
|
int min = Convert.ToInt32(Math.Floor(curTimeSecond / 60f - hour * 60f));
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
return min;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int GetFightPastSecond()
|
|
|
|
|
|
{
|
2024-10-31 14:37:12 +08:00
|
|
|
|
if (LevelManager.Instance.CurrentLevel == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
|
var time = LevelManager.Instance.CurrentLevel.LevelTime;
|
|
|
|
|
|
int curTimeSecond = Convert.ToInt32(Math.Floor(time));
|
|
|
|
|
|
int hour = GetFightPastHour();
|
|
|
|
|
|
int min = GetFightPastMinute();
|
|
|
|
|
|
int sec = (curTimeSecond - min * 60 - hour * 3600);
|
|
|
|
|
|
|
|
|
|
|
|
return sec;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public SingleTeamCharacterInfo.CharacType GetUnitType(uint uid)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (m_allCharactersMap.ContainsKey(uid))
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_allCharactersMap[uid].Type;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
|
DebugUtil.LogError("请检查传入对象的类型(载具/角色)!!!uid = {0}", uid);
|
2023-08-22 19:08:45 +08:00
|
|
|
|
return SingleTeamCharacterInfo.CharacType.Hero;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool IsCharacter(uint uid)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (LevelManager.Instance.CurrentLevel.IsInBattle())
|
|
|
|
|
|
{
|
2023-12-19 16:17:55 +08:00
|
|
|
|
return GameUnitManager.instance.totalUnits.Search(uid).gameunitType == EGameUnitType.Character;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
return GetUnitType(uid) == SingleTeamCharacterInfo.CharacType.Hero;
|
|
|
|
|
|
}
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
public bool IsVehicle(uint uid)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (LevelManager.Instance.CurrentLevel.IsInBattle())
|
|
|
|
|
|
{
|
2023-12-14 18:25:52 +08:00
|
|
|
|
return GameUnitManager.instance.infightUnits.Search(uid).gameunitType == EGameUnitType.Vehicle;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
return GetUnitType(uid) == SingleTeamCharacterInfo.CharacType.Vehicle;
|
|
|
|
|
|
}
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
public bool GetIsChanging()
|
|
|
|
|
|
{
|
|
|
|
|
|
return _isChanging;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetIsChanging(bool state)
|
|
|
|
|
|
{
|
|
|
|
|
|
_isChanging = state;
|
|
|
|
|
|
}
|
2023-10-19 15:00:19 +08:00
|
|
|
|
|
|
|
|
|
|
public void BornInLevel(uint uid)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!m_allCharactersMap.ContainsKey(uid))
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
m_allCharactersMap[uid].IsInLevel = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void RemoveInLevel(uint uid)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!m_allCharactersMap.ContainsKey(uid))
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
m_allCharactersMap[uid].IsInLevel = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool IsInLevel(uint uid)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!m_allCharactersMap.ContainsKey(uid))
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return m_allCharactersMap[uid].IsInLevel;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-19 16:17:55 +08:00
|
|
|
|
public void SetIDReborn(uint uid)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!m_waitFightIDList.Contains(uid))
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!m_deadIDList.Contains(uid))
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m_waitFightIDList.Remove(uid);
|
|
|
|
|
|
m_deadIDList.Remove(uid);
|
|
|
|
|
|
var idx = m_waitFightIDList.Count - m_deadIDList.Count;
|
|
|
|
|
|
m_waitFightIDList.Insert(idx, uid);
|
|
|
|
|
|
BornInLevel(uid);
|
|
|
|
|
|
var singleUnit = m_allCharactersMap[uid];
|
|
|
|
|
|
singleUnit.SetIsDead();
|
|
|
|
|
|
}
|
2023-10-19 15:00:19 +08:00
|
|
|
|
public List<uint> GetAllIDList()
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_allIDList;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool IsFightListLimit(uint uid)
|
|
|
|
|
|
{
|
2024-10-09 17:10:43 +08:00
|
|
|
|
return false;
|
|
|
|
|
|
// int totalNum = 0;
|
|
|
|
|
|
// int vehicleNum = 0;
|
|
|
|
|
|
// var unitList = GameUnitManager.instance.infightUnits;
|
|
|
|
|
|
// for (int i = 0; i < unitList.count; i++)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// var unit = unitList.GetByIndex(i);
|
|
|
|
|
|
// if (unit.commonData.troopId == ETroopsId.Self)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// if (unit.gameunitType == EGameUnitType.Character)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// ++totalNum;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// if(unit.gameunitType == EGameUnitType.Vehicle)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// ++vehicleNum;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
//
|
|
|
|
|
|
// if (IsCharacter(uid))
|
|
|
|
|
|
// {
|
|
|
|
|
|
// return totalNum >= FIGHT_LIMIT;
|
|
|
|
|
|
// }
|
|
|
|
|
|
//
|
|
|
|
|
|
// return vehicleNum >= VEHICLE_FIGHT_LIMIT;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
}
|
2023-12-26 13:25:05 +08:00
|
|
|
|
|
|
|
|
|
|
public bool IsInTeam(uint uid)
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_allCharactersMap.ContainsKey(uid);
|
|
|
|
|
|
}
|
2024-09-04 16:02:38 +08:00
|
|
|
|
|
|
|
|
|
|
public bool CheckIsOnCancel()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (UIManager.Instance.GetOpenedWindowByPath(UINameConst.UIFightPoster) is UIPosterAndSkillInfoController window)
|
|
|
|
|
|
{
|
|
|
|
|
|
return window.CheckIsInCancel();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
2024-09-29 14:40:35 +08:00
|
|
|
|
|
|
|
|
|
|
public void SetCancelImageShow()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (UIManager.Instance.GetOpenedWindowByPath(UINameConst.UIFightPoster) is UIPosterAndSkillInfoController window)
|
|
|
|
|
|
{
|
|
|
|
|
|
window.SetCancelShow();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//测试用,暂存一个载具信息类
|
|
|
|
|
|
public class VehicleInfo
|
|
|
|
|
|
{
|
2023-10-19 15:00:19 +08:00
|
|
|
|
private VehicleCultivateData _vehicleData;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
private DataVehicle _cfg;
|
|
|
|
|
|
private uint _uid;
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
public DataVehicle Cfg
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _cfg;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public uint ID
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _uid;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
|
public VehicleCultivateData VehicleData => _vehicleData;
|
|
|
|
|
|
|
2023-12-18 16:14:18 +08:00
|
|
|
|
public VehicleInfo(uint id,
|
|
|
|
|
|
DataVehicle cfg,
|
|
|
|
|
|
VehicleCultivateData VehicleData)
|
2023-08-22 19:08:45 +08:00
|
|
|
|
{
|
|
|
|
|
|
_cfg = cfg;
|
|
|
|
|
|
_uid = id;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//单个队列中的角色信息
|
|
|
|
|
|
public class SingleTeamCharacterInfo
|
|
|
|
|
|
{
|
|
|
|
|
|
private CharacterDataInfo _characterData;
|
2024-01-04 13:45:27 +08:00
|
|
|
|
private VehicleCultivateData _vConfigData;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
|
|
|
|
|
private float m_leftBlood;
|
|
|
|
|
|
private bool m_isDead;
|
2023-12-18 16:14:18 +08:00
|
|
|
|
private bool _isInLevel = false; //是否被创建到战场中,没有的话不能取到各种值
|
|
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
//测试数据
|
2024-03-20 19:58:18 +08:00
|
|
|
|
private uint m_uid; //战场中生成的UID
|
2023-08-22 19:08:45 +08:00
|
|
|
|
private CharacType m_type;
|
|
|
|
|
|
|
2024-03-20 19:58:18 +08:00
|
|
|
|
public readonly uint OutUid; //养成界面的UID
|
2023-12-14 16:10:28 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
public enum CharacType
|
|
|
|
|
|
{
|
|
|
|
|
|
Hero,
|
|
|
|
|
|
Vehicle
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
|
public bool IsInLevel
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _isInLevel;
|
|
|
|
|
|
set => _isInLevel = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-18 16:14:18 +08:00
|
|
|
|
public SingleTeamCharacterInfo(CharacterDataInfo configData,
|
|
|
|
|
|
uint uid,
|
|
|
|
|
|
CharacType type = CharacType.Hero)
|
2023-08-22 19:08:45 +08:00
|
|
|
|
{
|
|
|
|
|
|
_characterData = configData;
|
2023-12-14 16:10:28 +08:00
|
|
|
|
m_uid = uid;
|
|
|
|
|
|
OutUid = configData.Uid;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
m_type = type;
|
|
|
|
|
|
}
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
|
|
|
|
|
public SingleTeamCharacterInfo(uint uid,
|
2024-01-04 13:45:27 +08:00
|
|
|
|
VehicleCultivateData configData,
|
2023-12-18 16:14:18 +08:00
|
|
|
|
CharacType type = CharacType.Vehicle)
|
2023-08-22 19:08:45 +08:00
|
|
|
|
{
|
|
|
|
|
|
_vConfigData = configData;
|
|
|
|
|
|
//m_leftBlood = configData.Blood();
|
2024-10-10 17:34:13 +08:00
|
|
|
|
OutUid = configData.nID;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
m_uid = uid;
|
|
|
|
|
|
m_type = type;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public uint Uid
|
|
|
|
|
|
{
|
2024-01-04 13:45:27 +08:00
|
|
|
|
get { return m_uid; }
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public CharacType Type
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_type; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool IsVehicle()
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_type == CharacType.Vehicle;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int GetTid()
|
|
|
|
|
|
{
|
|
|
|
|
|
return _characterData.Cfg.RoleID;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public CharacterDataInfo GetConfigInfo()
|
|
|
|
|
|
{
|
|
|
|
|
|
return _characterData;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-04 13:45:27 +08:00
|
|
|
|
public VehicleCultivateData GetVehicleInfo()
|
2023-08-22 19:08:45 +08:00
|
|
|
|
{
|
|
|
|
|
|
return _vConfigData;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetType(CharacType type)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_type = type;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//获取剩余血量
|
|
|
|
|
|
public float GetLeftBlood()
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_leftBlood;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool GetIsDead()
|
|
|
|
|
|
{
|
|
|
|
|
|
return m_isDead;
|
|
|
|
|
|
}
|
2023-12-18 16:14:18 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
public void SetIsDead(bool state = false)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_isDead = state;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//设置剩余血量
|
|
|
|
|
|
public void SetLeftBlood(float left)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_leftBlood = left > 0 ? left : 0;
|
|
|
|
|
|
}
|
2023-12-18 16:14:18 +08:00
|
|
|
|
}
|