onJoinedRoom()':找不到适合的方法来覆盖

时间:2019-11-19 13:17:58

标签: c# unity3d photon

我检查了很多次,但找不到错误的地方,请有人帮忙,我不知道发生了什么

using Photon.Pun;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;


public class LobbyManager : MonoBehaviourPunCallbacks
{

    public Text LogText;

        private void Start()
    {
        PhotonNetwork.NickName = "Player " + Random.Range(1000, 9999);
        Log("Player's name is set to " + PhotonNetwork.NickName);

        PhotonNetwork.AutomaticallySyncScene = true;
        PhotonNetwork.GameVersion = "1";
        PhotonNetwork.ConnectUsingSettings();
    }

    public override void OnConnectedToMaster()
    {
        Log("Connected to Master");
    }


    public void CreateRoom()
    {

        PhotonNetwork.CreateRoom(null, new Photon.Realtime.RoomOptions { MaxPlayers = 2 });        
    }

    public void JoinRoom()
    {
        PhotonNetwork.JoinRandomRoom();
    }

    public override void onJoinedRoom()
    {
        Log("Joined the room");

            PhotonNetwork.LoadLevel("Game");

    }


    private void Log(string message)
    {

        Debug.Log(message);
        LogText.text += "\n";
        LogText.text += message;

    }


}

错误:Assets \ LobbyManager.cs(40,26):错误CS0115:'LobbyManager.onJoinedRoom()':没有合适的方法可以覆盖


我就是不明白我的错误在哪里?帮助小伙子们

0 个答案:

没有答案