feat: Added a RemoveBehaviour with Parameter

This commit is contained in:
2023-11-30 17:54:32 +03:00
parent bb6990a80c
commit c03d74dbe0
2 changed files with 23 additions and 9 deletions

View File

@@ -63,17 +63,23 @@ public interface IBehaviourController : IAssignableGameObject
/// </returns>
bool TryGetBehaviour<T>([NotNullWhen(returnValue: true)] out T? behaviour);
/// <typeparam name="T">An implemented class or <see cref="interface"/> of <see cref="IBehaviour"/></typeparam>
/// <typeparam name="T">An implemented class or <see cref="interface"/>.</typeparam>
/// <returns>Returns a list of all the matching <see cref="IBehaviour"/>s found in the <see cref="IBehaviourController"/>.</returns>
IList<T> GetBehaviours<T>() where T : IBehaviour;
IList<T> GetBehaviours<T>();
/// <summary>
/// Removes the <see cref="IBehaviour"/> found in the <see cref="IBehaviourController"/>.
/// </summary>
/// <param name="removeAll">If all of the instances of the given Type is to be removed or not.</param>
/// <typeparam name="T">An implemented class or <see cref="interface"/> of <see cref="IBehaviour"/></typeparam>
void RemoveBehaviour<T>(bool removeAll = false) where T : IBehaviour;
void RemoveBehaviour<T>(bool removeAll = false) where T : class, IBehaviour;
/// <summary>
/// Removes the <see cref="IBehaviour"/> found in the <see cref="IBehaviourController"/>.
/// </summary>
/// <param name="removeAll">If all of the instances of the given Type is to be removed or not.</param>
/// <typeparam name="T">An implemented class or <see cref="interface"/> of <see cref="IBehaviour"/></typeparam>
void RemoveBehaviour<T>(T behaviour) where T : class, IBehaviour;
/// <summary>
/// To be called in every frame of the engine. Responsible for notifying <see cref="IBehaviour"/>'s under the <see cref="IBehaviourController"/>'s control that a new frame is happening.