Urho.Node.CreateComponent Method

Create a component to this node (with specified ID if provided).

Syntax

public Component CreateComponent (StringHash type, CreateMode mode, UInt32 id)

Parameters

type
UrhoType to create.
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.TypeStatic, CreateMode.Replicated, 0) as 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