This commit is contained in:
vis2k 2021-03-09 18:53:24 +08:00
parent 64b436445f
commit 46c9bddb6c

View File

@ -1000,22 +1000,15 @@ public static void RegisterStartPosition(Transform start)
startPositions = startPositions.OrderBy(transform => transform.GetSiblingIndex()).ToList(); startPositions = startPositions.OrderBy(transform => transform.GetSiblingIndex()).ToList();
} }
/// <summary> /// <summary>Unregister a Transform from start positions.</summary>
/// Unregisters the transform of a game object as a player spawn location. // TODO why is this static?
/// <para>This is done automatically by the <see cref="NetworkStartPosition">NetworkStartPosition</see> component, but can be done manually from user code.</para>
/// </summary>
/// <param name="start">Transform to unregister.</param>
public static void UnRegisterStartPosition(Transform start) public static void UnRegisterStartPosition(Transform start)
{ {
// Debug.Log("UnRegisterStartPosition: (" + start.gameObject.name + ") " + start.position); // Debug.Log("UnRegisterStartPosition: (" + start.gameObject.name + ") " + start.position);
startPositions.Remove(start); startPositions.Remove(start);
} }
/// <summary> /// <summary>Get the next NetworkStartPosition based on the selected PlayerSpawnMethod.</summary>
/// This finds a spawn position based on NetworkStartPosition objects in the scene.
/// <para>This is used by the default implementation of OnServerAddPlayer.</para>
/// </summary>
/// <returns>Returns the transform to spawn a player at, or null.</returns>
public Transform GetStartPosition() public Transform GetStartPosition()
{ {
// first remove any dead transforms // first remove any dead transforms
@ -1053,6 +1046,7 @@ void OnServerConnectInternal(NetworkConnection conn)
} }
// called after successful authentication // called after successful authentication
// TODO do the NetworkServer.OnAuthenticated thing from x branch
void OnServerAuthenticated(NetworkConnection conn) void OnServerAuthenticated(NetworkConnection conn)
{ {
//Debug.Log("NetworkManager.OnServerAuthenticated"); //Debug.Log("NetworkManager.OnServerAuthenticated");