Example #1
0
 /// <summary>
 /// Gets the default object of a class.
 /// </summary>
 /// <typeparam name="T">The object type</typeparam>
 /// <param name="unrealClass">The class to get the CDO for.</param>
 /// <returns>Class default object (CDO).</returns>
 public static T GetDefault <T>(UClass unrealClass) where T : UObject
 {
     if (unrealClass != null && unrealClass.IsA <T>())
     {
         UObject defaultObject = unrealClass.GetDefaultObject();
         if (defaultObject.IsA <T>())
         {
             return(defaultObject as T);
         }
     }
     return(null);
 }