浏览代码

Changing the InGame namespace/directory to NGO for clarity.

/main/staging/ngo_minigame_cleanup
nathaniel.buck@unity3d.com 3 年前
当前提交
120aeb08
共有 15 个文件被更改,包括 21 次插入21 次删除
  1. 2
      Assets/Prefabs/InGame/SymbolObject.prefab
  2. 6
      Assets/Scripts/Infrastructure/Locator.cs
  3. 2
      Assets/Scripts/Netcode/IInGameInputHandler.cs
  4. 2
      Assets/Scripts/Netcode/InGameRunner.cs
  5. 2
      Assets/Scripts/Netcode/PlayerCursor.cs
  6. 10
      Assets/Scripts/Netcode/RelayNGOUtpSetup.cs
  7. 2
      Assets/Scripts/Netcode/Scorer.cs
  8. 2
      Assets/Scripts/Netcode/SequenceSelector.cs
  9. 6
      Assets/Scripts/Netcode/SetupInGame.cs
  10. 2
      Assets/Scripts/Netcode/SymbolContainer.cs
  11. 2
      Assets/Scripts/Netcode/SymbolData.cs
  12. 2
      Assets/Scripts/Netcode/SymbolKillVolume.cs
  13. 2
      Assets/Scripts/Netcode/SymbolObject.cs
  14. 0
      /Assets/Scripts/Netcode.meta
  15. 0
      /Assets/Scripts/Netcode

2
Assets/Prefabs/InGame/SymbolObject.prefab


m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8828823320646980938}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 10, z: 40}
m_LocalPosition: {x: 0, y: 10, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1523494045356209839}

6
Assets/Scripts/Infrastructure/Locator.cs


Provide(new Messenger());
Provide(new UpdateSlowNoop());
Provide(new IdentityNoop());
Provide(new inGame.InGameInputHandlerNoop());
Provide(new ngo.InGameInputHandlerNoop());
FinishConstruction();
}

public IIdentity Identity => Locate<IIdentity>();
public void Provide(IIdentity identity) { ProvideAny(identity); }
public inGame.IInGameInputHandler InGameInputHandler => Locate<inGame.IInGameInputHandler>();
public void Provide(inGame.IInGameInputHandler inputHandler) { ProvideAny(inputHandler); }
public ngo.IInGameInputHandler InGameInputHandler => Locate<ngo.IInGameInputHandler>();
public void Provide(ngo.IInGameInputHandler inputHandler) { ProvideAny(inputHandler); }
// As you add more Provided types, be sure their default implementations are included in the constructor.
}

2
Assets/Scripts/Netcode/IInGameInputHandler.cs


namespace LobbyRelaySample.inGame
namespace LobbyRelaySample.ngo
{
public interface IInGameInputHandler : IProvidable<IInGameInputHandler>
{

2
Assets/Scripts/Netcode/InGameRunner.cs


using Unity.Netcode;
using UnityEngine;
namespace LobbyRelaySample.inGame
namespace LobbyRelaySample.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/Netcode/PlayerCursor.cs


using Unity.Netcode;
using UnityEngine;
namespace LobbyRelaySample.inGame
namespace LobbyRelaySample.ngo
{
/// <summary>
/// Each player's cursor needs to be controlled by them and visible to the other players.

10
Assets/Scripts/Netcode/RelayNGOUtpSetup.cs


using UnityEngine;
using LobbyRelaySample.relay;
namespace LobbyRelaySample.inGame
namespace LobbyRelaySample.ngo
{
/*
* When using the Relay adapter for UTP to connect the NetworkManager for Netcode for GameObjects (NGO), we need to provide the Allocation info without manually binding to it.

/// </summary>
public class RelayUtpNGOSetupHost : MonoBehaviour // If this is a MonoBehaviour, it can be added to the InGameRunner object for easier cleanup on game end.
{
private inGame.SetupInGame m_setupInGame;
private SetupInGame m_setupInGame;
public void Initialize(inGame.SetupInGame setupInGame, LocalLobby lobby, Action onJoin)
public void Initialize(SetupInGame setupInGame, LocalLobby lobby, Action onJoin)
{
m_setupInGame = setupInGame;
m_localLobby = lobby;

/// </summary>
public class RelayUtpNGOSetupClient : MonoBehaviour // This is also a MonoBehaviour for access to OnDestroy, to ensure unsubscription from the local lobby on game end.
{
private inGame.SetupInGame m_setupInGame;
private SetupInGame m_setupInGame;
public void Initialize(inGame.SetupInGame setupInGame, LocalLobby lobby, Action onJoin)
public void Initialize(SetupInGame setupInGame, LocalLobby lobby, Action onJoin)
{
m_setupInGame = setupInGame;
m_localLobby = lobby;

2
Assets/Scripts/Netcode/Scorer.cs


using Unity.Netcode;
using UnityEngine;
namespace LobbyRelaySample.inGame
namespace LobbyRelaySample.ngo
{
// TODO: I'm using host and server interchangeably...

2
Assets/Scripts/Netcode/SequenceSelector.cs


using UnityEngine;
using UnityEngine.UI;
namespace LobbyRelaySample.inGame
namespace LobbyRelaySample.ngo
{
/// <summary>
/// Handles selecting the randomized sequence of symbols to spawn. This also selects a subset of the selected symbols to be the target

6
Assets/Scripts/Netcode/SetupInGame.cs


using Unity.Netcode;
using UnityEngine;
namespace LobbyRelaySample.inGame
namespace LobbyRelaySample.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.

UnityTransport transport = m_inGameManagerObj.GetComponentInChildren<UnityTransport>();
if (m_isHost)
m_inGameManagerObj.AddComponent<inGame.RelayUtpNGOSetupHost>().Initialize(this, m_lobby, () => { m_initializeTransport(transport); m_networkManager.StartHost(); });
m_inGameManagerObj.AddComponent<RelayUtpNGOSetupHost>().Initialize(this, m_lobby, () => { m_initializeTransport(transport); m_networkManager.StartHost(); });
m_inGameManagerObj.AddComponent<inGame.RelayUtpNGOSetupClient>().Initialize(this, m_lobby, () => { m_initializeTransport(transport); m_networkManager.StartClient(); });
m_inGameManagerObj.AddComponent<RelayUtpNGOSetupClient>().Initialize(this, m_lobby, () => { m_initializeTransport(transport); m_networkManager.StartClient(); });
}

2
Assets/Scripts/Netcode/SymbolContainer.cs


using Unity.Netcode;
using UnityEngine;
namespace LobbyRelaySample.inGame
namespace LobbyRelaySample.ngo
{
// Note: The SymbolObjects, which will be children of this object, need their NetworkTransforms to have IsLocalSpace set to true. Otherwise, they might get desynced.
// (This would manifest as packet loss errors.)

2
Assets/Scripts/Netcode/SymbolData.cs


using System.Collections.Generic;
using UnityEngine;
namespace LobbyRelaySample.inGame
namespace LobbyRelaySample.ngo
{
public class SymbolData : ScriptableObject
{

2
Assets/Scripts/Netcode/SymbolKillVolume.cs


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

2
Assets/Scripts/Netcode/SymbolObject.cs


using Unity.Netcode;
using UnityEngine;
namespace LobbyRelaySample.inGame
namespace LobbyRelaySample.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.

/Assets/Scripts/Game/InGame.meta → /Assets/Scripts/Netcode.meta

/Assets/Scripts/Game/InGame → /Assets/Scripts/Netcode

正在加载...
取消
保存