refactor: IBehaviourController.TryGetBehaviour to Extension Method

This commit is contained in:
2024-11-24 11:34:36 +03:00
parent 1b3f40be5f
commit 4416f64287
4 changed files with 47 additions and 15 deletions

View File

@@ -56,14 +56,6 @@ public interface IBehaviourController : IInitialize, IAssignableGameObject, IEnu
/// <returns>The <see cref="IBehaviour"/> of the specified type if found; otherwise, <see cref="null"/>.</returns>
T? GetBehaviour<T>();
/// <summary>
/// Tries to get a <see cref="IBehaviour"/> of the specified type.
/// </summary>
/// <typeparam name="T">The type of <see cref="IBehaviour"/> to get.</typeparam>
/// <param name="behaviour">When this method returns, contains the <see cref="IBehaviour"/> of the specified type, if found; otherwise, see.</param>
/// <returns><see cref="true"/> if a <see cref="IBehaviour"/> of the specified type was found; otherwise, <see cref="false"/>.</returns>
bool TryGetBehaviour<T>([NotNullWhen(returnValue: true)] out T? behaviour);
/// <summary>
/// Gets all <see cref="IBehaviour"/>s of the specified type.
/// </summary>