浏览代码

renamed the namespace

Renamed the namespace
added a popup for when the user forgets to input their project settings
/rename_to_gamelobby
Jacob 3 年前
当前提交
06dea12e
共有 95 个文件被更改,包括 119 次插入116 次删除
  1. 2
      Assets/Scripts/GameLobby/Auth/Identity.cs
  2. 2
      Assets/Scripts/GameLobby/Auth/NameGenerator.cs
  3. 17
      Assets/Scripts/GameLobby/Auth/SubIdentity_Authentication.cs
  4. 2
      Assets/Scripts/GameLobby/Game/Countdown.cs
  5. 2
      Assets/Scripts/GameLobby/Game/EmoteType.cs
  6. 4
      Assets/Scripts/GameLobby/Game/GameManager.cs
  7. 2
      Assets/Scripts/GameLobby/Game/LobbyServiceData.cs
  8. 2
      Assets/Scripts/GameLobby/Game/LobbyServiceDataObserver.cs
  9. 2
      Assets/Scripts/GameLobby/Game/LobbyUser.cs
  10. 2
      Assets/Scripts/GameLobby/Game/LobbyUserAudio.cs
  11. 2
      Assets/Scripts/GameLobby/Game/LobbyUserObserver.cs
  12. 2
      Assets/Scripts/GameLobby/Game/LocalLobby.cs
  13. 2
      Assets/Scripts/GameLobby/Game/LocalLobbyObserver.cs
  14. 2
      Assets/Scripts/GameLobby/Game/LocalMenuState.cs
  15. 2
      Assets/Scripts/GameLobby/Game/LocalMenuStateObserver.cs
  16. 2
      Assets/Scripts/GameLobby/Game/ServerAddress.cs
  17. 2
      Assets/Scripts/GameLobby/Infrastructure/AsyncRequest.cs
  18. 4
      Assets/Scripts/GameLobby/Infrastructure/Locator.cs
  19. 2
      Assets/Scripts/GameLobby/Infrastructure/LogHandler.cs
  20. 2
      Assets/Scripts/GameLobby/Infrastructure/LogHandlerSettings.cs
  21. 2
      Assets/Scripts/GameLobby/Infrastructure/Messenger.cs
  22. 2
      Assets/Scripts/GameLobby/Infrastructure/Observed.cs
  23. 2
      Assets/Scripts/GameLobby/Infrastructure/ObserverBehaviour.cs
  24. 2
      Assets/Scripts/GameLobby/Infrastructure/UpdateSlow.cs
  25. 2
      Assets/Scripts/GameLobby/Lobby/AsyncRequestLobby.cs
  26. 2
      Assets/Scripts/GameLobby/Lobby/LobbyAPIInterface.cs
  27. 12
      Assets/Scripts/GameLobby/Lobby/LobbyAsyncRequests.cs
  28. 2
      Assets/Scripts/GameLobby/Lobby/LobbyContentHeartbeat.cs
  29. 2
      Assets/Scripts/GameLobby/Lobby/ToLocalLobby.cs
  30. 2
      Assets/Scripts/GameLobby/NGO/IInGameInputHandler.cs
  31. 2
      Assets/Scripts/GameLobby/NGO/InGameRunner.cs
  32. 2
      Assets/Scripts/GameLobby/NGO/IntroOutroRunner.cs
  33. 2
      Assets/Scripts/GameLobby/NGO/NetworkedDataStore.cs
  34. 2
      Assets/Scripts/GameLobby/NGO/PlayerCursor.cs
  35. 2
      Assets/Scripts/GameLobby/NGO/PlayerData.cs
  36. 4
      Assets/Scripts/GameLobby/NGO/RelayNGOUtpSetup.cs
  37. 2
      Assets/Scripts/GameLobby/NGO/ResultsUserUI.cs
  38. 2
      Assets/Scripts/GameLobby/NGO/Scorer.cs
  39. 2
      Assets/Scripts/GameLobby/NGO/SequenceSelector.cs
  40. 2
      Assets/Scripts/GameLobby/NGO/SetupInGame.cs
  41. 2
      Assets/Scripts/GameLobby/NGO/SymbolContainer.cs
  42. 2
      Assets/Scripts/GameLobby/NGO/SymbolData.cs
  43. 2
      Assets/Scripts/GameLobby/NGO/SymbolKillVolume.cs
  44. 2
      Assets/Scripts/GameLobby/NGO/SymbolObject.cs
  45. 2
      Assets/Scripts/GameLobby/Relay/AsyncRequestRelay.cs
  46. 2
      Assets/Scripts/GameLobby/Relay/RelayAPIInterface.cs
  47. 2
      Assets/Scripts/GameLobby/Relay/RelayPendingApproval.cs
  48. 2
      Assets/Scripts/GameLobby/Relay/RelayUtpClient.cs
  49. 2
      Assets/Scripts/GameLobby/Relay/RelayUtpHost.cs
  50. 2
      Assets/Scripts/GameLobby/Relay/RelayUtpSetup.cs
  51. 2
      Assets/Scripts/GameLobby/Tests/Editor/AuthTests.cs
  52. 2
      Assets/Scripts/GameLobby/Tests/Editor/LoggerTests.cs
  53. 2
      Assets/Scripts/GameLobby/Tests/Editor/MessengerTests.cs
  54. 2
      Assets/Scripts/GameLobby/Tests/Editor/ObserverTests.cs
  55. 2
      Assets/Scripts/GameLobby/Tests/Editor/Tests.Editor.asmdef
  56. 6
      Assets/Scripts/GameLobby/Tests/PlayMode/LobbyRoundtripTests.cs
  57. 6
      Assets/Scripts/GameLobby/Tests/PlayMode/RelayRoundTripTests.cs
  58. 4
      Assets/Scripts/GameLobby/Tests/PlayMode/Tests.Play.asmdef
  59. 2
      Assets/Scripts/GameLobby/Tests/PlayMode/UpdateSlowTests.cs
  60. 6
      Assets/Scripts/GameLobby/Tests/PlayMode/UtpTests.cs
  61. 2
      Assets/Scripts/GameLobby/UI/BackButtonUI.cs
  62. 2
      Assets/Scripts/GameLobby/UI/CountdownUI.cs
  63. 2
      Assets/Scripts/GameLobby/UI/CreateMenuUI.cs
  64. 2
      Assets/Scripts/GameLobby/UI/DisplayCodeUI.cs
  65. 2
      Assets/Scripts/GameLobby/UI/EmoteButtonUI.cs
  66. 2
      Assets/Scripts/GameLobby/UI/EndGameButtonUI.cs
  67. 2
      Assets/Scripts/GameLobby/UI/ExitButtonUI.cs
  68. 2
      Assets/Scripts/GameLobby/UI/GameStateVisibilityUI.cs
  69. 2
      Assets/Scripts/GameLobby/UI/InLobbyUserList.cs
  70. 2
      Assets/Scripts/GameLobby/UI/InLobbyUserUI.cs
  71. 2
      Assets/Scripts/GameLobby/UI/JoinCreateLobbyUI.cs
  72. 2
      Assets/Scripts/GameLobby/UI/JoinMenuUI.cs
  73. 2
      Assets/Scripts/GameLobby/UI/LobbyButtonUI.cs
  74. 2
      Assets/Scripts/GameLobby/UI/LobbyNameUI.cs
  75. 2
      Assets/Scripts/GameLobby/UI/LobbyUserVolumeUI.cs
  76. 2
      Assets/Scripts/GameLobby/UI/MainMenuUI.cs
  77. 2
      Assets/Scripts/GameLobby/UI/NameChangeUI.cs
  78. 2
      Assets/Scripts/GameLobby/UI/ObserverPanel.cs
  79. 2
      Assets/Scripts/GameLobby/UI/PopUpUI.cs
  80. 2
      Assets/Scripts/GameLobby/UI/RateLimitVisibility.cs
  81. 2
      Assets/Scripts/GameLobby/UI/ReadyCheckUI.cs
  82. 2
      Assets/Scripts/GameLobby/UI/RecolorForLobbyType.cs
  83. 2
      Assets/Scripts/GameLobby/UI/RelayAddressUI.cs
  84. 6
      Assets/Scripts/GameLobby/UI/ShowWhenLobbyStateUI.cs
  85. 2
      Assets/Scripts/GameLobby/UI/SpinnerUI.cs
  86. 2
      Assets/Scripts/GameLobby/UI/StartLobbyButtonUI.cs
  87. 2
      Assets/Scripts/GameLobby/UI/UIPanelBase.cs
  88. 2
      Assets/Scripts/GameLobby/UI/UserNameUI.cs
  89. 2
      Assets/Scripts/GameLobby/UI/UserStateVisibilityUI.cs
  90. 2
      Assets/Scripts/GameLobby/Vivox/VivoxSetup.cs
  91. 2
      Assets/Scripts/GameLobby/Vivox/VivoxUserHandler.cs
  92. 2
      Assets/Scripts/GameLobby/GamelobbySample.asmdef
  93. 2
      LICENSE.md
  94. 0
      /Assets/Scripts/GameLobby/GamelobbySample.asmdef.meta
  95. 0
      /Assets/Scripts/GameLobby/GamelobbySample.asmdef

