public static Coroutine Load(string levelName, out GameObject loader) { Globals.currentLevel = levelName; loader = new GameObject(string.Concat("Loading Level:", levelName), new Type[] { typeof(MonoBehaviour) }); UnityEngine.Object.DontDestroyOnLoad(loader); MonoBehaviour component = loader.GetComponent <MonoBehaviour>(); return(component.StartCoroutine(RustLevel.LoadRoutine(component, levelName))); }
private static void BroadcastGlobalMessage(string messageName) { foreach (GameObject gameObject in RustLevel.CollectRootGameObjects()) { if (!gameObject) { continue; } gameObject.BroadcastMessage(messageName, SendMessageOptions.DontRequireReceiver); } }
private static Coroutine WaitForCondition(MonoBehaviour script, Func <bool> condition, string requestLabel) { return(script.StartCoroutine(RustLevel.WaitForCondition(condition, requestLabel))); }
public static Coroutine Load(string levelName) { GameObject gameObject; return(RustLevel.Load(levelName, out gameObject)); }