Example #1
0
 public static UWorld GetWorlds()
 {
     FWorldContext[] contexts = FWorldContext.GetWorldContexts();
     UWorld[]        result   = new UWorld[contexts.Length];
     for (int i = 0; i < contexts.Length; i++)
     {
         result[i] = contexts[i].World();
     }
     return(result);
 }
Example #2
0
        public static      FWorldContext[] GetWorldContexts()
        {
            using (TArrayUnsafe <IntPtr> resultUnsafe = new TArrayUnsafe <IntPtr>())
            {
                Native_UEngine.GetWorldContexts(resultUnsafe.Address);

                int             count  = resultUnsafe.Count;
                FWorldContext[] result = new FWorldContext[count];
                for (int i = 0; i < count; i++)
                {
                    IntPtr worldContextPtr = resultUnsafe[i];
                    Debug.Assert(worldContextPtr != IntPtr.Zero);
                    result[i] = new FWorldContext(worldContextPtr);
                }
                return(result);
            }
        }
Example #3
0
 public static UGameInstance GetOwningGameInstance(this FWorldContext worldContext)
 {
     return(GCHelper.Find <UGameInstance>(worldContext.OwningGameInstance));
 }
Example #4
0
 public static UWorld World(this FWorldContext worldContext)
 {
     return(GCHelper.Find <UWorld>(worldContext.CurrentWorld));
 }