118 lines
3.1 KiB
C#
118 lines
3.1 KiB
C#
|
|
using Thousandto.Cfg.Data;
|
|
using Thousandto.Code.Global;
|
|
using UnityEngine;
|
|
|
|
namespace Thousandto.Code.Logic
|
|
{
|
|
//角色死亡信息
|
|
public class CharacterDeadInfo
|
|
{
|
|
#region//私有变量
|
|
//自动复活倒计时
|
|
private float _autoRemainTime = 0f;
|
|
private float _autoSyncTime = 0f;
|
|
|
|
//安全复活按钮倒计时
|
|
private float _cityRemainTime = 0f;
|
|
private float _citySyncTime = 0f;
|
|
|
|
//原地复活按钮倒计时
|
|
private float _oriRemainTime = 0f;
|
|
private float _oriSyncTime = 0f;
|
|
|
|
//复活配置
|
|
private int _reBornCfgID = 0;
|
|
private DeclareRelive _reBornCfg = null;
|
|
#endregion
|
|
|
|
#region//属性
|
|
//死亡者ID
|
|
public ulong DeadObjID { get; set; }
|
|
//击杀者名字
|
|
public string KillerName { get; set; }
|
|
//计时器
|
|
public float TimeCounter { get; set; }
|
|
//是否已经执行过死亡效果
|
|
public bool IsDid { get; set; }
|
|
//是否复活
|
|
public bool IsReborn { get; set; }
|
|
//死亡时间
|
|
public float DeadTime { get; set; }
|
|
//复活配置ID
|
|
public int ReBornCfgID
|
|
{
|
|
get
|
|
{
|
|
return _reBornCfgID;
|
|
}
|
|
set
|
|
{
|
|
_reBornCfgID = value;
|
|
_reBornCfg = DeclareRelive.Get(_reBornCfgID);
|
|
if(_reBornCfg != null)
|
|
{
|
|
AutoRemainTime = _reBornCfg.AutoReliveTime / 1000f;
|
|
CityRemainTime = _reBornCfg.SafeReliveTime / 1000f;
|
|
}
|
|
}
|
|
}
|
|
//复活配置
|
|
public DeclareRelive ReBornCfg
|
|
{
|
|
get
|
|
{
|
|
return _reBornCfg;
|
|
}
|
|
}
|
|
//自动复活倒计时
|
|
public float AutoRemainTime
|
|
{
|
|
get
|
|
{
|
|
return _autoRemainTime - (Time.realtimeSinceStartup - _autoSyncTime);
|
|
}
|
|
set
|
|
{
|
|
_autoRemainTime = value;
|
|
_autoSyncTime = Time.realtimeSinceStartup;
|
|
}
|
|
}
|
|
//安全复活按钮倒计时
|
|
public float CityRemainTime
|
|
{
|
|
get
|
|
{
|
|
return _cityRemainTime - (Time.realtimeSinceStartup - _citySyncTime);
|
|
}
|
|
set
|
|
{
|
|
_cityRemainTime = value;
|
|
_citySyncTime = Time.realtimeSinceStartup;
|
|
}
|
|
}
|
|
//原地复活按钮倒计时
|
|
public float OriReliveTime
|
|
{
|
|
get
|
|
{
|
|
return _oriRemainTime - (Time.realtimeSinceStartup - _oriSyncTime);
|
|
}
|
|
set
|
|
{
|
|
_oriRemainTime = value;
|
|
_oriSyncTime = Time.realtimeSinceStartup;
|
|
}
|
|
}
|
|
//是否显示复活界面
|
|
public bool ShowRelivePanel
|
|
{
|
|
get
|
|
{
|
|
return ReBornCfg != null && (ReBornCfg.AutoReliveType != 0 || !string.IsNullOrEmpty(ReBornCfg.ButtonType));
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
}
|