It got this problem when connecting and use Server RPC call to Client to matchmaking
Assets\Scripts\FindMatchScene\MatchmakingButton.cs(35,9): error CS0103: The name ‘MatchmakingManager’ does not exist in the current context
using Unity.Netcode;
using UnityEngine;
using UnityEngine.UI;
public class MatchmakingButton : NetworkBehaviour
{
public Button findMatchButton;
private void Start()
{
if (findMatchButton != null)
{
findMatchButton.onClick.AddListener(OnFindMatchButtonPressed);
}
else
{
Debug.LogError("Button not assigned!");
}
}
public void OnFindMatchButtonPressed()
{
if (NetworkManager.Singleton.IsClient)
{
// Gửi tín hiệu tới server để bắt đầu tìm trận
RequestMatchmakingStartServerRpc();
}
}
[ServerRpc(RequireOwnership = false)]
private void RequestMatchmakingStartServerRpc(ServerRpcParams rpcParams = default)
{
MatchmakingManager.Instance.StartMatchmakingLogic();
}
}