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

파라미터

name Name of the input entry. This has to be unique.
deviceName Device name registered to VRPN server.
serverUrl URL to the vrpn server.
index Index of the Input entry, refer to vrpn.cfg if unsure.
type Type of the input.

반환

bool True if the operation succeed.

설명

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); } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961