public static Remote CreateRemote(BaseRemote sender, string name) { Remote remote = null; switch (sender.Type) { case UniVRPNity.Type.Analog: AnalogRemote analog = new AnalogRemote(name); analog.AnalogChanged += new AnalogRemote.AnalogChangeEventHandler(sender.AnalogChanged); remote = analog; break; case UniVRPNity.Type.Button: ButtonRemote button = new ButtonRemote(name); button.ButtonChanged += new ButtonRemote.ButtonChangeEventHandler(sender.ButtonChanged); remote = button; break; case UniVRPNity.Type.Tracker: TrackerRemote tracker = new TrackerRemote(name); tracker.TrackerChanged += new TrackerRemote.TrackerChangeEventHandler(sender.TrackerChanged); remote = tracker; break; } return remote; }
protected override void create() { remote = TrackerRemote = new TrackerRemote(Name + "@" + VRPNAddressServer, TrackerRemote.DefaultSensorsNumber, UniVRPNityAddressServer, UniVRPNityPortServer); TrackerRemote.TrackerChanged += new TrackerRemote.TrackerChangeEventHandler(TrackerChangedMiddle); }
public void Start() { Debug.Log(deviceName + " Client"); analog = new AnalogRemote(deviceName + '@' + deviceIP); analog.AnalogChanged += new AnalogRemote.AnalogChangeEventHandler(this.AnalogChanged); button = new ButtonRemote(deviceName + '@' + deviceIP, buttonValues.Capacity); button.ButtonChanged += new ButtonRemote.ButtonChangeEventHandler(this.ButtonChanged); tracker = new TrackerRemote(deviceName + '@' + deviceIP); tracker.TrackerChanged += new TrackerRemote.TrackerChangeEventHandler(this.TrackerChanged); }
public void Start() { tracker = new TrackerRemote(deviceName + '@' + deviceIP); tracker.TrackerChanged += new TrackerRemote.TrackerChangeEventHandler(this.TrackerChanged); }
protected override void destroy() { TrackerRemote.TrackerChanged -= new TrackerRemote.TrackerChangeEventHandler(TrackerChangedMiddle); remote = TrackerRemote = null; }