Version: 2019.2
LanguageEnglish
  • C#

ClusterInput.AddInput

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public static bool AddInput(string name, string deviceName, string serverUrl, int index, ClusterInputType type);

Parameters

nameName of the input entry. This has to be unique.
deviceNameDevice name registered to VRPN server.
serverUrlURL to the vrpn server.
indexIndex of the Input entry, refer to vrpn.cfg if unsure.
typeType of the input.

Returns

bool True if the operation succeed.

Description

Add a new VRPN input entry.

The parameters are identical to how you add a input via “Project Setting > Cluster Input”. Input entry added via this method only valid for the lifetime of the application session. The added entry will not persist like those you added via the “Project Setting > Cluster Input”.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void AddNewClusterInputEntry() { // Add a new entry named "new_button_1". Which is a mouse connected to VRPN at localhost. ClusterInput.AddInput("new_button_1", "mouse_0", "localhost", 0, ClusterInputType.Button); } }