【发布时间】:2016-10-18 03:23:55
【问题描述】:
谁能告诉我如何合并这个
代码
成下面的一个?
我真的不知道自己在做什么;它不起作用,只是冻结。我希望玩家在离开时不会冻结游戏。
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
void OnPlayerDisconnected(NetworkPlayer player) {
Debug.Log("Clean up after player " + player);
Network.RemoveRPCs(player);
Network.DestroyPlayerObjects(player);
}
}
using UnityEngine;
using UnityEngine.SceneManagement;
using System.Collections;
using UnityEngine.Networking;
public class RG_Disconnect : MonoBehaviour {
// Use this for initialization
void Start () {
GameObject lobbyManager;
lobbyManager = GameObject.Find ("LobbyManager");
if (lobbyManager != null)
Destroy(lobbyManager);
NetworkManager.Shutdown ();
}
// Update is called once per frame
void Update () {
SceneManager.LoadScene ("Garage");
}
}
【问题讨论】:
标签: unity3d