Esempio n. 1
0
    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)));
    }
Esempio n. 2
0
 private static void BroadcastGlobalMessage(string messageName)
 {
     foreach (GameObject gameObject in RustLevel.CollectRootGameObjects())
     {
         if (!gameObject)
         {
             continue;
         }
         gameObject.BroadcastMessage(messageName, SendMessageOptions.DontRequireReceiver);
     }
 }
Esempio n. 3
0
 private static Coroutine WaitForCondition(MonoBehaviour script, Func <bool> condition, string requestLabel)
 {
     return(script.StartCoroutine(RustLevel.WaitForCondition(condition, requestLabel)));
 }
Esempio n. 4
0
    public static Coroutine Load(string levelName)
    {
        GameObject gameObject;

        return(RustLevel.Load(levelName, out gameObject));
    }