2021-12-27 22:30:22 -08:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace Mirror
|
|
|
|
{
|
|
|
|
/// <summary>Start position for player spawning, automatically registers itself in the NetworkManager.</summary>
|
|
|
|
[DisallowMultipleComponent]
|
|
|
|
[AddComponentMenu("Network/NetworkStartPosition")]
|
|
|
|
[HelpURL("https://mirror-networking.gitbook.io/docs/components/network-start-position")]
|
|
|
|
public class NetworkStartPosition : MonoBehaviour
|
|
|
|
{
|
2022-01-13 18:40:24 -08:00
|
|
|
public void Awake()
|
2021-12-27 22:30:22 -08:00
|
|
|
{
|
|
|
|
NetworkManager.RegisterStartPosition(transform);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void OnDestroy()
|
|
|
|
{
|
|
|
|
NetworkManager.UnRegisterStartPosition(transform);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|