using System; using System.Collections.Generic; using UnityEngine; /// /// 需要同步服务器 /// 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.slienceTime = (int)(ZZTimeHelper.UtcNow() - LastRecordedTime).TotalSeconds; LastRecordedTime = ZZTimeHelper.UtcNow(); } //void SetCastingTime() //{ // CurrentState.castingTime = (int)(ZZTimeHelper.UtcNow() - LastRecordedTime).TotalSeconds; // LastRecordedTime = ZZTimeHelper.UtcNow(); //} void SetFishingTime() { CurrentState.fishingTime = (int)(ZZTimeHelper.UtcNow() - LastRecordedTime).TotalSeconds; LastRecordedTime = ZZTimeHelper.UtcNow(); } }