Urho.Node.GetOrCreateComponent Method

Create a component to this node if it does not exist already.

Syntax

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

Parameters

type
Type name of the component to create.
mode
Component and child node creation mode for networking.
id
The identifier to assign to the component if it must be created.

Returns

Returns the component of the specified type that was either located, or that was created.

Remarks

This method calls the Node.GetComponent method to perform the search, if the component is not found, then it calls Node.CreateComponent method with the specified type, mode and id.

Requirements

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