Codestyle fixes

This commit is contained in:
Wojtek Figat
2024-02-19 14:59:02 +01:00
parent ed30cd0238
commit 4c082ef17f
22 changed files with 58 additions and 62 deletions

View File

@@ -109,6 +109,8 @@ namespace FlaxEngine
public static T[] GetScripts<T>() where T : Script
{
var scripts = GetScripts(typeof(T));
if (scripts.Length == 0)
return Array.Empty<T>();
var result = new T[scripts.Length];
for (int i = 0; i < scripts.Length; i++)
result[i] = scripts[i] as T;
@@ -119,11 +121,13 @@ namespace FlaxEngine
/// Finds all the actors of the given type in all the loaded scenes.
/// </summary>
/// <typeparam name="T">Type of the object.</typeparam>
/// <typeparam name="activeOnly">Finds only active actors.</typeparam>
/// <param name="activeOnly">Finds only active actors.</param>
/// <returns>Found actors list.</returns>
public static T[] GetActors<T>(bool activeOnly = false) where T : Actor
{
var actors = GetActors(typeof(T), activeOnly);
if (actors.Length == 0)
return Array.Empty<T>();
var result = new T[actors.Length];
for (int i = 0; i < actors.Length; i++)
result[i] = actors[i] as T;