示例#1
0
        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;
        }
示例#2
0
 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);
 }
示例#3
0
 protected override void create()
 {
     remote = ButtonRemote = new ButtonRemote(Name + "@" + VRPNAddressServer,
         ButtonRemote.DefaultButtonNumber,
         UniVRPNityAddressServer,
         UniVRPNityPortServer);
     ButtonRemote.ButtonChanged += new ButtonRemote.ButtonChangeEventHandler(ButtonChangedMiddle);
 }
示例#4
0
    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);
    }
示例#5
0
 public void Start()
 {
     button = new ButtonRemote(deviceName + '@' + deviceIP, 256);
     button.ButtonChanged += new ButtonRemote.ButtonChangeEventHandler(ButtonChanged);
 }
示例#6
0
 protected override void destroy()
 {
     ButtonRemote.ButtonChanged -= new ButtonRemote.ButtonChangeEventHandler(ButtonChangedMiddle);
     remote = ButtonRemote = null;
 }