Urho.Node.CreateComponent<T> Method

Creates a component with the Node’s context and attaches it to the node.

Syntax

public T CreateComponent<T> (CreateMode mode, UInt32 id)
where T : Component

Type Parameters

T

Parameters

mode
Creation mode for the component, or Replicated if not specified.
id
ID to assign to the component, or null if not specified.

Returns

Returns the created component.  The result will already be attached to the node.

Remarks

C# Example

var planeObject = planeNode.CreateComponent<StaticModel> ();
planeObject.Model = cache.GetModel ("Models/Plane.mdl");
planeObject.SetMaterial(cache.GetMaterial("Materials/StoneTiled.xml"));

Requirements

Namespace: Urho
Assembly: Urho (in Urho.dll)
Assembly Versions: 1.0.0.0