55 lines
1.4 KiB
C#
55 lines
1.4 KiB
C#
using Framework;
|
|
using Gameplay.Common;
|
|
using Gameplay.Net;
|
|
using Gameplay;
|
|
using NLDPB;
|
|
using PhxhSDK;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class EnergyManager : Singlenton<EnergyManager>
|
|
{
|
|
//public void AddEnergy(uint count)
|
|
//{
|
|
// Actor.Instance.Item.AddItem(GLConfig.Inst.data.EnergyPointID, count);
|
|
//}
|
|
//
|
|
//public void ReduceEnergy(uint count)
|
|
//{
|
|
// Actor.Instance.Item.ReduceItem(GLConfig.Inst.data.EnergyPointID, count);
|
|
//}
|
|
|
|
/// <summary>
|
|
/// 获取最大体力
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public int GetMaxEnergyPoint()
|
|
{
|
|
cfg.ActorCfg.DataActorLevel Levelinfo = ActorLevelTableHelper.Instance.Get((int)Actor.Instance.Base.GetProp(NLDPB.ActorProp.Level));
|
|
return Levelinfo.MaxEnergy;
|
|
}
|
|
/// <summary>
|
|
/// 获取当前体力
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public uint GetNowEnergy()
|
|
{
|
|
return Actor.Instance.Item.GetItemCount(GLConfig.Inst.data.EnergyPointID);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取下一次体力恢复时间
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public DateTime GetNextEnergyRecoverTime()
|
|
{
|
|
DateTime lastDateTime = CommonUtils.GetTimeByTimestamp(Actor.Instance.Logic.GetCount((uint)LogicID.EnergyRecoverTime));
|
|
|
|
return lastDateTime.AddSeconds(TableManager.Instance.Tables.GlobalConfig.EnergyPointRecoverTime);
|
|
}
|
|
|
|
|
|
}
|