浏览代码

Adding in client RPC calls so that clients will run the game end sequence.

/main/staging/ngo_minigame_cleanup
nathaniel.buck@unity3d.com 3 年前
当前提交
f6d1e31f
共有 2 个文件被更改,包括 5 次插入9 次删除
  1. 8
      Assets/Scripts/Netcode/InGameRunner.cs
  2. 6
      Assets/Scripts/Netcode/Scorer.cs

8
Assets/Scripts/Netcode/InGameRunner.cs


public void OnSymbolDeactivated()
{
if (--m_remainingSymbolCount <= 0)
WaitForEndingSequence();
WaitForEndingSequence_ClientRpc();
}
/// <summary>

private void WaitForEndingSequence()
[ClientRpc]
private void WaitForEndingSequence_ClientRpc()
{
m_scorer.OnGameEnd();
m_introOutroRunner.DoOutro(EndGame);

{
StartCoroutine(EndGame_ClientsFirst());
if (IsHost)
StartCoroutine(EndGame_ClientsFirst());
}
private IEnumerator EndGame_ClientsFirst()

6
Assets/Scripts/Netcode/Scorer.cs


public void OnGameEnd()
{
OnGameEnd_ClientRpc();
}
[ClientRpc]
public void OnGameEnd_ClientRpc()
{
m_dataStore.GetAllPlayerData(m_onGameEnd);
}
}
正在加载...
取消
保存