Add find actor by type and tag to level and actor classes. Move find actor by tag code to be by other find actor methods.

This commit is contained in:
Chandler Cox
2023-07-05 14:00:07 -05:00
parent bd0bc42adc
commit d88b93d56b
6 changed files with 240 additions and 137 deletions

View File

@@ -269,6 +269,17 @@ namespace FlaxEngine
{
return FindActor(typeof(T), name) as T;
}
/// <summary>
/// Tries to find actor of the given type and tag in this actor hierarchy (checks this actor and all children hierarchy).
/// </summary>
/// <param name="tag">A tag on the object.</param>
/// <typeparam name="T">Type of the object.</typeparam>
/// <returns>Actor instance if found, null otherwise.</returns>
public T FindActor<T>(Tag tag) where T : Actor
{
return FindActor(typeof(T), tag) as T;
}
/// <summary>
/// Searches for all actors of a specific type in this actor children list.