浏览代码
A couple things:
A couple things:
- Fixing the bug with clients having trouble connecting to the host even when getting the necessary data. I again hit that issue with the local lobby pulling before pushing and overwriting data. - Adding a game end UI that shows the player scores before returning to the lobby. This required modifying data storage on the host to accommodate providing the scores at the end./main/staging/ngo_minigame_cleanup
nathaniel.buck@unity3d.com
3 年前
当前提交
ca5164bb
共有 14 个文件被更改,包括 1144 次插入 和 53 次删除
-
968Assets/Prefabs/InGame/InGameLogic.prefab
-
8Assets/Scripts/Game/LocalLobby.cs
-
2Assets/Scripts/Infrastructure/Messenger.cs
-
1Assets/Scripts/Lobby/LobbyContentHeartbeat.cs
-
5Assets/Scripts/Lobby/ToLocalLobby.cs
-
7Assets/Scripts/Netcode/InGameRunner.cs
-
10Assets/Scripts/Netcode/LobbyUserData.cs
-
86Assets/Scripts/Netcode/NetworkedDataStore.cs
-
10Assets/Scripts/Netcode/PlayerCursor.cs
-
40Assets/Scripts/Netcode/Scorer.cs
-
6Assets/Scripts/Netcode/SetupInGame.cs
-
8ProjectSettings/Packages/com.unity.services.vivox/Settings.json
-
35Assets/Scripts/Netcode/ResultsUserUI.cs
-
11Assets/Scripts/Netcode/ResultsUserUI.cs.meta
968
Assets/Prefabs/InGame/InGameLogic.prefab
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
using UnityEngine; |
|||
using Unity.Netcode; |
|||
|
|||
namespace LobbyRelaySample.ngo |
|||
{ |
|||
/// <summary>
|
|||
/// Displays the results for all players after the NGO minigame.
|
|||
/// </summary>
|
|||
[RequireComponent(typeof(NetworkObject))] // TODO: Include elsewhere?
|
|||
public class ResultsUserUI : NetworkBehaviour |
|||
{ |
|||
[Tooltip("The containers for the player data outputs, in order, to be hidden until the game ends.")] |
|||
[SerializeField] private CanvasGroup[] m_containers; |
|||
[Tooltip("These should be in order of appearance, i.e. the 0th entry is the 1st-place player, and so on.")] |
|||
[SerializeField] private TMPro.TMP_Text[] m_playerNameOutputs; |
|||
[Tooltip("These should also be in order of appearance.")] |
|||
[SerializeField] private TMPro.TMP_Text[] m_playerScoreOutputs; |
|||
private int m_index = 0; |
|||
|
|||
public void Start() |
|||
{ |
|||
foreach (var container in m_containers) |
|||
container.alpha = 0; |
|||
} |
|||
|
|||
// Assigned to an event in the Inspector.
|
|||
public void ReceiveScoreInOrder(LobbyUserData data) |
|||
{ |
|||
m_containers[m_index].alpha = 1; |
|||
m_playerNameOutputs[m_index].text = data.name; |
|||
m_playerScoreOutputs[m_index].text = data.score.ToString("00"); |
|||
m_index++; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 3a4ddeb182a27644480e6c47c065924e |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue