Nez.Portable/ECS/Entity.cs
/// <summary>
/// Adds a Component to the components list. Returns the Component.
/// </summary>
/// <returns>Scene.</returns>
/// <typeparam name="T">The 1st type parameter.</typeparam>
Adds a Component to the components list. Returns the Component.
Adds a Component to the components list . Returns the Component .
public T addComponent<T>()
            where T : Component, new()
        {
            var component = new T();
            component.entity = this;
            components.add(component);
            component.initialize();
            return component;
        }
public T addComponent < T > ( ) where T : Component , new ( ) { var component = new T ( ) ; component . entity = this ; components . add ( component ) ; component . initialize ( ) ; return component ; }
Adds a Component to the components list.
Adds a Component to the components list .
None
typeparam
The 1st type parameter.
The 1st type parameter .