Table of Contents

Method GetInterfaceComponent

Namespace
Gamelogic.Extensions
Assembly
Gamelogic.Extensions.dll

GetInterfaceComponent<TInterface>(Component)

Gets an attached component that implements the interface of the type parameter.

public static TInterface GetInterfaceComponent<TInterface>(this Component component) where TInterface : class

Parameters

component Component

The component to get the interface component from.

Returns

TInterface

The attached component cast to TInterface, or null if not found.

Type Parameters

TInterface

The interface type to search for.