mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Network Lobby Manager & Lobby Player (#356)
* Initial Commit with Unity's Network Lobby Components * Lobby Components WIP * Massive simplifications and structural changes to NetworkLobbyManager and NetworkLobbyPlayer * Replaced more default messages with Command structure resulting in further simplification and less LOC * Completed removal of messages * Code Formatting and GUI Layout * Fixed bugs and finished Remove feature in UI * Added Network Lobby Manager Doc * Network Lobby Docs * Network Lobby Player Doc * Updated doc and image about Offline Scene * changed to PNG * Added Lobby components to navigation * Conformed to naming convention Removed some leftover cruft Removed maxPlayers (redundant to maxConnections) Trapped and killed null ref in OnServerDisconnect * Fixed mistake in OnServerDisconnect * Fix Active Scene check * Alow clean switch to Offline scene * Add Help URL attributes to components * Added Help URL Attributes * Fixed OnGUI logic error. * Added Example and README * Fixed Disconnect handler * Updated Docs * Added Header for Inspector * Finished Lobby Example Minigame * Minor cleanup * Set targetFramerates * Code Cleanup Changed to extended Lobby Manager for player Indexes & colors * Minor changes to align with Mirror's NetworkManager * Fixed logic error * SyncVar Hook Workaround Random Start Positions * Revert making CallOnClientEnterLobby public * Added documentation to the extension * Minor code rearrangement * Made OnGUI virtual so it can be overridden. Added AllPlayersReady bool for convenience to extenders Start Game enhancement to example. * added comments * Corrected namespaces and usings * Reworked DontDestroyOnLoad LobbyPlayer: Moved code from OnStartClient to Start Added LobbyPlayerExt to Lobby Example Code cleanup, added regions Fixed Start Game button bug * Final push of Lobby example to make sure it's complete. * Improved Lobby Example * Code cleanup * Added ground texture Set player camera angle Adjusted lighting angle * Updated ReadMe Cleaned up privates Fixed example to use SetParent Changed to 5 max connections in example * Prefab name fixes due to Mirror master's changes Changed camera handling and GamePlayer Prefab Two more SetParent fixes Demoted two warnings to information Added more comments to example scripts * Revisions based on Vis2K review...more to come. * Added f's where assigning literals to floats * Removed manual calls to SyncVar Hooks because the bug is now fixed. * Changed to GUILayout * wrapped in namespace * Changed to GUILayout * All changes per peer review * Renamed folder to Lobby. * Fix due to change in Mirror 1691 * Renamed Scenes Added LobbyScene property to OfflineGUI script.
This commit is contained in:
parent
82d4cf08ff
commit
7e7683766f
490
Assets/Mirror/Components/NetworkLobbyManager.cs
Normal file
490
Assets/Mirror/Components/NetworkLobbyManager.cs
Normal file
@ -0,0 +1,490 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
namespace Mirror
|
||||
{
|
||||
[AddComponentMenu("Network/NetworkLobbyManager")]
|
||||
[HelpURL("https://vis2k.github.io/Mirror/Components/NetworkLobbyManager")]
|
||||
public class NetworkLobbyManager : NetworkManager
|
||||
{
|
||||
struct PendingPlayer
|
||||
{
|
||||
public NetworkConnection conn;
|
||||
public GameObject lobbyPlayer;
|
||||
}
|
||||
|
||||
// configuration
|
||||
[Header("Lobby Settings")]
|
||||
[FormerlySerializedAs("m_ShowLobbyGUI")] [SerializeField] internal bool showLobbyGUI = true;
|
||||
[FormerlySerializedAs("m_MinPlayers")] [SerializeField] int minPlayers = 1;
|
||||
[FormerlySerializedAs("m_LobbyPlayerPrefab")] [SerializeField] NetworkLobbyPlayer lobbyPlayerPrefab;
|
||||
|
||||
[Scene]
|
||||
public string LobbyScene;
|
||||
|
||||
[Scene]
|
||||
public string GameplayScene;
|
||||
|
||||
// runtime data
|
||||
[FormerlySerializedAs("m_PendingPlayers")] List<PendingPlayer> pendingPlayers = new List<PendingPlayer>();
|
||||
List<NetworkLobbyPlayer> lobbySlots = new List<NetworkLobbyPlayer>();
|
||||
|
||||
public bool allPlayersReady = false;
|
||||
|
||||
public override void OnValidate()
|
||||
{
|
||||
// always >= 0
|
||||
maxConnections = Mathf.Max(maxConnections, 0);
|
||||
|
||||
// always <= maxConnections
|
||||
minPlayers = Mathf.Min(minPlayers, maxConnections);
|
||||
|
||||
// always >= 0
|
||||
minPlayers = Mathf.Max(minPlayers, 0);
|
||||
|
||||
if (lobbyPlayerPrefab != null)
|
||||
{
|
||||
NetworkIdentity identity = lobbyPlayerPrefab.GetComponent<NetworkIdentity>();
|
||||
if (identity == null)
|
||||
{
|
||||
lobbyPlayerPrefab = null;
|
||||
Debug.LogError("LobbyPlayer prefab must have a NetworkIdentity component.");
|
||||
}
|
||||
}
|
||||
|
||||
base.OnValidate();
|
||||
}
|
||||
|
||||
public void PlayerLoadedScene(NetworkConnection conn)
|
||||
{
|
||||
if (LogFilter.Debug) Debug.Log("NetworkLobbyManager OnSceneLoadedMessage");
|
||||
SceneLoadedForPlayer(conn, conn.playerController.gameObject);
|
||||
}
|
||||
|
||||
internal void ReadyStatusChanged()
|
||||
{
|
||||
int CurrentPlayers = 0;
|
||||
int ReadyPlayers = 0;
|
||||
foreach (NetworkLobbyPlayer item in lobbySlots)
|
||||
{
|
||||
if (item != null)
|
||||
{
|
||||
CurrentPlayers++;
|
||||
if (item.ReadyToBegin)
|
||||
ReadyPlayers++;
|
||||
}
|
||||
}
|
||||
if (CurrentPlayers == ReadyPlayers)
|
||||
CheckReadyToBegin();
|
||||
else
|
||||
allPlayersReady = false;
|
||||
}
|
||||
|
||||
void SceneLoadedForPlayer(NetworkConnection conn, GameObject lobbyPlayerGameObject)
|
||||
{
|
||||
// if not a lobby player.. dont replace it
|
||||
if (lobbyPlayerGameObject.GetComponent<NetworkLobbyPlayer>() == null) return;
|
||||
|
||||
if (LogFilter.Debug) Debug.LogFormat("NetworkLobby SceneLoadedForPlayer scene: {0} {1}", SceneManager.GetActiveScene().name, conn);
|
||||
|
||||
if (SceneManager.GetActiveScene().name == LobbyScene)
|
||||
{
|
||||
// cant be ready in lobby, add to ready list
|
||||
PendingPlayer pending;
|
||||
pending.conn = conn;
|
||||
pending.lobbyPlayer = lobbyPlayerGameObject;
|
||||
pendingPlayers.Add(pending);
|
||||
return;
|
||||
}
|
||||
|
||||
GameObject gamePlayer = OnLobbyServerCreateGamePlayer(conn);
|
||||
if (gamePlayer == null)
|
||||
{
|
||||
// get start position from base class
|
||||
Transform startPos = GetStartPosition();
|
||||
gamePlayer = startPos != null
|
||||
? Instantiate(playerPrefab, startPos.position, startPos.rotation)
|
||||
: Instantiate(playerPrefab, Vector3.zero, Quaternion.identity);
|
||||
gamePlayer.name = playerPrefab.name;
|
||||
}
|
||||
|
||||
if (!OnLobbyServerSceneLoadedForPlayer(lobbyPlayerGameObject, gamePlayer))
|
||||
return;
|
||||
|
||||
// replace lobby player with game player
|
||||
NetworkServer.ReplacePlayerForConnection(conn, gamePlayer);
|
||||
}
|
||||
|
||||
public void CheckReadyToBegin()
|
||||
{
|
||||
if (SceneManager.GetActiveScene().name != LobbyScene) return;
|
||||
|
||||
if (minPlayers > 0 && NetworkServer.connections.Count(conn => conn.Value != null && conn.Value.playerController.gameObject.GetComponent<NetworkLobbyPlayer>().ReadyToBegin) < minPlayers)
|
||||
{
|
||||
allPlayersReady = false;
|
||||
return;
|
||||
}
|
||||
|
||||
pendingPlayers.Clear();
|
||||
allPlayersReady = true;
|
||||
OnLobbyServerPlayersReady();
|
||||
}
|
||||
|
||||
public void ServerReturnToLobby()
|
||||
{
|
||||
if (!NetworkServer.active)
|
||||
{
|
||||
Debug.Log("ServerReturnToLobby called on client");
|
||||
return;
|
||||
}
|
||||
ServerChangeScene(LobbyScene);
|
||||
}
|
||||
|
||||
void CallOnClientEnterLobby()
|
||||
{
|
||||
OnLobbyClientEnter();
|
||||
foreach (NetworkLobbyPlayer player in lobbySlots)
|
||||
player?.OnClientEnterLobby();
|
||||
}
|
||||
|
||||
void CallOnClientExitLobby()
|
||||
{
|
||||
OnLobbyClientExit();
|
||||
foreach (NetworkLobbyPlayer player in lobbySlots)
|
||||
player?.OnClientExitLobby();
|
||||
}
|
||||
|
||||
#region server handlers
|
||||
|
||||
public override void OnServerConnect(NetworkConnection conn)
|
||||
{
|
||||
if (numPlayers >= maxConnections)
|
||||
{
|
||||
conn.Disconnect();
|
||||
return;
|
||||
}
|
||||
|
||||
// cannot join game in progress
|
||||
if (SceneManager.GetActiveScene().name != LobbyScene)
|
||||
{
|
||||
conn.Disconnect();
|
||||
return;
|
||||
}
|
||||
|
||||
base.OnServerConnect(conn);
|
||||
OnLobbyServerConnect(conn);
|
||||
}
|
||||
|
||||
public override void OnServerDisconnect(NetworkConnection conn)
|
||||
{
|
||||
if (conn.playerController != null)
|
||||
{
|
||||
NetworkLobbyPlayer player = conn.playerController.GetComponent<NetworkLobbyPlayer>();
|
||||
|
||||
if (player != null)
|
||||
lobbySlots.Remove(player);
|
||||
}
|
||||
|
||||
allPlayersReady = false;
|
||||
|
||||
foreach (NetworkLobbyPlayer player in lobbySlots)
|
||||
{
|
||||
if (player != null)
|
||||
player.GetComponent<NetworkLobbyPlayer>().ReadyToBegin = false;
|
||||
}
|
||||
|
||||
if (SceneManager.GetActiveScene().name == LobbyScene)
|
||||
RecalculateLobbyPlayerIndices();
|
||||
|
||||
base.OnServerDisconnect(conn);
|
||||
OnLobbyServerDisconnect(conn);
|
||||
}
|
||||
|
||||
public override void OnServerAddPlayer(NetworkConnection conn)
|
||||
{
|
||||
if (SceneManager.GetActiveScene().name != LobbyScene) return;
|
||||
|
||||
if (lobbySlots.Count == maxConnections) return;
|
||||
|
||||
allPlayersReady = false;
|
||||
|
||||
if (LogFilter.Debug) Debug.LogFormat("NetworkLobbyManager:OnServerAddPlayer playerPrefab:{0}", lobbyPlayerPrefab.name);
|
||||
|
||||
GameObject newLobbyGameObject = OnLobbyServerCreateLobbyPlayer(conn);
|
||||
if (newLobbyGameObject == null)
|
||||
newLobbyGameObject = (GameObject)Instantiate(lobbyPlayerPrefab.gameObject, Vector3.zero, Quaternion.identity);
|
||||
|
||||
NetworkLobbyPlayer newLobbyPlayer = newLobbyGameObject.GetComponent<NetworkLobbyPlayer>();
|
||||
|
||||
lobbySlots.Add(newLobbyPlayer);
|
||||
|
||||
RecalculateLobbyPlayerIndices();
|
||||
|
||||
NetworkServer.AddPlayerForConnection(conn, newLobbyGameObject);
|
||||
}
|
||||
|
||||
void RecalculateLobbyPlayerIndices()
|
||||
{
|
||||
if (lobbySlots.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < lobbySlots.Count; i++)
|
||||
{
|
||||
lobbySlots[i].Index = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void ServerChangeScene(string sceneName)
|
||||
{
|
||||
if (sceneName == LobbyScene)
|
||||
{
|
||||
foreach (NetworkLobbyPlayer lobbyPlayer in lobbySlots)
|
||||
{
|
||||
if (lobbyPlayer == null) continue;
|
||||
|
||||
// find the game-player object for this connection, and destroy it
|
||||
NetworkIdentity identity = lobbyPlayer.GetComponent<NetworkIdentity>();
|
||||
|
||||
NetworkIdentity playerController = identity.connectionToClient.playerController;
|
||||
NetworkServer.Destroy(playerController.gameObject);
|
||||
|
||||
if (NetworkServer.active)
|
||||
{
|
||||
// re-add the lobby object
|
||||
lobbyPlayer.GetComponent<NetworkLobbyPlayer>().ReadyToBegin = false;
|
||||
NetworkServer.ReplacePlayerForConnection(identity.connectionToClient, lobbyPlayer.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dontDestroyOnLoad)
|
||||
{
|
||||
foreach (NetworkLobbyPlayer lobbyPlayer in lobbySlots)
|
||||
{
|
||||
if (lobbyPlayer != null)
|
||||
{
|
||||
lobbyPlayer.transform.SetParent(null);
|
||||
DontDestroyOnLoad(lobbyPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
base.ServerChangeScene(sceneName);
|
||||
}
|
||||
|
||||
public override void OnServerSceneChanged(string sceneName)
|
||||
{
|
||||
if (sceneName != LobbyScene)
|
||||
{
|
||||
// call SceneLoadedForPlayer on any players that become ready while we were loading the scene.
|
||||
foreach (PendingPlayer pending in pendingPlayers)
|
||||
{
|
||||
SceneLoadedForPlayer(pending.conn, pending.lobbyPlayer);
|
||||
}
|
||||
|
||||
pendingPlayers.Clear();
|
||||
}
|
||||
|
||||
OnLobbyServerSceneChanged(sceneName);
|
||||
}
|
||||
|
||||
void OnServerReturnToLobbyMessage(NetworkMessage netMsg)
|
||||
{
|
||||
if (LogFilter.Debug) Debug.Log("NetworkLobbyManager OnServerReturnToLobbyMessage");
|
||||
|
||||
ServerReturnToLobby();
|
||||
}
|
||||
|
||||
public override void OnStartServer()
|
||||
{
|
||||
if (string.IsNullOrEmpty(LobbyScene))
|
||||
{
|
||||
Debug.LogError("NetworkLobbyManager LobbyScene is empty. Set the LobbyScene in the inspector for the NetworkLobbyMangaer");
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(GameplayScene))
|
||||
{
|
||||
Debug.LogError("NetworkLobbyManager PlayScene is empty. Set the PlayScene in the inspector for the NetworkLobbyMangaer");
|
||||
return;
|
||||
}
|
||||
|
||||
OnLobbyStartServer();
|
||||
}
|
||||
|
||||
public override void OnStartHost()
|
||||
{
|
||||
OnLobbyStartHost();
|
||||
}
|
||||
|
||||
public override void OnStopServer()
|
||||
{
|
||||
lobbySlots.Clear();
|
||||
base.OnStopServer();
|
||||
}
|
||||
|
||||
public override void OnStopHost()
|
||||
{
|
||||
OnLobbyStopHost();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region client handlers
|
||||
|
||||
public override void OnStartClient(NetworkClient lobbyClient)
|
||||
{
|
||||
if (lobbyPlayerPrefab == null || lobbyPlayerPrefab.gameObject == null)
|
||||
Debug.LogError("NetworkLobbyManager no LobbyPlayer prefab is registered. Please add a LobbyPlayer prefab.");
|
||||
else
|
||||
ClientScene.RegisterPrefab(lobbyPlayerPrefab.gameObject);
|
||||
|
||||
if (playerPrefab == null)
|
||||
Debug.LogError("NetworkLobbyManager no GamePlayer prefab is registered. Please add a GamePlayer prefab.");
|
||||
else
|
||||
ClientScene.RegisterPrefab(playerPrefab);
|
||||
|
||||
OnLobbyStartClient(lobbyClient);
|
||||
}
|
||||
|
||||
public override void OnClientConnect(NetworkConnection conn)
|
||||
{
|
||||
OnLobbyClientConnect(conn);
|
||||
CallOnClientEnterLobby();
|
||||
base.OnClientConnect(conn);
|
||||
}
|
||||
|
||||
public override void OnClientDisconnect(NetworkConnection conn)
|
||||
{
|
||||
OnLobbyClientDisconnect(conn);
|
||||
base.OnClientDisconnect(conn);
|
||||
}
|
||||
|
||||
public override void OnStopClient()
|
||||
{
|
||||
OnLobbyStopClient();
|
||||
CallOnClientExitLobby();
|
||||
|
||||
if (!string.IsNullOrEmpty(offlineScene))
|
||||
{
|
||||
// Move the LobbyManager from the virtual DontDestroyOnLoad scene to the Game scene.
|
||||
// This let's it be destroyed when client changes to the Offline scene.
|
||||
SceneManager.MoveGameObjectToScene(gameObject, SceneManager.GetActiveScene());
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnClientChangeScene(string newSceneName)
|
||||
{
|
||||
if (LogFilter.Debug) Debug.LogFormat("OnClientChangeScene from {0} to {1}", SceneManager.GetActiveScene().name, newSceneName);
|
||||
|
||||
if (SceneManager.GetActiveScene().name == LobbyScene && newSceneName == GameplayScene && dontDestroyOnLoad && IsClientConnected() && client != null)
|
||||
{
|
||||
GameObject lobbyPlayer = client?.connection?.playerController?.gameObject;
|
||||
if (lobbyPlayer != null)
|
||||
{
|
||||
lobbyPlayer.transform.SetParent(null);
|
||||
DontDestroyOnLoad(lobbyPlayer);
|
||||
}
|
||||
else
|
||||
Debug.LogWarningFormat("OnClientChangeScene: lobbyPlayer is null");
|
||||
}
|
||||
else
|
||||
if (LogFilter.Debug) Debug.LogFormat("OnClientChangeScene {0} {1} {2}", dontDestroyOnLoad, IsClientConnected(), client != null);
|
||||
}
|
||||
|
||||
public override void OnClientSceneChanged(NetworkConnection conn)
|
||||
{
|
||||
if (SceneManager.GetActiveScene().name == LobbyScene)
|
||||
{
|
||||
if (client.isConnected)
|
||||
CallOnClientEnterLobby();
|
||||
}
|
||||
else
|
||||
CallOnClientExitLobby();
|
||||
|
||||
base.OnClientSceneChanged(conn);
|
||||
OnLobbyClientSceneChanged(conn);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region lobby server virtuals
|
||||
|
||||
public virtual void OnLobbyStartHost() { }
|
||||
|
||||
public virtual void OnLobbyStopHost() { }
|
||||
|
||||
public virtual void OnLobbyStartServer() { }
|
||||
|
||||
public virtual void OnLobbyServerConnect(NetworkConnection conn) { }
|
||||
|
||||
public virtual void OnLobbyServerDisconnect(NetworkConnection conn) { }
|
||||
|
||||
public virtual void OnLobbyServerSceneChanged(string sceneName) { }
|
||||
|
||||
public virtual GameObject OnLobbyServerCreateLobbyPlayer(NetworkConnection conn)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public virtual GameObject OnLobbyServerCreateGamePlayer(NetworkConnection conn)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// for users to apply settings from their lobby player object to their in-game player object
|
||||
public virtual bool OnLobbyServerSceneLoadedForPlayer(GameObject lobbyPlayer, GameObject gamePlayer)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual void OnLobbyServerPlayersReady()
|
||||
{
|
||||
// all players are readyToBegin, start the game
|
||||
ServerChangeScene(GameplayScene);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region lobby client virtuals
|
||||
|
||||
public virtual void OnLobbyClientEnter() { }
|
||||
|
||||
public virtual void OnLobbyClientExit() { }
|
||||
|
||||
public virtual void OnLobbyClientConnect(NetworkConnection conn) { }
|
||||
|
||||
public virtual void OnLobbyClientDisconnect(NetworkConnection conn) { }
|
||||
|
||||
public virtual void OnLobbyStartClient(NetworkClient lobbyClient) { }
|
||||
|
||||
public virtual void OnLobbyStopClient() { }
|
||||
|
||||
public virtual void OnLobbyClientSceneChanged(NetworkConnection conn) { }
|
||||
|
||||
// for users to handle adding a player failed on the server
|
||||
public virtual void OnLobbyClientAddPlayerFailed() { }
|
||||
|
||||
#endregion
|
||||
|
||||
#region optional UI
|
||||
|
||||
public virtual void OnGUI()
|
||||
{
|
||||
if (!showLobbyGUI)
|
||||
return;
|
||||
|
||||
if (SceneManager.GetActiveScene().name != LobbyScene)
|
||||
return;
|
||||
|
||||
GUI.Box(new Rect(10f, 180f, 520f, 150f), "PLAYERS");
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
11
Assets/Mirror/Components/NetworkLobbyManager.cs.meta
Normal file
11
Assets/Mirror/Components/NetworkLobbyManager.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 615e6c6589cf9e54cad646b5a11e0529
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
133
Assets/Mirror/Components/NetworkLobbyPlayer.cs
Normal file
133
Assets/Mirror/Components/NetworkLobbyPlayer.cs
Normal file
@ -0,0 +1,133 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace Mirror
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
[AddComponentMenu("Network/NetworkLobbyPlayer")]
|
||||
[HelpURL("https://vis2k.github.io/Mirror/Components/NetworkLobbyPlayer")]
|
||||
public class NetworkLobbyPlayer : NetworkBehaviour
|
||||
{
|
||||
public bool ShowLobbyGUI = true;
|
||||
|
||||
[SyncVar]
|
||||
public bool ReadyToBegin = false;
|
||||
|
||||
[SyncVar]
|
||||
public int Index;
|
||||
|
||||
/// <summary>
|
||||
/// Do not use Start - Override OnStartrHost / OnStartClient instead!
|
||||
/// </summary>
|
||||
public void Start()
|
||||
{
|
||||
if (isClient) SceneManager.sceneLoaded += ClientLoadedScene;
|
||||
|
||||
if (NetworkManager.singleton as NetworkLobbyManager)
|
||||
{
|
||||
ReadyToBegin = false;
|
||||
OnClientEnterLobby();
|
||||
}
|
||||
else
|
||||
Debug.LogError("LobbyPlayer could not find a NetworkLobbyManager. The LobbyPlayer requires a NetworkLobbyManager object to function. Make sure that there is one in the scene.");
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
SceneManager.sceneLoaded -= ClientLoadedScene;
|
||||
}
|
||||
|
||||
void ClientLoadedScene(Scene arg0, LoadSceneMode arg1)
|
||||
{
|
||||
NetworkLobbyManager lobby = NetworkManager.singleton as NetworkLobbyManager;
|
||||
if (lobby && SceneManager.GetActiveScene().name == lobby.LobbyScene)
|
||||
return;
|
||||
|
||||
if (this != null && isLocalPlayer)
|
||||
CmdSendLevelLoaded();
|
||||
}
|
||||
|
||||
[Command]
|
||||
public void CmdChangeReadyState(bool ReadyState)
|
||||
{
|
||||
ReadyToBegin = ReadyState;
|
||||
NetworkLobbyManager lobby = NetworkManager.singleton as NetworkLobbyManager;
|
||||
lobby?.ReadyStatusChanged();
|
||||
}
|
||||
|
||||
[Command]
|
||||
public void CmdSendLevelLoaded()
|
||||
{
|
||||
NetworkLobbyManager lobby = NetworkManager.singleton as NetworkLobbyManager;
|
||||
lobby?.PlayerLoadedScene(GetComponent<NetworkIdentity>().connectionToClient);
|
||||
}
|
||||
|
||||
#region lobby client virtuals
|
||||
|
||||
public virtual void OnClientEnterLobby() { }
|
||||
|
||||
public virtual void OnClientExitLobby() { }
|
||||
|
||||
public virtual void OnClientReady(bool readyState) { }
|
||||
|
||||
#endregion
|
||||
|
||||
#region optional UI
|
||||
|
||||
public virtual void OnGUI()
|
||||
{
|
||||
if (!ShowLobbyGUI)
|
||||
return;
|
||||
|
||||
NetworkLobbyManager lobby = NetworkManager.singleton as NetworkLobbyManager;
|
||||
if (lobby)
|
||||
{
|
||||
if (!lobby.showLobbyGUI)
|
||||
return;
|
||||
|
||||
if (SceneManager.GetActiveScene().name != lobby.LobbyScene)
|
||||
return;
|
||||
|
||||
GUILayout.BeginArea(new Rect(20f + (Index * 100), 200f, 90f, 130f));
|
||||
|
||||
GUILayout.Label(String.Format("Player [{0}]", Index + 1));
|
||||
|
||||
if (ReadyToBegin)
|
||||
GUILayout.Label("Ready");
|
||||
else
|
||||
GUILayout.Label("Not Ready");
|
||||
|
||||
if (isServer && Index > 0 && GUILayout.Button("REMOVE"))
|
||||
{
|
||||
// This button only shows on the Host for all players other than the Host
|
||||
// Host and Players can't remove themselves (stop the client instead)
|
||||
// Host can kick a Player this way.
|
||||
GetComponent<NetworkIdentity>().connectionToClient.Disconnect();
|
||||
}
|
||||
|
||||
GUILayout.EndArea();
|
||||
|
||||
if (NetworkClient.active && isLocalPlayer)
|
||||
{
|
||||
GUILayout.BeginArea(new Rect(20f, 300f, 120f, 20f));
|
||||
|
||||
if (ReadyToBegin)
|
||||
{
|
||||
if (GUILayout.Button("Cancel"))
|
||||
CmdChangeReadyState(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GUILayout.Button("Ready"))
|
||||
CmdChangeReadyState(true);
|
||||
}
|
||||
|
||||
GUILayout.EndArea();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
11
Assets/Mirror/Components/NetworkLobbyPlayer.cs.meta
Normal file
11
Assets/Mirror/Components/NetworkLobbyPlayer.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 79874ac94d5b1314788ecf0e86bd23fd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Mirror/Examples/Lobby.meta
Normal file
8
Assets/Mirror/Examples/Lobby.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ba0822b68f209a743bc575c6f2cc78f0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Mirror/Examples/Lobby/Materials.meta
Normal file
8
Assets/Mirror/Examples/Lobby/Materials.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 177a490b498134246b6eeddfeb608b94
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
76
Assets/Mirror/Examples/Lobby/Materials/PlayArea.mat
Normal file
76
Assets/Mirror/Examples/Lobby/Materials/PlayArea.mat
Normal file
@ -0,0 +1,76 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: PlayArea
|
||||
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ShaderKeywords: _GLOSSYREFLECTIONS_OFF _NORMALMAP _SPECULARHIGHLIGHTS_OFF
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 2800000, guid: 1ef4aad253cf7e9488305da905643f09, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 8, y: 8}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 2800000, guid: 0ce4715b95ec59e4ca799c740a5e144a, type: 3}
|
||||
m_Scale: {x: 8, y: 8}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 0
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 0
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 0.8867924, g: 0.84346247, b: 0.7654859, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
8
Assets/Mirror/Examples/Lobby/Materials/PlayArea.mat.meta
Normal file
8
Assets/Mirror/Examples/Lobby/Materials/PlayArea.mat.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3201636fa507dad448e9a36d66a80825
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
76
Assets/Mirror/Examples/Lobby/Materials/Player.mat
Normal file
76
Assets/Mirror/Examples/Lobby/Materials/Player.mat
Normal file
@ -0,0 +1,76 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: Player
|
||||
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ShaderKeywords:
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
8
Assets/Mirror/Examples/Lobby/Materials/Player.mat.meta
Normal file
8
Assets/Mirror/Examples/Lobby/Materials/Player.mat.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ac64a68d9ea8fa9459ff2f158065c1d0
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
76
Assets/Mirror/Examples/Lobby/Materials/Prize.mat
Normal file
76
Assets/Mirror/Examples/Lobby/Materials/Prize.mat
Normal file
@ -0,0 +1,76 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: Prize
|
||||
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ShaderKeywords:
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
8
Assets/Mirror/Examples/Lobby/Materials/Prize.mat.meta
Normal file
8
Assets/Mirror/Examples/Lobby/Materials/Prize.mat.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a1d7c9f39b41d414d86e64f7761cd545
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Mirror/Examples/Lobby/Materials/Textures.meta
Normal file
8
Assets/Mirror/Examples/Lobby/Materials/Textures.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 047a5014adf04914f9ffded62a715e39
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
Assets/Mirror/Examples/Lobby/Materials/Textures/Wall01.tga
Normal file
BIN
Assets/Mirror/Examples/Lobby/Materials/Textures/Wall01.tga
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.0 MiB |
@ -0,0 +1,88 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0ce4715b95ec59e4ca799c740a5e144a
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 7
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: -1
|
||||
wrapV: -1
|
||||
wrapW: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 2
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 1024
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
Assets/Mirror/Examples/Lobby/Materials/Textures/Wall01_n.tga
Normal file
BIN
Assets/Mirror/Examples/Lobby/Materials/Textures/Wall01_n.tga
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.0 MiB |
@ -0,0 +1,88 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1ef4aad253cf7e9488305da905643f09
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 7
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 1
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: -1
|
||||
wrapV: -1
|
||||
wrapW: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 1
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 2
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 1024
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Mirror/Examples/Lobby/Prefabs.meta
Normal file
8
Assets/Mirror/Examples/Lobby/Prefabs.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9a6e603a7f407ec4aa25ac2c2799f71b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
315
Assets/Mirror/Examples/Lobby/Prefabs/GamePlayer.prefab
Normal file
315
Assets/Mirror/Examples/Lobby/Prefabs/GamePlayer.prefab
Normal file
@ -0,0 +1,315 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &1039876987469204
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4760887181472906}
|
||||
- component: {fileID: 20857680893542546}
|
||||
- component: {fileID: 81220922231835188}
|
||||
m_Layer: 0
|
||||
m_Name: Camera
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4760887181472906
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1039876987469204}
|
||||
m_LocalRotation: {x: 0.08715578, y: 0, z: 0, w: 0.9961947}
|
||||
m_LocalPosition: {x: 0, y: 3, z: -8}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 4822224316094678}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 10, y: 0, z: 0}
|
||||
--- !u!20 &20857680893542546
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1039876987469204}
|
||||
m_Enabled: 0
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_GateFitMode: 2
|
||||
m_FocalLength: 50
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 5
|
||||
m_Depth: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!81 &81220922231835188
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1039876987469204}
|
||||
m_Enabled: 1
|
||||
--- !u!1 &1430875437483682
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4216737524944602}
|
||||
- component: {fileID: 33190644788701022}
|
||||
- component: {fileID: 23708975923909982}
|
||||
m_Layer: 0
|
||||
m_Name: Cube
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4216737524944602
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1430875437483682}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0.4, z: 0.505}
|
||||
m_LocalScale: {x: 0.5, y: 0.1, z: 0.2}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 4822224316094678}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &33190644788701022
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1430875437483682}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &23708975923909982
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1430875437483682}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RenderingLayerMask: 4294967295
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 0
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!1 &1480027675339556
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4822224316094678}
|
||||
- component: {fileID: 33762848230157288}
|
||||
- component: {fileID: 23313067197120050}
|
||||
- component: {fileID: 143011667059871024}
|
||||
- component: {fileID: 114892629901890886}
|
||||
- component: {fileID: 114402732107420660}
|
||||
- component: {fileID: 114265392388239132}
|
||||
m_Layer: 0
|
||||
m_Name: GamePlayer
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4822224316094678
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1480027675339556}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 4216737524944602}
|
||||
- {fileID: 4760887181472906}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &33762848230157288
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1480027675339556}
|
||||
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &23313067197120050
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1480027675339556}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RenderingLayerMask: 4294967295
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: ac64a68d9ea8fa9459ff2f158065c1d0, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 0
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!143 &143011667059871024
|
||||
CharacterController:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1480027675339556}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Height: 2
|
||||
m_Radius: 0.5
|
||||
m_SlopeLimit: 45
|
||||
m_StepOffset: 0.3
|
||||
m_SkinWidth: 0.08
|
||||
m_MinMoveDistance: 0.001
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &114892629901890886
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1480027675339556}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 24fd13686a451ad498101a604d134e39, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
syncInterval: 0
|
||||
Index: 0
|
||||
score: 0
|
||||
playerColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
moveSpeed: 300
|
||||
horiz: 0
|
||||
vert: 0
|
||||
turn: 0
|
||||
turnSpeedAccel: 30
|
||||
turnSpeedDecel: 30
|
||||
maxTurnSpeed: 100
|
||||
--- !u!114 &114402732107420660
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1480027675339556}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 9b91ecbcc199f4492b9a91e820070131, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_SceneId: 0
|
||||
m_ServerOnly: 0
|
||||
m_LocalPlayerAuthority: 1
|
||||
m_AssetId: 21daf89214c6ee443ad6875b73083c60
|
||||
--- !u!114 &114265392388239132
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1480027675339556}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 2f74aedd71d9a4f55b3ce499326d45fb, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
syncInterval: 0.1
|
||||
compressRotation: 1
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 21daf89214c6ee443ad6875b73083c60
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 100100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
73
Assets/Mirror/Examples/Lobby/Prefabs/LobbyPlayer.prefab
Normal file
73
Assets/Mirror/Examples/Lobby/Prefabs/LobbyPlayer.prefab
Normal file
@ -0,0 +1,73 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1001 &100100000
|
||||
Prefab:
|
||||
m_ObjectHideFlags: 1
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications: []
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 0}
|
||||
m_RootGameObject: {fileID: 1588750985201798}
|
||||
m_IsPrefabAsset: 1
|
||||
--- !u!1 &1588750985201798
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4817109203880908}
|
||||
- component: {fileID: 114387717104821018}
|
||||
- component: {fileID: 114033720796874720}
|
||||
m_Layer: 0
|
||||
m_Name: LobbyPlayer
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4817109203880908
|
||||
Transform:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1588750985201798}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &114033720796874720
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1588750985201798}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 41fc608223969754e817c29908fdb1d3, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
syncInterval: 0.1
|
||||
ShowLobbyGUI: 1
|
||||
ReadyToBegin: 0
|
||||
Index: 0
|
||||
--- !u!114 &114387717104821018
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1588750985201798}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 9b91ecbcc199f4492b9a91e820070131, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_SceneId: 0
|
||||
m_ServerOnly: 0
|
||||
m_LocalPlayerAuthority: 0
|
||||
m_AssetId: deae2134a1d77704b9c595efe69767dd
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: deae2134a1d77704b9c595efe69767dd
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 100100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
130
Assets/Mirror/Examples/Lobby/Prefabs/Prize.prefab
Normal file
130
Assets/Mirror/Examples/Lobby/Prefabs/Prize.prefab
Normal file
@ -0,0 +1,130 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1001 &100100000
|
||||
Prefab:
|
||||
m_ObjectHideFlags: 1
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications: []
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 0}
|
||||
m_RootGameObject: {fileID: 1139254171913846}
|
||||
m_IsPrefabAsset: 1
|
||||
--- !u!1 &1139254171913846
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4362442735993418}
|
||||
- component: {fileID: 33086497388294428}
|
||||
- component: {fileID: 23203154358629070}
|
||||
- component: {fileID: 135606878775227198}
|
||||
- component: {fileID: 114048121767222990}
|
||||
- component: {fileID: 114251241889735402}
|
||||
m_Layer: 0
|
||||
m_Name: Prize
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 4294967295
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4362442735993418
|
||||
Transform:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1139254171913846}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: 0}
|
||||
m_LocalScale: {x: 0.3, y: 0.3, z: 0.3}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!23 &23203154358629070
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1139254171913846}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RenderingLayerMask: 4294967295
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: a1d7c9f39b41d414d86e64f7761cd545, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 0
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!33 &33086497388294428
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1139254171913846}
|
||||
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!114 &114048121767222990
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1139254171913846}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a22f9eb8ebad79e47babf4c051a714ee, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
syncInterval: 0.1
|
||||
prizeColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
available: 1
|
||||
spawner: {fileID: 0}
|
||||
--- !u!114 &114251241889735402
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1139254171913846}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 9b91ecbcc199f4492b9a91e820070131, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_SceneId: 0
|
||||
m_ServerOnly: 0
|
||||
m_LocalPlayerAuthority: 0
|
||||
m_AssetId: 52f1c9ea06cfd154cb68ff9d1b66fc13
|
||||
--- !u!135 &135606878775227198
|
||||
SphereCollider:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1139254171913846}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Radius: 0.5
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
8
Assets/Mirror/Examples/Lobby/Prefabs/Prize.prefab.meta
Normal file
8
Assets/Mirror/Examples/Lobby/Prefabs/Prize.prefab.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 52f1c9ea06cfd154cb68ff9d1b66fc13
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 100100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
31
Assets/Mirror/Examples/Lobby/README.md
Normal file
31
Assets/Mirror/Examples/Lobby/README.md
Normal file
@ -0,0 +1,31 @@
|
||||
# Lobby Example
|
||||
|
||||
In Buld Settings, remove all scenes and add all of the scenes from the Examples\Lobbey\Scenes folder in the following order:
|
||||
|
||||
- Offline
|
||||
- Lobby
|
||||
- Online
|
||||
|
||||
If you opened the Lobby scene before doing the above steps, you may have to reassign the scenes to the NetworkLobbyManagerExt component of the LobbyManager scene object.
|
||||
|
||||
** Do not assign anything to the Online scene field!** If you do, the lobby will be bypassed. Assign **only* the Offline and Lobby and Gameplay scene fields in the inspector.
|
||||
|
||||
File -> Build and Run
|
||||
|
||||
Start up to 4 built instances: These will all be client players.
|
||||
|
||||
Open the Offline scene in the Editor and press Play
|
||||
|
||||
Click the Join Game and LAN Host in the editor: This will be host and the 5th player. You can also use LAN Server if you prefer.
|
||||
|
||||
Click Join Game and LAN Client in the built instances.
|
||||
|
||||
Click Ready in each instance, and finally in the Editor (Host).
|
||||
|
||||
Click the Start Game button when all players are ready.
|
||||
|
||||
You should now be in the Online scene with your players of random color.
|
||||
|
||||
WASDQE keys to move & turn your player capsule.
|
||||
Collide with the spheres to score points.
|
||||
Lighter colors score higher.
|
7
Assets/Mirror/Examples/Lobby/README.md.meta
Normal file
7
Assets/Mirror/Examples/Lobby/README.md.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9110f04bd1e8468479f6625342d311c5
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Mirror/Examples/Lobby/Scenes.meta
Normal file
8
Assets/Mirror/Examples/Lobby/Scenes.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f704ae4b4f98ae41a0bce26658850c1
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
361
Assets/Mirror/Examples/Lobby/Scenes/LobbyScene.unity
Normal file
361
Assets/Mirror/Examples/Lobby/Scenes/LobbyScene.unity
Normal file
@ -0,0 +1,361 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 9
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 0
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 11
|
||||
m_GIWorkflowMode: 0
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 1
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 10
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_AtlasSize: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 256
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 2
|
||||
m_BakeBackend: 1
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 500
|
||||
m_PVRBounces: 2
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ShowResolutionOverlay: 1
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_UseShadowmask: 1
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &639890310
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 639890313}
|
||||
- component: {fileID: 639890312}
|
||||
- component: {fileID: 639890311}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &639890311
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 639890310}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &639890312
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 639890310}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.23429157, g: 0.254717, b: 0.23546094, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_GateFitMode: 2
|
||||
m_FocalLength: 50
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: 3
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 0
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &639890313
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 639890310}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &985189858
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 985189859}
|
||||
m_Layer: 0
|
||||
m_Name: Players
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &985189859
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 985189858}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -1.7365334, y: 0.84765625, z: 1.4726781}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &2008127829
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2008127832}
|
||||
- component: {fileID: 2008127833}
|
||||
- component: {fileID: 2008127831}
|
||||
- component: {fileID: 2008127830}
|
||||
m_Layer: 0
|
||||
m_Name: LobbyManager
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &2008127830
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2008127829}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: c7424c1070fad4ba2a7a96b02fbeb4bb, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
OnClientConnected:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0,
|
||||
Culture=neutral, PublicKeyToken=null
|
||||
OnClientDataReceived:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: Mirror.UnityEventByteArray, Mirror, Version=0.0.0.0, Culture=neutral,
|
||||
PublicKeyToken=null
|
||||
OnClientError:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: Mirror.UnityEventException, Mirror, Version=0.0.0.0, Culture=neutral,
|
||||
PublicKeyToken=null
|
||||
OnClientDisconnected:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0,
|
||||
Culture=neutral, PublicKeyToken=null
|
||||
OnServerConnected:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: Mirror.UnityEventInt, Mirror, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
OnServerDataReceived:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: Mirror.UnityEventIntByteArray, Mirror, Version=0.0.0.0, Culture=neutral,
|
||||
PublicKeyToken=null
|
||||
OnServerError:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: Mirror.UnityEventIntException, Mirror, Version=0.0.0.0, Culture=neutral,
|
||||
PublicKeyToken=null
|
||||
OnServerDisconnected:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: Mirror.UnityEventInt, Mirror, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
port: 7780
|
||||
NoDelay: 1
|
||||
--- !u!114 &2008127831
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2008127829}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e7d8650c751710349bb9546d1697b9cb, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
dontDestroyOnLoad: 1
|
||||
runInBackground: 1
|
||||
startOnHeadless: 1
|
||||
serverTickRate: 30
|
||||
showDebugMessages: 0
|
||||
offlineScene: OfflineScene
|
||||
onlineScene:
|
||||
transport: {fileID: 2008127830}
|
||||
networkAddress: localhost
|
||||
maxConnections: 5
|
||||
playerPrefab: {fileID: 1480027675339556, guid: 21daf89214c6ee443ad6875b73083c60,
|
||||
type: 3}
|
||||
autoCreatePlayer: 1
|
||||
playerSpawnMethod: 0
|
||||
spawnPrefabs:
|
||||
- {fileID: 1139254171913846, guid: 52f1c9ea06cfd154cb68ff9d1b66fc13, type: 3}
|
||||
showLobbyGUI: 1
|
||||
minPlayers: 1
|
||||
lobbyPlayerPrefab: {fileID: 114033720796874720, guid: deae2134a1d77704b9c595efe69767dd,
|
||||
type: 3}
|
||||
LobbyScene: LobbyScene
|
||||
GameplayScene: OnlineScene
|
||||
allPlayersReady: 0
|
||||
--- !u!4 &2008127832
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2008127829}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &2008127833
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2008127829}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 6442dc8070ceb41f094e44de0bf87274, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
showGUI: 1
|
||||
offsetX: 0
|
||||
offsetY: 0
|
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 48478f4d522f96945b8396f376299d3a
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
210
Assets/Mirror/Examples/Lobby/Scenes/OfflineScene.unity
Normal file
210
Assets/Mirror/Examples/Lobby/Scenes/OfflineScene.unity
Normal file
@ -0,0 +1,210 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 9
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 0
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 11
|
||||
m_GIWorkflowMode: 1
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 1
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 10
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_AtlasSize: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 256
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 2
|
||||
m_BakeBackend: 1
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 500
|
||||
m_PVRBounces: 2
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ShowResolutionOverlay: 1
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_UseShadowmask: 1
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &639890310
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 639890313}
|
||||
- component: {fileID: 639890312}
|
||||
- component: {fileID: 639890311}
|
||||
- component: {fileID: 639890314}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &639890311
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 639890310}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &639890312
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 639890310}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.23429157, g: 0.254717, b: 0.23546094, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_GateFitMode: 2
|
||||
m_FocalLength: 50
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &639890313
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 639890310}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &639890314
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 639890310}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 039bde4e5e3b63e46be9b967d06e5469, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
LobbyScene: LobbyScene
|
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9e6f14982412b2545a0911ebaaa46a23
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Mirror/Examples/Lobby/Scenes/Online.meta
Normal file
8
Assets/Mirror/Examples/Lobby/Scenes/Online.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f95b8a8cb007dd64980ee3c5d4258f95
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
Assets/Mirror/Examples/Lobby/Scenes/Online/LightingData.asset
Normal file
BIN
Assets/Mirror/Examples/Lobby/Scenes/Online/LightingData.asset
Normal file
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 83612f89e0d5b404fbd99891bda78df4
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 25800000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
Assets/Mirror/Examples/Lobby/Scenes/Online/ReflectionProbe-0.exr
Normal file
BIN
Assets/Mirror/Examples/Lobby/Scenes/Online/ReflectionProbe-0.exr
Normal file
Binary file not shown.
@ -0,0 +1,89 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ba6c3cbc7dcdf184a99a7d73e8762759
|
||||
TextureImporter:
|
||||
fileIDToRecycleName:
|
||||
8900000: generatedCubemap
|
||||
externalObjects: {}
|
||||
serializedVersion: 7
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 1
|
||||
seamlessCubemap: 1
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 2
|
||||
aniso: 0
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 2
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 2
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 100
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
813
Assets/Mirror/Examples/Lobby/Scenes/OnlineScene.unity
Normal file
813
Assets/Mirror/Examples/Lobby/Scenes/OnlineScene.unity
Normal file
@ -0,0 +1,813 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 9
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 0
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0.1802836, g: 0.22571391, b: 0.3069226, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 11
|
||||
m_GIWorkflowMode: 1
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_TemporalCoherenceThreshold: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 1
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 10
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_AtlasSize: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 256
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 2
|
||||
m_BakeBackend: 1
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 500
|
||||
m_PVRBounces: 2
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ShowResolutionOverlay: 1
|
||||
m_LightingDataAsset: {fileID: 112000002, guid: 83612f89e0d5b404fbd99891bda78df4,
|
||||
type: 2}
|
||||
m_UseShadowmask: 1
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &29930032
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 29930035}
|
||||
- component: {fileID: 29930034}
|
||||
- component: {fileID: 29930033}
|
||||
m_Layer: 0
|
||||
m_Name: Spawner
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &29930033
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 29930032}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 9b91ecbcc199f4492b9a91e820070131, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_SceneId: 0
|
||||
m_ServerOnly: 1
|
||||
m_LocalPlayerAuthority: 0
|
||||
m_AssetId:
|
||||
--- !u!114 &29930034
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 29930032}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0bf5c082d04f7ea459fcd30e60b5bd70, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
syncInterval: 0.1
|
||||
prizePrefab: {fileID: 114251241889735402, guid: 52f1c9ea06cfd154cb68ff9d1b66fc13,
|
||||
type: 2}
|
||||
--- !u!4 &29930035
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 29930032}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &151116940
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 151116942}
|
||||
- component: {fileID: 151116941}
|
||||
m_Layer: 0
|
||||
m_Name: Directional Light
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!108 &151116941
|
||||
Light:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 151116940}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 8
|
||||
m_Type: 1
|
||||
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
|
||||
m_Intensity: 1
|
||||
m_Range: 10
|
||||
m_SpotAngle: 30
|
||||
m_CookieSize: 10
|
||||
m_Shadows:
|
||||
m_Type: 2
|
||||
m_Resolution: -1
|
||||
m_CustomResolution: -1
|
||||
m_Strength: 1
|
||||
m_Bias: 0.05
|
||||
m_NormalBias: 0.4
|
||||
m_NearPlane: 0.2
|
||||
m_Cookie: {fileID: 0}
|
||||
m_DrawHalo: 0
|
||||
m_Flare: {fileID: 0}
|
||||
m_RenderMode: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_Lightmapping: 4
|
||||
m_LightShadowCasterMode: 0
|
||||
m_AreaSize: {x: 1, y: 1}
|
||||
m_BounceIntensity: 1
|
||||
m_ColorTemperature: 6570
|
||||
m_UseColorTemperature: 0
|
||||
m_ShadowRadius: 0
|
||||
m_ShadowAngle: 0
|
||||
--- !u!4 &151116942
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 151116940}
|
||||
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
|
||||
m_LocalPosition: {x: 0, y: 10, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
|
||||
--- !u!1 &204334129
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 204334130}
|
||||
- component: {fileID: 204334131}
|
||||
m_Layer: 0
|
||||
m_Name: PlayerStart
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &204334130
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 204334129}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -15}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1445635740}
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &204334131
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 204334129}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 41f84591ce72545258ea98cb7518d8b9, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &263230754
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 263230755}
|
||||
- component: {fileID: 263230756}
|
||||
m_Layer: 0
|
||||
m_Name: PlayerStart
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &263230755
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 263230754}
|
||||
m_LocalRotation: {x: 0, y: 0.38268343, z: 0, w: 0.92387956}
|
||||
m_LocalPosition: {x: -15, y: 0, z: -15}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1445635740}
|
||||
m_RootOrder: 5
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 45, z: 0}
|
||||
--- !u!114 &263230756
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 263230754}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 41f84591ce72545258ea98cb7518d8b9, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &290557149
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 290557150}
|
||||
- component: {fileID: 290557151}
|
||||
m_Layer: 0
|
||||
m_Name: PlayerStart
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &290557150
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 290557149}
|
||||
m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068}
|
||||
m_LocalPosition: {x: -15, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1445635740}
|
||||
m_RootOrder: 6
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
|
||||
--- !u!114 &290557151
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 290557149}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 41f84591ce72545258ea98cb7518d8b9, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &733367779
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 733367780}
|
||||
- component: {fileID: 733367781}
|
||||
m_Layer: 0
|
||||
m_Name: PlayerStart
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &733367780
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 733367779}
|
||||
m_LocalRotation: {x: -0, y: 1, z: -0, w: 0}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 15}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1445635740}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
|
||||
--- !u!114 &733367781
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 733367779}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 41f84591ce72545258ea98cb7518d8b9, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &990635329
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 990635330}
|
||||
- component: {fileID: 990635331}
|
||||
m_Layer: 0
|
||||
m_Name: PlayerStart
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &990635330
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 990635329}
|
||||
m_LocalRotation: {x: 0, y: 0.92387956, z: 0, w: 0.38268343}
|
||||
m_LocalPosition: {x: -15, y: 0, z: 15}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1445635740}
|
||||
m_RootOrder: 7
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 135, z: 0}
|
||||
--- !u!114 &990635331
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 990635329}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 41f84591ce72545258ea98cb7518d8b9, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &1050066542
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1050066545}
|
||||
- component: {fileID: 1050066544}
|
||||
- component: {fileID: 1050066543}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &1050066543
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1050066542}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &1050066544
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1050066542}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.23429157, g: 0.254717, b: 0.23546094, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_FocalLength: 50
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &1050066545
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1050066542}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 2, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1305256737
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1305256745}
|
||||
- component: {fileID: 1305256744}
|
||||
- component: {fileID: 1305256742}
|
||||
- component: {fileID: 1305256743}
|
||||
- component: {fileID: 1305256741}
|
||||
- component: {fileID: 1305256740}
|
||||
- component: {fileID: 1305256739}
|
||||
- component: {fileID: 1305256738}
|
||||
m_Layer: 0
|
||||
m_Name: PlayArea
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!65 &1305256738
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1305256737}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 10, y: 2, z: 0.1}
|
||||
m_Center: {x: 0, y: 1, z: 5}
|
||||
--- !u!65 &1305256739
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1305256737}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 10, y: 2, z: 0.1}
|
||||
m_Center: {x: 0, y: 1, z: -5}
|
||||
--- !u!65 &1305256740
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1305256737}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 0.1, y: 2, z: 10}
|
||||
m_Center: {x: 5, y: 1, z: 0}
|
||||
--- !u!65 &1305256741
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1305256737}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 0.1, y: 2, z: 10}
|
||||
m_Center: {x: -5, y: 1, z: 0}
|
||||
--- !u!23 &1305256742
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1305256737}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RenderingLayerMask: 4294967295
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 3201636fa507dad448e9a36d66a80825, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_PreserveUVs: 1
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 0
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!64 &1305256743
|
||||
MeshCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1305256737}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Convex: 0
|
||||
m_CookingOptions: 14
|
||||
m_SkinWidth: 0.01
|
||||
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!33 &1305256744
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1305256737}
|
||||
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!4 &1305256745
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1305256737}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 4, y: 1, z: 4}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1445635739
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1445635740}
|
||||
m_Layer: 0
|
||||
m_Name: StartPositions
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1445635740
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1445635739}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1.08, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 733367780}
|
||||
- {fileID: 2127619492}
|
||||
- {fileID: 1975674813}
|
||||
- {fileID: 1760045337}
|
||||
- {fileID: 204334130}
|
||||
- {fileID: 263230755}
|
||||
- {fileID: 290557150}
|
||||
- {fileID: 990635330}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1760045336
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1760045337}
|
||||
- component: {fileID: 1760045338}
|
||||
m_Layer: 0
|
||||
m_Name: PlayerStart
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1760045337
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1760045336}
|
||||
m_LocalRotation: {x: 0, y: 0.3826836, z: -0, w: -0.92387944}
|
||||
m_LocalPosition: {x: 15, y: 0, z: -15}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1445635740}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 315, z: 0}
|
||||
--- !u!114 &1760045338
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1760045336}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 41f84591ce72545258ea98cb7518d8b9, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &1975674812
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1975674813}
|
||||
- component: {fileID: 1975674814}
|
||||
m_Layer: 0
|
||||
m_Name: PlayerStart
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1975674813
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1975674812}
|
||||
m_LocalRotation: {x: 0, y: 0.7071068, z: -0, w: -0.7071068}
|
||||
m_LocalPosition: {x: 15, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1445635740}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 270, z: 0}
|
||||
--- !u!114 &1975674814
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1975674812}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 41f84591ce72545258ea98cb7518d8b9, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &2127619491
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2127619492}
|
||||
- component: {fileID: 2127619493}
|
||||
m_Layer: 0
|
||||
m_Name: PlayerStart
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2127619492
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 2127619491}
|
||||
m_LocalRotation: {x: 0, y: 0.9238796, z: -0, w: -0.38268325}
|
||||
m_LocalPosition: {x: 15, y: 0, z: 15}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1445635740}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 225, z: 0}
|
||||
--- !u!114 &2127619493
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 2127619491}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 41f84591ce72545258ea98cb7518d8b9, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d7a6763559b31854586c9e49916273ef
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Mirror/Examples/Lobby/Scripts.meta
Normal file
8
Assets/Mirror/Examples/Lobby/Scripts.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 03401915dd450454e88f0a839d3346f1
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,57 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
|
||||
namespace Mirror.Examples.NetworkLobby
|
||||
{
|
||||
public class NetworkLobbyManagerExt : NetworkLobbyManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Called just after GamePlayer object is instantiated and just before it replaces LobbyPlayer object.
|
||||
/// This is the ideal point to pass any data like player name, credentials, tokens, colors, etc.
|
||||
/// into the GamePlayer object as it is about to enter the Online scene.
|
||||
/// </summary>
|
||||
/// <param name="lobbyPlayer"></param>
|
||||
/// <param name="gamePlayer"></param>
|
||||
/// <returns>true unless some code in here decides it needs to abort the replacement</returns>
|
||||
public override bool OnLobbyServerSceneLoadedForPlayer(GameObject lobbyPlayer, GameObject gamePlayer)
|
||||
{
|
||||
PlayerController player = gamePlayer.GetComponent<PlayerController>();
|
||||
player.Index = lobbyPlayer.GetComponent<NetworkLobbyPlayer>().Index;
|
||||
player.playerColor = Random.ColorHSV(0f, 1f, 1f, 1f, 0.5f, 1f);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
This code below is to demonstrate how to do a Start button that only appears for the Host player
|
||||
showStartButton is a local bool that's needed because OnLobbyServerPlayersReady is only fired when
|
||||
all players are ready, but if a player cancels their ready state there's no callback to set it back to false
|
||||
Therefore, allPlayersReady is used in combination with showStartButton to show/hide the Start button correctly.
|
||||
Setting showStartButton false when the button is pressed hides it in the game scene since NetworkLobbyManager
|
||||
is set as DontDestroyOnLoad = true.
|
||||
*/
|
||||
|
||||
bool showStartButton = false;
|
||||
|
||||
public override void OnLobbyServerPlayersReady()
|
||||
{
|
||||
// calling the base method calls ServerChangeScene as soon as all players are in Ready state.
|
||||
if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Null && startOnHeadless)
|
||||
base.OnLobbyServerPlayersReady();
|
||||
else
|
||||
showStartButton = true;
|
||||
}
|
||||
|
||||
public override void OnGUI()
|
||||
{
|
||||
base.OnGUI();
|
||||
|
||||
if (allPlayersReady && showStartButton && GUI.Button(new Rect(150, 300, 120, 20), "START GAME"))
|
||||
{
|
||||
// set to false to hide it in the game scene
|
||||
showStartButton = false;
|
||||
|
||||
ServerChangeScene(GameplayScene);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e7d8650c751710349bb9546d1697b9cb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,41 @@
|
||||
using UnityEngine;
|
||||
using Mirror;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace Mirror.Examples.NetworkLobby
|
||||
{
|
||||
public class NetworkLobbyPlayerExt : NetworkLobbyPlayer
|
||||
{
|
||||
public string Name;
|
||||
public override void OnStartClient()
|
||||
{
|
||||
if (LogFilter.Debug) Debug.LogFormat("OnStartClient {0}", SceneManager.GetActiveScene().name);
|
||||
|
||||
base.OnStartClient();
|
||||
NetworkLobbyManager lobby = NetworkManager.singleton as NetworkLobbyManager;
|
||||
|
||||
/*
|
||||
This demonstrates how to set the parent of the LobbyPlayerPrefab to an arbitrary scene object
|
||||
A similar technique would be used if a full canvas layout UI existed and we wanted to show
|
||||
something more visual for each player in that layout, such as a name, avatar, etc.
|
||||
|
||||
Note: LobbyPlayer prefab will be marked DontDestroyOnLoad and carried forward to the game scene.
|
||||
Because of this, NetworkLobbyManager must automatically set the parent to null
|
||||
in ServerChangeScene and OnClientChangeScene.
|
||||
*/
|
||||
|
||||
if (lobby && lobby.LobbyScene == SceneManager.GetActiveScene().name)
|
||||
gameObject.transform.SetParent(GameObject.Find("Players").transform);
|
||||
}
|
||||
|
||||
public override void OnClientEnterLobby()
|
||||
{
|
||||
Debug.LogFormat("OnClientEnterLobby {0}", SceneManager.GetActiveScene().name);
|
||||
}
|
||||
|
||||
public override void OnClientExitLobby()
|
||||
{
|
||||
Debug.LogFormat("OnClientExitLobby {0}", SceneManager.GetActiveScene().name);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 41fc608223969754e817c29908fdb1d3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
35
Assets/Mirror/Examples/Lobby/Scripts/OfflineGUI.cs
Normal file
35
Assets/Mirror/Examples/Lobby/Scripts/OfflineGUI.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace Mirror.Examples.NetworkLobby
|
||||
{
|
||||
public class OfflineGUI : MonoBehaviour
|
||||
{
|
||||
[Scene]
|
||||
public string LobbyScene;
|
||||
|
||||
void Start()
|
||||
{
|
||||
// Ensure main camera is enabled because it will be disabled by PlayerController
|
||||
Camera.main.enabled = true;
|
||||
|
||||
// Since this is a UI only screen, lower the framerate and thereby lower the CPU load
|
||||
Application.targetFrameRate = 10;
|
||||
}
|
||||
|
||||
void OnGUI()
|
||||
{
|
||||
GUILayout.BeginArea(new Rect(10, 10, 200, 130));
|
||||
|
||||
GUILayout.Box("OFFLINE SCENE");
|
||||
GUILayout.Box("WASDQE keys to move & turn\nTouch the spheres for points\nLighter colors score higher");
|
||||
|
||||
if (GUILayout.Button("Join Game"))
|
||||
{
|
||||
SceneManager.LoadScene(LobbyScene);
|
||||
}
|
||||
|
||||
GUILayout.EndArea();
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Mirror/Examples/Lobby/Scripts/OfflineGUI.cs.meta
Normal file
11
Assets/Mirror/Examples/Lobby/Scripts/OfflineGUI.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 039bde4e5e3b63e46be9b967d06e5469
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
114
Assets/Mirror/Examples/Lobby/Scripts/PlayerController.cs
Normal file
114
Assets/Mirror/Examples/Lobby/Scripts/PlayerController.cs
Normal file
@ -0,0 +1,114 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Mirror.Examples.NetworkLobby
|
||||
{
|
||||
[RequireComponent(typeof(CharacterController))]
|
||||
public class PlayerController : NetworkBehaviour
|
||||
{
|
||||
[SyncVar]
|
||||
public int Index;
|
||||
|
||||
[SyncVar]
|
||||
public uint score = 0;
|
||||
|
||||
[SyncVar(hook = nameof(SetColor))]
|
||||
public Color playerColor = Color.black;
|
||||
|
||||
CharacterController characterController;
|
||||
|
||||
public float moveSpeed = 300f;
|
||||
|
||||
public float horiz = 0f;
|
||||
public float vert = 0f;
|
||||
public float turn = 0f;
|
||||
|
||||
public float turnSpeedAccel = 30f;
|
||||
public float turnSpeedDecel = 30f;
|
||||
public float maxTurnSpeed = 100f;
|
||||
|
||||
Vector3 direction = Vector3.zero;
|
||||
GameObject controllerColliderHitObject;
|
||||
|
||||
public override void OnStartLocalPlayer()
|
||||
{
|
||||
base.OnStartLocalPlayer();
|
||||
characterController = GetComponent<CharacterController>();
|
||||
|
||||
// Turn off main camera because GamePlayer prefab has its own camera
|
||||
GetComponentInChildren<Camera>().enabled = true;
|
||||
Camera.main.enabled = false;
|
||||
}
|
||||
|
||||
void SetColor(Color color)
|
||||
{
|
||||
//Debug.LogWarningFormat("PlayerController SetColor netId:{0} to {1}", netId, color);
|
||||
GetComponent<Renderer>().material.color = color;
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (!isLocalPlayer) return;
|
||||
|
||||
horiz = Input.GetAxis("Horizontal");
|
||||
vert = Input.GetAxis("Vertical");
|
||||
|
||||
if ((Input.GetKey(KeyCode.Q)) && (turn > -maxTurnSpeed))
|
||||
turn = turn - turnSpeedAccel;
|
||||
else if ((Input.GetKey(KeyCode.E)) && (turn < maxTurnSpeed))
|
||||
turn = turn + turnSpeedAccel;
|
||||
else
|
||||
{
|
||||
if (turn > turnSpeedDecel)
|
||||
turn = turn - turnSpeedDecel;
|
||||
else if (turn < -turnSpeedDecel)
|
||||
turn = turn + turnSpeedDecel;
|
||||
else
|
||||
turn = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
void FixedUpdate()
|
||||
{
|
||||
if (!isLocalPlayer || characterController == null) return;
|
||||
|
||||
transform.Rotate(0f, turn * Time.deltaTime, 0f);
|
||||
|
||||
direction = transform.TransformDirection((Vector3.ClampMagnitude(new Vector3(horiz, 0f, vert), 1f) * moveSpeed));
|
||||
characterController.SimpleMove(direction * Time.fixedDeltaTime);
|
||||
}
|
||||
|
||||
void OnControllerColliderHit(ControllerColliderHit hit)
|
||||
{
|
||||
// If player and prize objects are on their own layer(s) with correct
|
||||
// collision matrix, we wouldn't have to validate the hit.gameobject.
|
||||
// Since this is just an example, project settings aren't included so we check the name.
|
||||
|
||||
controllerColliderHitObject = hit.gameObject;
|
||||
|
||||
if (isLocalPlayer && controllerColliderHitObject.name.StartsWith("Prize"))
|
||||
{
|
||||
if (LogFilter.Debug) Debug.LogFormat("OnControllerColliderHit {0}[{1}] with {2}[{3}]", name, netId, controllerColliderHitObject.name, controllerColliderHitObject.GetComponent<NetworkIdentity>().netId);
|
||||
|
||||
// Disable the prize gameobject so it doesn't impede player movement
|
||||
// It's going to be destroyed in a few frames and we don't want to spam CmdClaimPrize.
|
||||
// OnControllerColliderHit will fire many times as the player slides against the object.
|
||||
controllerColliderHitObject.SetActive(false);
|
||||
|
||||
CmdClaimPrize(controllerColliderHitObject);
|
||||
}
|
||||
}
|
||||
|
||||
[Command]
|
||||
public void CmdClaimPrize(GameObject hitObject)
|
||||
{
|
||||
// Null check is required, otherwise close timing of multiple claims could throw a null ref.
|
||||
//if (hitObject != null)
|
||||
hitObject?.GetComponent<Reward>().ClaimPrize(gameObject);
|
||||
}
|
||||
|
||||
void OnGUI()
|
||||
{
|
||||
GUI.Box(new Rect(10f + (Index * 110), 10f, 100f, 25f), score.ToString().PadLeft(10));
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 24fd13686a451ad498101a604d134e39
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
45
Assets/Mirror/Examples/Lobby/Scripts/Reward.cs
Normal file
45
Assets/Mirror/Examples/Lobby/Scripts/Reward.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Mirror.Examples.NetworkLobby
|
||||
{
|
||||
public class Reward : NetworkBehaviour
|
||||
{
|
||||
[SyncVar(hook = nameof(SetColor))]
|
||||
public Color prizeColor = Color.black;
|
||||
|
||||
void SetColor(Color color)
|
||||
{
|
||||
GetComponent<Renderer>().material.color = color;
|
||||
}
|
||||
|
||||
public bool available = true;
|
||||
public Spawner spawner;
|
||||
uint points = 0;
|
||||
|
||||
// This is called from PlayerController.CmdClaimPrize which is invoked by PlayerController.OnControllerColliderHit
|
||||
// This only runs on the server
|
||||
public void ClaimPrize(GameObject player)
|
||||
{
|
||||
if (available)
|
||||
{
|
||||
// This is a fast switch to prevent two players claiming the prize in a bang-bang close contest for it.
|
||||
// First hit turns it off, pending the object being destroyed a few frames later.
|
||||
available = false;
|
||||
|
||||
// calculate the points from the color ... lighter scores higher as the average approaches 255
|
||||
// UnityEngine.Color RGB values are float fractions of 255
|
||||
points = (uint)(((prizeColor.r * 255) + (prizeColor.g * 255) + (prizeColor.b * 255)) / 3);
|
||||
if (LogFilter.Debug) Debug.LogFormat("Scored {0} points R:{1} G:{2} B:{3}", points, prizeColor.r, prizeColor.g, prizeColor.b);
|
||||
|
||||
// award the points via SyncVar on the PlayerController
|
||||
player.GetComponent<PlayerController>().score += points;
|
||||
|
||||
// spawn a replacement
|
||||
spawner.SpawnPrize();
|
||||
|
||||
// destroy this one
|
||||
NetworkServer.Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Mirror/Examples/Lobby/Scripts/Reward.cs.meta
Normal file
11
Assets/Mirror/Examples/Lobby/Scripts/Reward.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a22f9eb8ebad79e47babf4c051a714ee
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
38
Assets/Mirror/Examples/Lobby/Scripts/Spawner.cs
Normal file
38
Assets/Mirror/Examples/Lobby/Scripts/Spawner.cs
Normal file
@ -0,0 +1,38 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Mirror.Examples.NetworkLobby
|
||||
{
|
||||
public class Spawner : NetworkBehaviour
|
||||
{
|
||||
public NetworkIdentity prizePrefab;
|
||||
|
||||
float x = 0f;
|
||||
float z = 0f;
|
||||
GameObject newPrize;
|
||||
Reward reward;
|
||||
|
||||
void Start()
|
||||
{
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
SpawnPrize();
|
||||
}
|
||||
}
|
||||
|
||||
public void SpawnPrize()
|
||||
{
|
||||
x = Random.Range(-19, 20);
|
||||
z = Random.Range(-19, 20);
|
||||
|
||||
newPrize = Instantiate(prizePrefab.gameObject, new Vector3(x, 1, z), Quaternion.identity);
|
||||
newPrize.name = prizePrefab.name;
|
||||
reward = newPrize.gameObject.GetComponent<Reward>();
|
||||
reward.spawner = this;
|
||||
reward.prizeColor = Random.ColorHSV(0f, 1f, 1f, 1f, 0.5f, 1f);
|
||||
|
||||
if (LogFilter.Debug) Debug.LogFormat("Spawning Prize R:{0} G:{1} B:{2}", reward.prizeColor.r, reward.prizeColor.g, reward.prizeColor.b);
|
||||
|
||||
NetworkServer.Spawn(newPrize);
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Mirror/Examples/Lobby/Scripts/Spawner.cs.meta
Normal file
11
Assets/Mirror/Examples/Lobby/Scripts/Spawner.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0bf5c082d04f7ea459fcd30e60b5bd70
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
docs/Components/NetworkLobbyManager.PNG
Normal file
BIN
docs/Components/NetworkLobbyManager.PNG
Normal file
Binary file not shown.
After Width: | Height: | Size: 43 KiB |
46
docs/Components/NetworkLobbyManager.md
Normal file
46
docs/Components/NetworkLobbyManager.md
Normal file
@ -0,0 +1,46 @@
|
||||
# Network Lobby Manager
|
||||
|
||||
**Please see the Lobby example in the Examples folder in your Mirror folder
|
||||
|
||||
The NetworkLobbyManager is a specialized type of [NetworkManager](NetworkManager) that provides a multiplayer lobby before entering the main play scene of the game. It allows you to set up a network with:
|
||||
|
||||
- A maximum player limit
|
||||
- Automatic start when all players are ready
|
||||
- Option to prevent players from joining a game in progress
|
||||
- Customizable ways for players to choose options while in lobby
|
||||
|
||||
|
||||
There are two types of player objects with the NetworkLobbyManager:
|
||||
|
||||
**Lobby Player Prefab**
|
||||
|
||||
- One for each player
|
||||
- Created when client connects, or player is added
|
||||
- Persists until client disconnects
|
||||
- Holds ready flag and configuration data
|
||||
- Handles commands in the lobby
|
||||
- Must use the [NetworkLobbyPlayer](NetworkLobbyPlayer) component
|
||||
|
||||
**Player Prefab**
|
||||
|
||||
- One for each player
|
||||
- Created when game scene is started
|
||||
- Destroyed when leaving game scene
|
||||
- Handles commands in the game
|
||||
|
||||
|
||||
![Network Lobby Manager](NetworkLobbyManager.PNG)
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
- **Show Lobby GUI**
|
||||
Show the default OnGUI controls for the lobby.
|
||||
- **Min Players**
|
||||
Minimum number of players needed to start a game.
|
||||
- **Lobby Player Prefab**
|
||||
The prefab to create for players when they enter the lobby (requires NetworkLobbyPlayer component).
|
||||
- **Lobby Scene**
|
||||
The scene to use for the lobby.
|
||||
- **Gameplay Scene**
|
||||
The scene to use for main game play.
|
BIN
docs/Components/NetworkLobbyPlayer.PNG
Normal file
BIN
docs/Components/NetworkLobbyPlayer.PNG
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
14
docs/Components/NetworkLobbyPlayer.md
Normal file
14
docs/Components/NetworkLobbyPlayer.md
Normal file
@ -0,0 +1,14 @@
|
||||
# NetworkLobbyPlayer
|
||||
|
||||
The Network Lobby Player stores per-player state for the [Network Lobby Manager](NetworkLobbyManager) while in the lobby. When using this component, you need to write a script which allows players to indicate they are ready to begin playing, which sets the ReadyToBegin property.
|
||||
|
||||
A GameObject with a Network Lobby Player component must also have a Network Identity component. When you create a Network Lobby Player component on a GameObject, Unity also creates a Network Identity component on that GameObject if it does not already have one.
|
||||
|
||||
![Network Lobby Player](NetworkLobbyPlayer.PNG)
|
||||
|
||||
- **Show Lobby GUI**
|
||||
Enable this to show the developer GUI for players in the lobby. This UI is only intended to be used for ease of development. This is enabled by default.
|
||||
- **Ready To Begin**
|
||||
Enable this to have lobby players automatically be set to Ready.
|
||||
- **Network Sync Interval**
|
||||
The rate at which information is sent from the Network Lobby Player to the server.
|
@ -4,6 +4,10 @@ General description of Components
|
||||
|
||||
- [NetworkManager](NetworkManager)
|
||||
The Network Manager is a component for managing the networking aspects of a multiplayer game.
|
||||
- [NetworkLobbyManager](NetworkLobbyManager)
|
||||
The Network Lobby Manager is an extension component of Network Manager that provides a basic functional lobby.
|
||||
- [NetworkLobbyPlayer](NetworkLobbyPlayer)
|
||||
The Network Lobby Player is a component that's required on Player prefabs used in the Lobby Scene with the Network Lobby Manager above.
|
||||
- [NetworkManagerHUD](NetworkManagerHUD)
|
||||
The Network Manager HUD is a quick-start tool to help you start building your multiplayer game straight away, without first having to build a user interface for game creation/connection/joining. It allows you to jump straight into your gameplay programming, and means you can build your own version of these controls later in your development schedule.
|
||||
- [NetworkIdentity](NetworkIdentity)
|
||||
|
@ -74,6 +74,10 @@
|
||||
url: "/Components"
|
||||
- title: "NetworkManager"
|
||||
url: "/Components/NetworkManager"
|
||||
- title: "NetworkLobbyManager"
|
||||
url: "/Components/NetworkLobbyManager"
|
||||
- title: "NetworkLobbyPlayer"
|
||||
url: "/Components/NetworkLobbyPlayer"
|
||||
- title: "NetworkManagerHUD"
|
||||
url: "/Components/NetworkManagerHUD"
|
||||
- title: "NetworkIdentity"
|
||||
|
Loading…
Reference in New Issue
Block a user