feat(upserver): 接入认证与KV存档并完成限定钓鱼闭环
This commit is contained in:
@@ -522,6 +522,22 @@ public class FishingUpdateSys : MonoBehaviour
|
||||
int isFailCount = 0;
|
||||
// 按了收线按钮
|
||||
public void PiercingFish(int waitingZone)
|
||||
{
|
||||
#if UNITY_EDITOR && !SERVICE_HOST
|
||||
if(game.PlayerDataStorage.PlayerKVGameplayLoop.Enabled)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(!game.PlayerDataStorage.PlayerKVGameplayLoop.BeginRewardDrawing(this)) return;
|
||||
using(game.PlayerDataStorage.PlayerKVGameplayLoop.BeginRewardSegment("strike")) PiercingFishCore(waitingZone);
|
||||
}
|
||||
catch(System.Exception e) { game.PlayerDataStorage.PlayerKVGameplayLoop.Fault(e.Message); }
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
PiercingFishCore(waitingZone);
|
||||
}
|
||||
void PiercingFishCore(int waitingZone)
|
||||
{
|
||||
//waitingZone==100表示鱼没有开启刺鱼
|
||||
if (!fishingData.IsDrawing)
|
||||
@@ -623,6 +639,9 @@ public class FishingUpdateSys : MonoBehaviour
|
||||
if (piercingToComboB > 0)
|
||||
{
|
||||
await Awaiters.Seconds(damageProtectionTime);
|
||||
#if UNITY_EDITOR && !SERVICE_HOST
|
||||
if(!game.PlayerDataStorage.PlayerKVGameplayLoop.RewardCanAdvance) return;
|
||||
#endif
|
||||
_comboMultiplayer += Random.Range(piercingToComboA, piercingToComboB);
|
||||
//新技能生效 刺鱼触发全力收线进度
|
||||
PublishPerkEvent(RodPerkType.BattlePerk_PiercingToCombo);
|
||||
@@ -632,6 +651,9 @@ public class FishingUpdateSys : MonoBehaviour
|
||||
public async void EternalDeath()
|
||||
{
|
||||
await Awaiters.Seconds(damageProtectionTime);
|
||||
#if UNITY_EDITOR && !SERVICE_HOST
|
||||
if(!game.PlayerDataStorage.PlayerKVGameplayLoop.RewardCanAdvance) return;
|
||||
#endif
|
||||
|
||||
StopAllCoroutines();
|
||||
OnFishingIsOver();
|
||||
@@ -1042,6 +1064,10 @@ public class FishingUpdateSys : MonoBehaviour
|
||||
|
||||
private void Update()
|
||||
{
|
||||
#if UNITY_EDITOR && !SERVICE_HOST
|
||||
if(!game.PlayerDataStorage.PlayerKVGameplayLoop.RewardCanAdvance) return;
|
||||
#endif
|
||||
|
||||
if (fishingData.IsDrawing)
|
||||
{
|
||||
Vector3 fishPos = fishingBehavior.GetFishPos();
|
||||
@@ -1219,6 +1245,34 @@ public class FishingUpdateSys : MonoBehaviour
|
||||
}
|
||||
|
||||
void FishEnd()
|
||||
{
|
||||
#if UNITY_EDITOR && !SERVICE_HOST
|
||||
if(game.PlayerDataStorage.PlayerKVGameplayLoop.Enabled)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(!game.PlayerDataStorage.PlayerKVGameplayLoop.BeginRewardEnding(this,fishingData.IsCaughtFish && !isFail)) return;
|
||||
using(game.PlayerDataStorage.PlayerKVGameplayLoop.BeginRewardSegment("ending")) FishEndCore();
|
||||
_=ShowKVRewardPanelAsync();
|
||||
}
|
||||
catch(System.Exception e) { game.PlayerDataStorage.PlayerKVGameplayLoop.Fault(e.Message); }
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
FishEndCore();
|
||||
}
|
||||
#if UNITY_EDITOR && !SERVICE_HOST
|
||||
async Task ShowKVRewardPanelAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
var panel=await UIManager.Instance.ShowUI(UITypes.FishingRewardPanel);
|
||||
if(!game.PlayerDataStorage.PlayerKVGameplayLoop.RewardRunCurrent && panel!=null) Destroy(panel);
|
||||
}
|
||||
catch(System.Exception e) { game.PlayerDataStorage.PlayerKVGameplayLoop.Fault(e.Message); }
|
||||
}
|
||||
#endif
|
||||
void FishEndCore()
|
||||
{
|
||||
if (isFail)
|
||||
{
|
||||
@@ -1297,6 +1351,9 @@ public class FishingUpdateSys : MonoBehaviour
|
||||
}
|
||||
else
|
||||
{
|
||||
#if UNITY_EDITOR && !SERVICE_HOST
|
||||
if(game.PlayerDataStorage.PlayerKVGameplayLoop.Enabled) return; // Wrapper opens UI after S2 disposal.
|
||||
#endif
|
||||
_ = UIManager.Instance.ShowUI(UITypes.FishingRewardPanel);
|
||||
}
|
||||
}
|
||||
@@ -1746,6 +1803,15 @@ public class FishingUpdateSys : MonoBehaviour
|
||||
//全力收线
|
||||
public async void FullCombo()
|
||||
{
|
||||
#if UNITY_EDITOR && !SERVICE_HOST
|
||||
if(game.PlayerDataStorage.PlayerKVGameplayLoop.Enabled)
|
||||
{
|
||||
if(!game.PlayerDataStorage.PlayerKVGameplayLoop.RewardCanAdvance) return;
|
||||
try { game.PlayerDataStorage.PlayerKVGameplayLoop.CheckRewardGuide(); }
|
||||
catch(System.Exception e) { game.PlayerDataStorage.PlayerKVGameplayLoop.Fault(e.Message); return; }
|
||||
}
|
||||
#endif
|
||||
|
||||
if (_isCombo == 1 && curFishingStateName != FishingStateName.UIEating)
|
||||
{
|
||||
if (comboToExDmg > 0 && comboToExDmgCount < curComboToExDmgCount)
|
||||
@@ -1786,6 +1852,9 @@ public class FishingUpdateSys : MonoBehaviour
|
||||
}
|
||||
}
|
||||
await Awaiters.Seconds(0.2f);
|
||||
#if UNITY_EDITOR && !SERVICE_HOST
|
||||
if(!game.PlayerDataStorage.PlayerKVGameplayLoop.RewardCanAdvance) return;
|
||||
#endif
|
||||
lockCombo = false;
|
||||
}
|
||||
}
|
||||
@@ -3130,6 +3199,10 @@ public class FishingUpdateSys : MonoBehaviour
|
||||
}
|
||||
private void OnDisable()
|
||||
{
|
||||
#if UNITY_EDITOR && !SERVICE_HOST
|
||||
game.PlayerDataStorage.PlayerKVGameplayLoop.CancelReward(this,"controller disabled");
|
||||
#endif
|
||||
|
||||
StopSoundCombo();
|
||||
StopRodAudio();
|
||||
StopNotReeling();
|
||||
@@ -3176,6 +3249,10 @@ public class FishingUpdateSys : MonoBehaviour
|
||||
}
|
||||
private void OnDestroy()
|
||||
{
|
||||
#if UNITY_EDITOR && !SERVICE_HOST
|
||||
game.PlayerDataStorage.PlayerKVGameplayLoop.CancelReward(this,"controller destroyed");
|
||||
#endif
|
||||
|
||||
disposables?.Dispose();
|
||||
_comboDisposable?.Dispose();
|
||||
_hpcoroutine = null;
|
||||
|
||||
Reference in New Issue
Block a user