|
|
|
@ -15,7 +15,6 @@ namespace Unity.Multiplayer.Samples.BossRoom
|
|
|
|
|
private NetworkVariable<ulong> occupierId = new NetworkVariable<ulong>(0, NetworkVariableReadPermission.Everyone, NetworkVariableWritePermission.Server);
|
|
|
|
|
private Collider platformCollider;
|
|
|
|
|
private Animator animator;
|
|
|
|
|
|
|
|
|
|
private void Awake()
|
|
|
|
|
{
|
|
|
|
|
platformCollider = GetComponent<Collider>();
|
|
|
|
@ -24,12 +23,18 @@ namespace Unity.Multiplayer.Samples.BossRoom
|
|
|
|
|
|
|
|
|
|
animator = GetComponent<Animator>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Start()
|
|
|
|
|
{
|
|
|
|
|
Invoke(nameof(ColliderEnabler),2);
|
|
|
|
|
}
|
|
|
|
|
public void AssignID(int id)
|
|
|
|
|
{
|
|
|
|
|
if (IsServer) PlatformID.Value = id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ColliderEnabler()
|
|
|
|
|
{
|
|
|
|
|
platformCollider.enabled = true;
|
|
|
|
|
}
|
|
|
|
|
public void StartRotation() => transform.DOLocalRotate(Vector3.up, 120).SetSpeedBased(true).SetId(PlatformID).SetLoops(-1, LoopType.Incremental);
|
|
|
|
|
|
|
|
|
|
private void PauseRotation() => DOTween.Pause(PlatformID);
|
|
|
|
@ -65,6 +70,7 @@ namespace Unity.Multiplayer.Samples.BossRoom
|
|
|
|
|
|
|
|
|
|
public void Occupy(ServerCharacter player)
|
|
|
|
|
{
|
|
|
|
|
Debug.Log("Platform Occupied by: " + player.uIStateDisplayHandler.m_UIState.playerName);
|
|
|
|
|
if (!IsServer || IsOccupied) return;
|
|
|
|
|
|
|
|
|
|
Pause();
|
|
|
|
|