备份CatanBuilding瘦身独立工程
This commit is contained in:
54
Assets/Scripts/Duel/DuelPlayerModel.cs
Normal file
54
Assets/Scripts/Duel/DuelPlayerModel.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
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.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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user