Files
ft/Client/Assets/Scripts/Duel/DuelPlayerModel.cs
2026-06-29 21:18:33 +08:00

51 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// 需要同步服务器
/// </summary>
public class DuelPlayerModel : DuelModel//:服务器接口
{
DateTime LastRecordedTime;
public override void Start()
{
base.Start();
LastRecordedTime = ZZTimeHelper.UtcNow();
}
public override void StartLastRecordedTime()
{
SetRodTime = (int)(ZZTimeHelper.UtcNow() - LastRecordedTime).TotalSeconds;
LastRecordedTime = ZZTimeHelper.UtcNow();
}
//public override void StartFishing()
//{
// SetCastingTime();
// base.StartFishing();
//}
public override bool StopFishing(FishInfoData data)
{
SetFishingTime();
return base.StopFishing(data);
}
public override void CastRod(int fishID)
{
SetSlienceTime();
base.CastRod(fishID);
}
void SetSlienceTime()
{
CurrentState.st = (float)(ZZTimeHelper.UtcNow() - LastRecordedTime).TotalSeconds;
LastRecordedTime = ZZTimeHelper.UtcNow();
}
void SetFishingTime()
{
CurrentState.ft = (float)(ZZTimeHelper.UtcNow() - LastRecordedTime).TotalSeconds;
LastRecordedTime = ZZTimeHelper.UtcNow();
}
}