Fix player components injection. Add lobby reloading when clients change
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
using HurricaneVR.Framework.ControllerInput;
|
||||
using HurricaneVR.Framework.Core.UI;
|
||||
using Sirenix.OdinInspector;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using Unity.Netcode;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Zenject;
|
||||
|
||||
public class HandMenuUI : MonoBehaviour
|
||||
public class HandMenuUI : NetworkBehaviour
|
||||
{
|
||||
[Inject]
|
||||
[ReadOnly]
|
||||
@@ -89,6 +88,14 @@ public class HandMenuUI : MonoBehaviour
|
||||
settingsButton.onClick.AddListener(() => SettingsClicked());
|
||||
}
|
||||
|
||||
public override void OnNetworkSpawn()
|
||||
{
|
||||
base.OnNetworkSpawn();
|
||||
|
||||
// Player components need to be injected manualy again, because NetworkManager doesn't inject them.
|
||||
gameObject.Inject();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
CheckInput();
|
||||
|
||||
Reference in New Issue
Block a user