You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
770 B
C#
35 lines
770 B
C#
using System;
|
|
using Unity.Netcode;
|
|
using UnityEngine;
|
|
|
|
namespace Unity.Multiplayer.Samples.BossRoom
|
|
{
|
|
public class NetworkGameState : NetworkBehaviour
|
|
{
|
|
[SerializeField]
|
|
TransformVariable m_GameStateTransformVariable;
|
|
|
|
[SerializeField]
|
|
NetworkWinState m_NetworkWinState;
|
|
|
|
public NetworkWinState NetworkWinState => m_NetworkWinState;
|
|
|
|
void Awake()
|
|
{
|
|
DontDestroyOnLoad(this);
|
|
}
|
|
|
|
public override void OnNetworkSpawn()
|
|
{
|
|
gameObject.name = "NetworkGameState";
|
|
|
|
m_GameStateTransformVariable.Value = transform;
|
|
}
|
|
|
|
public override void OnNetworkDespawn()
|
|
{
|
|
m_GameStateTransformVariable.Value = null;
|
|
}
|
|
}
|
|
}
|