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; }
public void Start() { analog = new AnalogRemote(deviceName + '@' + deviceIP); analog.AnalogChanged += new AnalogRemote.AnalogChangeEventHandler(this.AnalogChanged); button = new ButtonRemote(deviceName + '@' + deviceIP, 3); button.ButtonChanged += new ButtonRemote.ButtonChangeEventHandler(this.ButtonChanged); }
protected override void create() { remote = ButtonRemote = new ButtonRemote(Name + "@" + VRPNAddressServer, ButtonRemote.DefaultButtonNumber, UniVRPNityAddressServer, UniVRPNityPortServer); ButtonRemote.ButtonChanged += new ButtonRemote.ButtonChangeEventHandler(ButtonChangedMiddle); }
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() { button = new ButtonRemote(deviceName + '@' + deviceIP, 256); button.ButtonChanged += new ButtonRemote.ButtonChangeEventHandler(ButtonChanged); }
protected override void destroy() { ButtonRemote.ButtonChanged -= new ButtonRemote.ButtonChangeEventHandler(ButtonChangedMiddle); remote = ButtonRemote = null; }