mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
23 lines
573 B
C#
23 lines
573 B
C#
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
public class Spawner : MonoBehaviour
|
|
{
|
|
public GameObject prefab;
|
|
|
|
void OnGUI()
|
|
{
|
|
if (GUI.Button(new Rect(0, 0, 100, 25), "Spawn on Client"))
|
|
{
|
|
SceneManager.SetActiveScene(Bootstrap.ClientWorld);
|
|
GameObject spawned = Instantiate(prefab);
|
|
}
|
|
|
|
if (GUI.Button(new Rect(0, 30, 100, 25), "Spawn on Server"))
|
|
{
|
|
SceneManager.SetActiveScene(Bootstrap.ServerWorld);
|
|
GameObject spawned = Instantiate(prefab);
|
|
}
|
|
}
|
|
}
|