public static AActor[] GetAllActorsOfClass(UObject worldContextObject, UClass actorClass) { using (TArrayUnsafe <AActor> actorsUnsafe = new TArrayUnsafe <AActor>()) { Native_UGameplayStatics.GetAllActorsOfClass(worldContextObject.Address, actorClass.Address, actorsUnsafe.Address); return(actorsUnsafe.ToArray()); } }
/// <summary> /// Gets an array of all blueprints used to generate this class and its parents. 0th elements is the BP used to generate InClass /// </summary> /// <param name="inClass">The class to get the blueprint lineage for</param> /// <param name="outBlueprintParents">Array with the blueprints used to generate this class and its parents. 0th = this, Nth = least derived BP-based parent</param> /// <returns>true if there were no status errors in any of the parent blueprints, otherwise false</returns> public static bool GetBlueprintHierarchyFromClass(UClass inClass, UBlueprint[] outBlueprintParents) { using (TArrayUnsafe <UBlueprint> outBlueprintParentsUnsafe = new TArrayUnsafe <UBlueprint>()) { bool result = Native_UBlueprint.GetBlueprintHierarchyFromClass( inClass == null ? IntPtr.Zero : inClass.Address, outBlueprintParentsUnsafe.Address); outBlueprintParents = outBlueprintParentsUnsafe.ToArray(); return(result); } }
/// <summary> /// Builds a set of the UUIDs of pending latent actions on a specific object. /// </summary> /// <param name="obj">Object to query for latent actions.</param> /// <returns>An array UUIDs of the pending latent actions.</returns> public int[] GetActiveUUIDs(UObject obj) { #if WITH_EDITOR using (TArrayUnsafe <int> resultUnsafe = new TArrayUnsafe <int>()) { Native_FLatentActionManager.GetActiveUUIDs(Address, obj.Address, resultUnsafe.Address); return(resultUnsafe.ToArray()); } #else return(null); #endif }
public static T[] GetAllActorsOfClass <T>(UObject worldContextObject) where T : AActor { using (TArrayUnsafe <T> actorsUnsafe = new TArrayUnsafe <T>()) { UClass unrealClass = UClass.GetClass <T>(); if (unrealClass != null) { Native_UGameplayStatics.GetAllActorsOfClass(worldContextObject.Address, unrealClass.Address, actorsUnsafe.Address); } return(actorsUnsafe.ToArray()); } }
public T[] GetComponentsByTag <T>(FName tag) where T : UActorComponent { UClass unrealClass = UClass.GetClass <T>(); if (unrealClass == null) { return(null); } using (TArrayUnsafe <T> resultUnsafe = new TArrayUnsafe <T>()) { Native_AActor.GetComponentsByTag(Address, unrealClass.Address, ref tag, resultUnsafe.Address); return(resultUnsafe.ToArray()); } }