2
Assets/Scripts/GameLobby/Auth/Identity.cs


using System;
using System.Collections.Generic;
namespace LobbyRelaySample.Auth
namespace GamelobbySample.Auth
{
/// <summary>
/// Represents some provider of credentials.

2
Assets/Scripts/GameLobby/Auth/NameGenerator.cs


using System;
using System.Text;
namespace LobbyRelaySample
namespace GamelobbySample
{
/// <summary>
/// Just for fun, give a cute default player name if no name is provided, based on a hash of their anonymous ID.

17
Assets/Scripts/GameLobby/Auth/SubIdentity_Authentication.cs


using Unity.Services.Authentication;
using Unity.Services.Core;
namespace LobbyRelaySample.Auth
namespace GamelobbySample.Auth
{
/// <summary>
/// The Authentication package will sign in asynchronously and anonymously. When complete, we will need to store the generated ID.

private async void DoSignIn(Action onSigninComplete)
{
await UnityServices.InitializeAsync();
AuthenticationService.Instance.SignedIn += OnSignInChange;
AuthenticationService.Instance.SignedOut += OnSignInChange;
try
{
await UnityServices.InitializeAsync();
AuthenticationService.Instance.SignedIn += OnSignInChange;
AuthenticationService.Instance.SignedOut += OnSignInChange;
try
{ if (!AuthenticationService.Instance.IsSignedIn)
if (!AuthenticationService.Instance.IsSignedIn)
{ UnityEngine.Debug.LogError("Failed to login. Did you remember to set your Project ID under Services > General Settings?");
{
Locator.Get.Messenger.OnReceiveMessage(MessageType.DisplayErrorPopup, "Authentication Failed: Project ID not set in Project Settings > Services > General Settings?");
UnityEngine.Debug.LogError("Authentication Failed: Project ID not set in Project Settings > Services > General Settings?");
throw;
}

2
Assets/Scripts/GameLobby/Game/Countdown.cs


using System;
using UnityEngine;
namespace LobbyRelaySample
namespace GamelobbySample
{
/// <summary>
/// Runs the countdown to the in-game state. While the start of the countdown is synced via Relay, the countdown itself is handled locally,

2
Assets/Scripts/GameLobby/Game/EmoteType.cs


namespace LobbyRelaySample
namespace GamelobbySample
{
public enum EmoteType { None = 0, Smile, Frown, Unamused, Tongue }

4
Assets/Scripts/GameLobby/Game/GameManager.cs


using LobbyRelaySample.relay;
using GamelobbySample.relay;
namespace LobbyRelaySample
namespace GamelobbySample
{
/// <summary>
/// Sets up and runs the entire sample.

2
Assets/Scripts/GameLobby/Game/LobbyServiceData.cs


using System.Collections.Generic;
namespace LobbyRelaySample
namespace GamelobbySample
{
/// <summary>
/// Used when displaying the lobby list, to indicate when we are awaiting an updated lobby query.

2
Assets/Scripts/GameLobby/Game/LobbyServiceDataObserver.cs


namespace LobbyRelaySample
namespace GamelobbySample
{
/// <summary>
/// Holds a LobbyServiceData value and notifies all subscribers when it has been changed.

2
Assets/Scripts/GameLobby/Game/LobbyUser.cs


using System;
using UnityEngine;
namespace LobbyRelaySample
namespace GamelobbySample
{
/// <summary>
/// Current state of the user in the lobby.

2
Assets/Scripts/GameLobby/Game/LobbyUserAudio.cs


using UnityEngine;
namespace LobbyRelaySample
namespace GamelobbySample
{
[SerializeField]
public class LobbyUserAudio

2
Assets/Scripts/GameLobby/Game/LobbyUserObserver.cs


namespace LobbyRelaySample
namespace GamelobbySample
{
/// <summary>
/// Holds a LobbyUser value and notifies all subscribers when it has been changed.

2
Assets/Scripts/GameLobby/Game/LocalLobby.cs


using System.Collections.Generic;
using UnityEngine;
namespace LobbyRelaySample
namespace GamelobbySample
{
[Flags] // Some UI elements will want to specify multiple states in which to be active, so this is Flags.
public enum LobbyState

2
Assets/Scripts/GameLobby/Game/LocalLobbyObserver.cs


namespace LobbyRelaySample
namespace GamelobbySample
{
/// <summary>
/// Holds a LocalLobby value and notifies all subscribers when it has been changed.

2
Assets/Scripts/GameLobby/Game/LocalMenuState.cs


using System;
namespace LobbyRelaySample
namespace GamelobbySample
{
/// <summary>
/// Current state of the local game.

2
Assets/Scripts/GameLobby/Game/LocalMenuStateObserver.cs


namespace LobbyRelaySample
namespace GamelobbySample
{
/// <summary>
/// Holds a LocalMenuState value and notifies all subscribers when it has been changed.

2
Assets/Scripts/GameLobby/Game/ServerAddress.cs


namespace LobbyRelaySample
namespace GamelobbySample
{
/// <summary>
/// Just for displaying the anonymous Relay IP.

2
Assets/Scripts/GameLobby/Infrastructure/AsyncRequest.cs


using System;
using System.Threading.Tasks;
namespace LobbyRelaySample
namespace GamelobbySample
{
/// <summary>
/// Both Lobby and Relay have need for asynchronous requests with some basic safety wrappers. This is a shared place for that.

4
Assets/Scripts/GameLobby/Infrastructure/Locator.cs


using LobbyRelaySample.Auth;
using GamelobbySample.Auth;
namespace LobbyRelaySample
namespace GamelobbySample
{
/// <summary>
/// Anything which provides itself to a Locator can then be globally accessed. This should be a single access point for things that *want* to be singleton (that is,

2
Assets/Scripts/GameLobby/Infrastructure/LogHandler.cs


using UnityEngine;
using Object = UnityEngine.Object;
namespace LobbyRelaySample
namespace GamelobbySample
{
public enum LogMode
{

2
Assets/Scripts/GameLobby/Infrastructure/LogHandlerSettings.cs


using UnityEngine;
namespace LobbyRelaySample
namespace GamelobbySample
{
/// <summary>
/// Acts as a buffer between receiving requests to display error messages to the player and running the pop-up UI to do so.

2
Assets/Scripts/GameLobby/Infrastructure/Messenger.cs


using UnityEngine;
using Stopwatch = System.Diagnostics.Stopwatch;
namespace LobbyRelaySample
namespace GamelobbySample
{
/// <summary>
/// Core mechanism for routing messages to arbitrary listeners.

2
Assets/Scripts/GameLobby/Infrastructure/Observed.cs


using System;
namespace LobbyRelaySample
namespace GamelobbySample
{
/// <summary>
/// Something that exposes some data that, when changed, an observer would want to be notified about automatically.

2
Assets/Scripts/GameLobby/Infrastructure/ObserverBehaviour.cs


using UnityEngine;
using UnityEngine.Events;
namespace LobbyRelaySample
namespace GamelobbySample
{
/// <summary>
/// MonoBehaviour that will automatically handle setting up to observe something. It also exposes an event so some other component can effectively observe it as well.

2
Assets/Scripts/GameLobby/Infrastructure/UpdateSlow.cs


using UnityEngine;
using Stopwatch = System.Diagnostics.Stopwatch;
namespace LobbyRelaySample
namespace GamelobbySample
{
public delegate void UpdateMethod(float dt);

2
Assets/Scripts/GameLobby/Lobby/AsyncRequestLobby.cs


using System;
using Unity.Services.Lobbies;
namespace LobbyRelaySample.lobby
namespace GamelobbySample.lobby
{
public class AsyncRequestLobby : AsyncRequest
{

2
Assets/Scripts/GameLobby/Lobby/LobbyAPIInterface.cs


using Unity.Services.Lobbies;
using Unity.Services.Lobbies.Models;
namespace LobbyRelaySample.lobby
namespace GamelobbySample.lobby
{
/// <summary>
/// Wrapper for all the interactions with the Lobby API.

12
Assets/Scripts/GameLobby/Lobby/LobbyAsyncRequests.cs


using LobbyRelaySample.lobby;
using System;
using System;
using GamelobbySample.lobby;
namespace LobbyRelaySample
namespace GamelobbySample
/// An abstraction layer between the direct calls into the Lobby API and the outcomes you actually want. E.g. you can request to get a readable list of
/// An abstraction layer between the direct calls into the Lobby API and the outcomes you actually want. E.g. you can request to get a readable list of
/// current lobbies and not need to make the query call directly.
/// </summary>
public class LobbyAsyncRequests

dataCurr[dataNew.Key] = dataObj;
else
dataCurr.Add(dataNew.Key, dataObj);
//Special Use: Get the state of the Local lobby so we can lock it from appearing in queries if it's not in the "Lobby" State
if (dataNew.Key == "State")
{

}
}
LobbyAPIInterface.UpdateLobbyAsync(lobby.Id, dataCurr, shouldLock, (result) =>
{

2
Assets/Scripts/GameLobby/Lobby/LobbyContentHeartbeat.cs


using System.Collections.Generic;
using LobbyRemote = Unity.Services.Lobbies.Models.Lobby;
namespace LobbyRelaySample
namespace GamelobbySample
{
/// <summary>
/// Keep updated on changes to a joined lobby, at a speed compliant with Lobby's rate limiting.

2
Assets/Scripts/GameLobby/Lobby/ToLocalLobby.cs


using System.Collections.Generic;
using Unity.Services.Lobbies.Models;
namespace LobbyRelaySample.lobby
namespace GamelobbySample.lobby
{
/// <summary>
/// Convert the lobby resulting from a request into a LocalLobby for use in the game logic.

2
Assets/Scripts/GameLobby/NGO/IInGameInputHandler.cs


namespace LobbyRelaySample.ngo
namespace GamelobbySample.ngo
{
/// <summary>
/// Something that will handle player input while in the game.

2
Assets/Scripts/GameLobby/NGO/InGameRunner.cs


using Unity.Netcode;
using UnityEngine;
namespace LobbyRelaySample.ngo
namespace GamelobbySample.ngo
{
/// <summary>
/// Once the NetworkManager has been spawned, we need something to manage the game state and setup other in-game objects

2
Assets/Scripts/GameLobby/NGO/IntroOutroRunner.cs


using System;
using UnityEngine;
namespace LobbyRelaySample.ngo
namespace GamelobbySample.ngo
{
/// <summary>
/// Handles any visual tasks for running the NGO minigame's intro and outro.

2
Assets/Scripts/GameLobby/NGO/NetworkedDataStore.cs


using Unity.Netcode;
using UnityEngine.Events;
namespace LobbyRelaySample.ngo
namespace GamelobbySample.ngo
{
/// <summary>
/// A place to store data needed by networked behaviors. Each client has an instance so they can retrieve data, but the server's instance stores the actual data.

2
Assets/Scripts/GameLobby/NGO/PlayerCursor.cs


using Unity.Netcode;
using UnityEngine;
namespace LobbyRelaySample.ngo
namespace GamelobbySample.ngo
{
/// <summary>
/// This cursor object will follow the owning player's mouse cursor and be visible to the other players.

2
Assets/Scripts/GameLobby/NGO/PlayerData.cs


using Unity.Netcode;
namespace LobbyRelaySample.ngo
namespace GamelobbySample.ngo
{
/// <summary>
/// An example of a custom type serialized for use in RPC calls. This represents the state of a player as far as NGO is concerned,

4
Assets/Scripts/GameLobby/NGO/RelayNGOUtpSetup.cs


using System;
using GamelobbySample.relay;
using LobbyRelaySample.relay;
namespace LobbyRelaySample.ngo
namespace GamelobbySample.ngo
{
/*
* To use Netcode for GameObjects (NGO), we use the Relay adapter for UTP, attached to a NetworkManager. This needs to be provided the Allocation info before we bind to it.

2
Assets/Scripts/GameLobby/NGO/ResultsUserUI.cs


using UnityEngine;
using Unity.Netcode;
namespace LobbyRelaySample.ngo
namespace GamelobbySample.ngo
{
/// <summary>
/// Displays the results for all players after the NGO minigame.

2
Assets/Scripts/GameLobby/NGO/Scorer.cs


using UnityEngine;
using UnityEngine.Events;
namespace LobbyRelaySample.ngo
namespace GamelobbySample.ngo
{
/// <summary>
/// Used by the host to actually track scores for all players, and by each client to monitor for updates to their own score.

2
Assets/Scripts/GameLobby/NGO/SequenceSelector.cs


using UnityEngine.UI;
using Random = UnityEngine.Random;
namespace LobbyRelaySample.ngo
namespace GamelobbySample.ngo
{
/// <summary>
/// Handles selecting the randomized sequence of symbols to spawn, choosing a subset to be the ordered target sequence that each player needs to select.

2
Assets/Scripts/GameLobby/NGO/SetupInGame.cs


using Unity.Netcode;
using UnityEngine;
namespace LobbyRelaySample.ngo
namespace GamelobbySample.ngo
{
/// <summary>
/// Once the local player is in a lobby and that lobby has entered the In-Game state, this will load in whatever is necessary to actually run the game part.

2
Assets/Scripts/GameLobby/NGO/SymbolContainer.cs


using UnityEngine;
using Unity.Netcode.Components;
namespace LobbyRelaySample.ngo
namespace GamelobbySample.ngo
{
/// <summary>
/// Rather than track movement data for every symbol object, the symbols will all be parented under one container that will move.

2
Assets/Scripts/GameLobby/NGO/SymbolData.cs


using System.Collections.Generic;
using UnityEngine;
namespace LobbyRelaySample.ngo
namespace GamelobbySample.ngo
{
/// <summary>
/// Associates a symbol index with the sprite to display for symbol objects matching the index.

2
Assets/Scripts/GameLobby/NGO/SymbolKillVolume.cs


using System;
using UnityEngine;
namespace LobbyRelaySample.ngo
namespace GamelobbySample.ngo
{
/// <summary>
/// Used by the host to deactivate symbol objects once they're off-screen.

2
Assets/Scripts/GameLobby/NGO/SymbolObject.cs


using UnityEngine;
using VivoxUnity;
namespace LobbyRelaySample.ngo
namespace GamelobbySample.ngo
{
/// <summary>
/// This holds the logic and data for an individual symbol, which can be "clicked" if the server detects the collision with a player who sends a click input.

2
Assets/Scripts/GameLobby/Relay/AsyncRequestRelay.cs


using System;
using Unity.Services.Relay;
namespace LobbyRelaySample.relay
namespace GamelobbySample.relay
{
public class AsyncRequestRelay : AsyncRequest
{

2
Assets/Scripts/GameLobby/Relay/RelayAPIInterface.cs


using UnityEngine;
using RelayService = Unity.Services.Relay.Relay;
namespace LobbyRelaySample.relay
namespace GamelobbySample.relay
{
/// <summary>
/// Wrapper for all the interaction with the Relay API.

2
Assets/Scripts/GameLobby/Relay/RelayPendingApproval.cs


using System;
using Unity.Networking.Transport;
namespace LobbyRelaySample.relay
namespace GamelobbySample.relay
{
/// <summary>
/// The Relay host doesn't need to know what might approve or disapprove of a pending connection, so this will

2
Assets/Scripts/GameLobby/Relay/RelayUtpClient.cs


using Unity.Networking.Transport;
using UnityEngine;
namespace LobbyRelaySample.relay
namespace GamelobbySample.relay
{
public enum Approval { OK = 0, GameAlreadyStarted }

2
Assets/Scripts/GameLobby/Relay/RelayUtpHost.cs


using System.Collections.Generic;
using Unity.Networking.Transport;
namespace LobbyRelaySample.relay
namespace GamelobbySample.relay
{
/// <summary>
/// In addition to maintaining a heartbeat with the Relay server to keep it from timing out, the host player must pass network events

2
Assets/Scripts/GameLobby/Relay/RelayUtpSetup.cs


using Unity.Services.Relay.Models;
using UnityEngine;
namespace LobbyRelaySample.relay
namespace GamelobbySample.relay
{
/// <summary>
/// Responsible for setting up a connection with Relay using Unity Transport (UTP). A Relay Allocation is created by the host, and then all players

2
Assets/Scripts/GameLobby/Tests/Editor/AuthTests.cs


using LobbyRelaySample.Auth;
using GamelobbySample.Auth;
using NUnit.Framework;
namespace Test

2
Assets/Scripts/GameLobby/Tests/Editor/LoggerTests.cs


using LobbyRelaySample;
using GamelobbySample;
using System;
using NUnit.Framework;
using UnityEngine;

2
Assets/Scripts/GameLobby/Tests/Editor/MessengerTests.cs


using LobbyRelaySample;
using GamelobbySample;
using NUnit.Framework;
using System;
using System.Text.RegularExpressions;

2
Assets/Scripts/GameLobby/Tests/Editor/ObserverTests.cs


using LobbyRelaySample;
using GamelobbySample;
using System.Collections;
using UnityEngine;
using UnityEngine.TestTools;

2
Assets/Scripts/GameLobby/Tests/Editor/Tests.Editor.asmdef


"references": [
"UnityEngine.TestRunner",
"UnityEditor.TestRunner",
"LobbyRelaySample"
"GamelobbySample"
],
"includePlatforms": [
"Editor"

6
Assets/Scripts/GameLobby/Tests/PlayMode/LobbyRoundtripTests.cs


using Unity.Services.Lobbies.Models;
using UnityEngine;
using UnityEngine.TestTools;
using LobbyAPIInterface = LobbyRelaySample.lobby.LobbyAPIInterface;
using LobbyAPIInterface = GamelobbySample.lobby.LobbyAPIInterface;
namespace Test
{

public class LobbyRoundtripTests
{
private string m_workingLobbyId;
private LobbyRelaySample.Auth.SubIdentity_Authentication m_auth;
private GamelobbySample.Auth.SubIdentity_Authentication m_auth;
private bool m_didSigninComplete = false;
private Dictionary<string, PlayerDataObject> m_mockUserData; // This is handled in the LobbyAsyncRequest calls normally, but we need to supply this for the direct Lobby API calls.

m_auth = new LobbyRelaySample.Auth.SubIdentity_Authentication(() => { m_didSigninComplete = true; });
m_auth = new GamelobbySample.Auth.SubIdentity_Authentication(() => { m_didSigninComplete = true; });
m_mockUserData = new Dictionary<string, PlayerDataObject>();
m_mockUserData.Add("DisplayName", new PlayerDataObject(PlayerDataObject.VisibilityOptions.Member, "TestUser123"));
}

6
Assets/Scripts/GameLobby/Tests/PlayMode/RelayRoundTripTests.cs


using System;
using System.Collections;
using LobbyRelaySample.relay;
using GamelobbySample.relay;
using NUnit.Framework;
using Unity.Services.Relay.Models;
using UnityEngine;

/// </summary>
public class RelayRoundTripTests
{
private LobbyRelaySample.Auth.SubIdentity_Authentication m_auth;
private GamelobbySample.Auth.SubIdentity_Authentication m_auth;
m_auth = new LobbyRelaySample.Auth.SubIdentity_Authentication(() => { m_didSigninComplete = true; });
m_auth = new GamelobbySample.Auth.SubIdentity_Authentication(() => { m_didSigninComplete = true; });
}
[OneTimeTearDown]

4
Assets/Scripts/GameLobby/Tests/PlayMode/Tests.Play.asmdef


"references": [
"UnityEngine.TestRunner",
"UnityEditor.TestRunner",
"LobbyRelaySample",
"Unity.Networking.Transport"
"Unity.Networking.Transport",
"GamelobbySample"
],
"includePlatforms": [],
"excludePlatforms": [],

2
Assets/Scripts/GameLobby/Tests/PlayMode/UpdateSlowTests.cs


using LobbyRelaySample;
using GamelobbySample;
using NUnit.Framework;
using System;
using System.Collections;

6
Assets/Scripts/GameLobby/Tests/PlayMode/UtpTests.cs


using System;
using System.Collections;
using LobbyRelaySample.relay;
using GamelobbySample.relay;
using NUnit.Framework;
using Unity.Networking.Transport;
using Unity.Services.Relay.Models;

}
}
private LobbyRelaySample.Auth.SubIdentity_Authentication m_auth;
private GamelobbySample.Auth.SubIdentity_Authentication m_auth;
GameObject m_dummy;
//Only used when testing DTLS
#pragma warning disable CS0414 // This is the "assigned but its value is never used" warning, which will otherwise appear when DTLS is unavailable.

public void Setup()
{
m_dummy = new GameObject();
m_auth = new LobbyRelaySample.Auth.SubIdentity_Authentication(() => { m_didSigninComplete = true; });
m_auth = new GamelobbySample.Auth.SubIdentity_Authentication(() => { m_didSigninComplete = true; });
}
[OneTimeTearDown]

2
Assets/Scripts/GameLobby/UI/BackButtonUI.cs


using UnityEngine;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
/// <summary>
/// For navigating the main menu.

2
Assets/Scripts/GameLobby/UI/CountdownUI.cs


using TMPro;
using UnityEngine;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
/// <summary>
/// After all players ready up for the game, this will show the countdown that occurs.

2
Assets/Scripts/GameLobby/UI/CreateMenuUI.cs


using UnityEngine;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
/// <summary>
/// Handles the menu for a player creating a new lobby.

2
Assets/Scripts/GameLobby/UI/DisplayCodeUI.cs


using TMPro;
using UnityEngine;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
/// <summary>
/// Watches a lobby or relay code for updates, displaying the current code to lobby members.

2
Assets/Scripts/GameLobby/UI/EmoteButtonUI.cs


using TMPro;
using UnityEngine;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
/// <summary>
/// Controls a button which will set the local player's emote state when pressed. This demonstrates a player updating their data within the room.

2
Assets/Scripts/GameLobby/UI/EndGameButtonUI.cs


using UnityEngine;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
/// <summary>
/// After connecting to Relay, the host can use this to end the game, returning to the regular lobby state.

2
Assets/Scripts/GameLobby/UI/ExitButtonUI.cs


using UnityEngine;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
/// <summary>
/// When the main menu's Exit button is selected, send a quit signal.

2
Assets/Scripts/GameLobby/UI/GameStateVisibilityUI.cs


using UnityEngine;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
/// <summary>
/// Show or hide a UI element based on the current GameState (e.g. in a lobby).

2
Assets/Scripts/GameLobby/UI/InLobbyUserList.cs


using System.Collections.Generic;
using UnityEngine;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
/// <summary>
/// Contains the InLobbyUserUI instances while showing the UI for a lobby.

2
Assets/Scripts/GameLobby/UI/InLobbyUserUI.cs


using UnityEngine;
using UnityEngine.UI;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
/// <summary>
/// When inside a lobby, this will show information about a player, whether local or remote.

2
Assets/Scripts/GameLobby/UI/JoinCreateLobbyUI.cs


using UnityEngine;
using UnityEngine.Events;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
public enum JoinCreateTabs
{

2
Assets/Scripts/GameLobby/UI/JoinMenuUI.cs


using TMPro;
using UnityEngine;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
/// <summary>
/// Handles the list of LobbyButtons and ensures it stays synchronized with the lobby list from the service.

2
Assets/Scripts/GameLobby/UI/LobbyButtonUI.cs


using UnityEngine;
using UnityEngine.Events;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
/// <summary>
/// Controls an entry in the join menu's list of lobbies, acting as a clickable button as well as displaying info about the lobby.

2
Assets/Scripts/GameLobby/UI/LobbyNameUI.cs


using TMPro;
using UnityEngine;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
/// <summary>
/// Displays the name of the lobby.

2
Assets/Scripts/GameLobby/UI/LobbyUserVolumeUI.cs


using UnityEngine;
using UnityEngine.UI;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
public class LobbyUserVolumeUI : MonoBehaviour
{

2
Assets/Scripts/GameLobby/UI/MainMenuUI.cs


using UnityEngine;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
/// <summary>
/// Watches for changes in the game state to/from the main menu.

2
Assets/Scripts/GameLobby/UI/NameChangeUI.cs


namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
/// <summary>
/// When the player changes their name with the UI, this triggers the actual rename.

2
Assets/Scripts/GameLobby/UI/ObserverPanel.cs


namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
/// <summary>
/// Observer UI panel base class. This allows UI elements to be shown or hidden based on an Observed element.

2
Assets/Scripts/GameLobby/UI/PopUpUI.cs


using TMPro;
using UnityEngine;
namespace LobbyRelaySample
namespace GamelobbySample
{
/// <summary>
/// Controls a pop-up message that lays over the rest of the UI, with a button to dismiss. Used for displaying player-facing error messages.

2
Assets/Scripts/GameLobby/UI/RateLimitVisibility.cs


using UnityEngine;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
/// <summary>
/// Observes the Lobby request rate limits and changes the visibility of a UIPanelBase to suit.

2
Assets/Scripts/GameLobby/UI/ReadyCheckUI.cs


using UnityEngine;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
/// <summary>
/// Button callbacks for the "Ready"/"Not Ready" buttons used to indicate the local player is ready/not ready.

2
Assets/Scripts/GameLobby/UI/RecolorForLobbyType.cs


using UnityEngine;
using UnityEngine.UI;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
/// <summary>
/// We want to illustrate filtering the lobby list by some arbitrary variable. This will allow the lobby host to choose a color for the lobby, and will display a lobby's current color.

2
Assets/Scripts/GameLobby/UI/RelayAddressUI.cs


using TMPro;
using UnityEngine;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
/// <summary>
/// Displays the IP when connected to Relay.

6
Assets/Scripts/GameLobby/UI/ShowWhenLobbyStateUI.cs


using UnityEngine;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
/// <summary>
/// UI element that is displayed when the lobby is in a particular state (e.g. counting down, in-game).
/// <summary>
/// UI element that is displayed when the lobby is in a particular state (e.g. counting down, in-game).
/// </summary>
public class ShowWhenLobbyStateUI : ObserverPanel<LocalLobby>
{

2
Assets/Scripts/GameLobby/UI/SpinnerUI.cs


using TMPro;
using UnityEngine;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
/// <summary>
/// Controls a simple throbber that is displayed when the lobby list is being refreshed.

2
Assets/Scripts/GameLobby/UI/StartLobbyButtonUI.cs


using UnityEngine;
namespace LobbyRelaySample
namespace GamelobbySample
{
/// <summary>
/// Main menu start button.

2
Assets/Scripts/GameLobby/UI/UIPanelBase.cs


using UnityEngine;
using UnityEngine.Events;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
/// <summary>
/// Basic UI element that can be shown or hidden.

2
Assets/Scripts/GameLobby/UI/UserNameUI.cs


using TMPro;
using UnityEngine;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
/// <summary>
/// Displays the player's name.

2
Assets/Scripts/GameLobby/UI/UserStateVisibilityUI.cs


using System;
using UnityEngine;
namespace LobbyRelaySample.UI
namespace GamelobbySample.UI
{
/// <summary>
/// User permission type. It's a flag enum to allow for the Inspector to select multiples for various UI features.

2
Assets/Scripts/GameLobby/Vivox/VivoxSetup.cs


using Unity.Services.Vivox;
using VivoxUnity;
namespace LobbyRelaySample.vivox
namespace GamelobbySample.vivox
{
/// <summary>
/// Handles setting up a voice channel once inside a lobby.

2
Assets/Scripts/GameLobby/Vivox/VivoxUserHandler.cs


using Unity.Services.Vivox;
using VivoxUnity;
namespace LobbyRelaySample.vivox
namespace GamelobbySample.vivox
{
/// <summary>
/// Listens for changes to Vivox state for one user in the lobby.

2
Assets/Scripts/GameLobby/GamelobbySample.asmdef


{
"name": "LobbyRelaySample",
"name": "GamelobbySample",
"rootNamespace": "",
"references": [
"GUID:6055be8ebefd69e48b49212b09b47b2f",

2
LICENSE.md


com.unity.services.samples.lobby-rooms © 2021 Unity Technologies
com.unity.services.samples.game-lobby © 2021 Unity Technologies
Licensed under the Unity Companion License for Unity-dependent projects (see https://unity3d.com/legal/licenses/unity_companion_license).
Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. Please review the license for details on these and other terms and conditions.

/Assets/Scripts/GameLobby/LobbyRelaySample.asmdef.meta → /Assets/Scripts/GameLobby/GamelobbySample.asmdef.meta

/Assets/Scripts/GameLobby/LobbyRelaySample.asmdef → /Assets/Scripts/GameLobby/GamelobbySample.asmdef

正在加载...
取消
保存