void Start() { moveRawImage = (RawImage) moveObject.GetComponent<RawImage>(); rotRawImage = (RawImage) rotObject.GetComponent<RawImage>(); downRawImage = (RawImage) downObject.GetComponent<RawImage>(); ci = new ControllerInterface (player, false); }
// Use this for initialization void Start() { m_camera = GetComponentInChildren <Camera>(); controller = ControllerInterface.GetController(indexSoldier); Debug.Log("Received " + controller.name + "game controller"); m_anim = transform.Find("soldier").animation; switch (colorType) { case ColorType.Bleu: mesh.renderer.material = materials[0]; break; case ColorType.Rouge: mesh.renderer.material = materials[1]; break; case ColorType.Vert: mesh.renderer.material = materials[2]; break; case ColorType.Jaune: mesh.renderer.material = materials[3]; break; } InitCamera(); }
public DJView(ControllerInterface controller, BeatModelInterface model) { this.controller = controller; this.model = model; model.registerObserver((BeatObserver)this); model.registerObserver((BPMObserver)this); }
public void SetGame(ControllerInterface game) { currentGame = game; startTime = Time.time; pauseStartTime = Time.time; started = true; }
void Start() { moveRawImage = (RawImage)moveObject.GetComponent <RawImage>(); rotRawImage = (RawImage)rotObject.GetComponent <RawImage>(); downRawImage = (RawImage)downObject.GetComponent <RawImage>(); ci = new ControllerInterface(player, false); }
void Awake() { if (ControllerInterface.Instance == null) { ControllerInterface = new ControllerInterface(); } DontDestroyOnLoad(transform.gameObject); }
public ControllerInterface() { Instance = this; allControllers = new List <ControllerBase>(); allControllers.Add(new ControllerBase("Keyboard1")); allControllers.Add(new ControllerBase("Keyboard2")); allControllers.Add(new ControllerBase("Keyboard3")); while (Input.GetJoystickNames().Length != instantiatedControllers) { UpdateInternal(); } }
// Update is called once per frame void Update() { if (m_enabled == false) { return; } if (ControllerInterface.GetKeyDown("start")) { m_enabled = false; ChangeScene(); } }
public ControllerSelectForm(string path, ControllerInterface @interface) { InitializeComponent(); Device = path; Interface = @interface; this.cbControllerPath.Items.AddRange(ZWGlobal.GetAllUsedControllers().ToArray()); cbControllerPath.TextChanged += (o, e) => ChangeButtonsEnabled(false); cbType.SelectedIndexChanged += (o, e) => ChangeButtonsEnabled(false); this.Load += (o, e) => PrepareConnection(); }
public bool ToggleControllerInterface() { enabledClassicJoystick = !enabledClassicJoystick; if (enabledClassicJoystick) { controllerInterface = new ClassicJoystick(); } else { controllerInterface = new ModernController(); } return(enabledClassicJoystick); }
public ControlWindow(ControllerInterface controller) { serialCntrl = controller; InitializeComponent(); fanDataObject = new FanControlDO(controller); this.DataContext = fanDataObject; ResponseCallback fanCallback = ListFans; serialCntrl.Request(1, fanCallback); // start Udp server udpServer = new FanUdpServer(); udpServer.Run(fanDataObject); }
public TargetNodeValueSelectForm(string device, ControllerInterface @interface, byte? nodeId, ulong? parameterId) { InitializeComponent(); _device = device; _interface = @interface; _nodeID = nodeId; _valueId = parameterId; Refresh(); btControllerSelect.Click += (o, e) => { var form = new ControllerSelectForm(_device, _interface); form.HomeId = HomeId; if (form.ShowDialog() == DialogResult.OK) { Device = form.Device; Interface = form.Interface; HomeId = form.HomeId; } }; btNodeSelect.Click += (o, e) => { var form = new NodeSelectForm(_device, _interface); if (this.NodeId != null) { form.SelectedNode = ZWGlobal.GetNodeById(this.NodeId.Value); } if (form.ShowDialog() == DialogResult.OK) { this.NodeId = form.SelectedNode.ID; } }; btParameterSelect.Click += (o, e) => { if (_nodeID != null) { var form = new SelectNodeValueForm(ZWGlobal.GetNodeById(_nodeID.Value)); if (form.ShowDialog() == DialogResult.OK && form.SelectedValue != null) { ValueId = form.SelectedValue.GetId(); } } }; }
private void editNode(object sender, EventArgs e) { TreeNode selected = tree.SelectedNode; if (selected.Tag == null) { return; } if (selected.Tag is ControllerInterface) { ControllerInterface node = (ControllerInterface)selected.Tag; setCurrentEditor(node.createControl()); } }
private void GeometryTestForm_Load(object sender, EventArgs e) { drawingBox = new DrawingBox(); drawingBox.Anchor = AnchorStyles.Left; drawingBox.Size = this.ClientSize; drawingBox.Paint += DrawingBox_Paint; this.Controls.Add(drawingBox); intesectDrawController = new IntersectDrawController(drawingBox); intesectDrawController.Test(); pointInPolygonController = new PointInPolygonController(drawingBox); pointInPolygonController.Test(); pointRelationPosController = new PointRelationPosController(drawingBox); pointRelationPosController.Test(); }
void Start() { ENABLE_WIIMOTE = Wiimote.enableWiiMote (); // Initialize wiimote receiver // TODO(Douglas): Make this work for multiple controllers (if needed) ci = ControllerInterface.Instance; if (ENABLE_WIIMOTE) { receiver = WiimoteReceiver.Instance; receiver.connect (); while (true) { if (receiver.wiimotes.ContainsKey (1)) { ci.setController (1, receiver.wiimotes [1]); break; } } } }
public NodeSelectForm(string device, ControllerInterface @interface) { InitializeComponent(); ColumnsInitialize(); dataGrid.CellMouseDown += (o, e) => { if (e.RowIndex >= 0) //dataGrid crutch dataGrid.Rows[e.RowIndex].Selected = true; }; dataGrid.SelectionChanged += (o, e) => { btOk.Enabled = dataGrid.SelectedRows.Count > 0; }; dataGrid.CellDoubleClick += (o, e) => { this.DialogResult = DialogResult.OK; }; SetControllerToFindNodes(device, @interface); }
void Start() { ENABLE_WIIMOTE = Wiimote.enableWiiMote(); // Initialize wiimote receiver // TODO(Douglas): Make this work for multiple controllers (if needed) ci = ControllerInterface.Instance; if (ENABLE_WIIMOTE) { receiver = WiimoteReceiver.Instance; receiver.connect(); while (true) { if (receiver.wiimotes.ContainsKey(1)) { ci.setController(1, receiver.wiimotes [1]); break; } } } }
public Form1() { InitializeComponent(); // //Exception handler // ConcreteExceptionHandlerInitializer.initThisExceptionHandler( ExceptionHandler.Concrete.ExceptionHandler.getInstance()); // //MVC // ModelInterface model = new Model(); view = new Basic.View(this, model); controller = new Controller(model); //настройка переключателя tabControl1.Appearance = TabAppearance.FlatButtons; tabControl1.ItemSize = new Size(0, 1); tabControl1.SizeMode = TabSizeMode.Fixed; tabControl1.TabStop = false; tabControl1.SelectedIndex = 7; radioButton1.Checked = true; textBox5.Visible = false; label25.Visible = false; button24.Visible = false; radioButton3.Checked = true; checkBox2.Checked = true; button6.Enabled = false; button28.Enabled = false; //добавление колонок в таблицу DataGridViewTextBoxColumn coefficient0; coefficient0 = new DataGridViewTextBoxColumn(); coefficient0.Width = 363; coefficient0.HeaderText = "Пути к логам"; dataGridView1.Columns.Add(coefficient0); }
public RunCommand(string key, string description, ControllerInterface contr) : base(key, description) { this.contr = contr; }
public ControllerInterface GetController() { controller = controller ?? new ControllerInterface(this); return(controller); }
public FanControlDO(ControllerInterface cntrl) { serialCntrl = cntrl; pinMap = new Dictionary<int, byte>(); fanSpeed = new Dictionary<int, byte>(); }
void UpdateSelector() { //First pass if (m_selector == -1) { m_selector = 0; } if (ControllerInterface.GetKeyDown("right")) { m_selector++; lockSelectionTimer += lockSelectionDelay; } else if (ControllerInterface.GetKeyDown("left")) { m_selector--; lockSelectionTimer += lockSelectionDelay; } else if (ControllerInterface.GetKeyDown("down")) { foreach (VirtualSelector selector in m_currentSelectables) { selector.DownAction(); } lockSelectionTimer += lockSelectionDelay; if (m_selector == 2) { m_playersCounter--; m_playersCounter = Mathf.Clamp(m_playersCounter, 2, 4); PlayersText.text = m_playersCounter.ToString(); } } else if (ControllerInterface.GetKeyDown("up")) { foreach (VirtualSelector selector in m_currentSelectables) { selector.UpAction(); } lockSelectionTimer += lockSelectionDelay; if (m_selector == 2) { m_playersCounter++; m_playersCounter = Mathf.Clamp(m_playersCounter, 2, 4); PlayersText.text = m_playersCounter.ToString(); } } else if (ControllerInterface.GetKeyDown("validate")) { if (m_selector == 3) { StartGame(); } lockSelectionTimer += lockSelectionDelay; } if (m_selector > m_maxSelectables) { m_selector = 0; } if (m_selector < 0) { m_selector = m_maxSelectables; } }
private void SetControllerToFindNodes(string path, ControllerInterface @interface) { var zwave = ZWGlobal.PrepareZWave(path, @interface); if (zwave.WaitForControllerLoaded()) { _zwave = zwave; RefreshData(); } else { this.dataGrid.DataSource = null; MessageBox.Show("Время ожидания отклика от контроллера истекло."); } }
public static void PrepareController(string path, ControllerInterface @interface) { if (!string.IsNullOrEmpty(path)) ZWGlobal.PrepareZWave(path, @interface).WaitForControllerLoaded(); }