public void TryOpenDoor() { if (!open) { if (door.CompareTag("lockedDoorRegular") || door.CompareTag("lockedDoorPuzzle") || door.CompareTag("lockedDoorLever")) { OpenDoor(); } if (door.CompareTag("lockedDoorKey")) { keyController = FindObjectOfType <KeyController>(); if (keyController) { if (keyController.currentNumberOfKeys > 0) { keyController.UseKey(); OpenDoor(); } } } } }
/* Tick */ public void Tick() { // Check key presses if (KeyController.WasKeyPressed(Config.KeyTogglePause)) { TogglePause(); } if (KeyController.WasKeyPressed(Config.KeyToggleFullscreen)) { ToggleFullscreen(); } if (Config.DebugEnableJsonLogging && KeyController.WasKeyPressed(Config.KeyLogJson)) { jsonLog.Save(); } if (KeyController.WasKeyPressed(Config.KeyExecuteHour)) { map.ExecuteHour(); } // Execute the camera ticks camera.Tick(); if (isPlaying) { // Execute the map ticks map.Tick(); // If map has changed, update the JSON log if (Config.DebugEnableJsonLogging && map.HasMapChanged) { jsonLog.Update(map); } } }
// Use this for initialization void Start() { animatorController = GetComponent <Animator>(); player = FindObjectOfType <PlayerController>(); playerKeyController = player.GetComponent <KeyController>(); treasure = GetComponent <DropController>(); }
void Awake() { if (GameManager.instance != null) { if (GameManager.instance != this) { Destroy(this.gameObject); } } else { instance = this; } if (rules == null) { rules = GetComponent <RulesController>(); } if (_inputRules == null) { _inputRules = GetComponent <KeyController>(); } _play = true; ChoosePlayer(); Pause(); StartCoroutine(Action()); }
void HandleKeyCollision(KeyController kc) { EventHub.Instance.FireEvent(new KeyCollectedEvent() { keyType = kc.keyType }); }
// Start is called before the first frame update void Start() { key = GameObject.Find("Key"); keyController = key.GetComponent <KeyController>(); outline = gameObject.GetComponent <Outline>(); openPoint = openObject.transform.position; }
public override void Update(MouseController MouseController, KeyController KeyController, int DeltaT, Transform Transform) { base.Update(MouseController, KeyController, DeltaT, Transform); if (!Visible) { return; } if (Hover && !Lock) { _StartIndex -= MouseController.WheelDelta; _StartIndex = Math.Max(0, Math.Min(_Items.Count - 1, _StartIndex)); } Transform.Translate(Position + LeftPadding); Vector2f H = new Vector2f(0, 0); bool draw = true; foreach (ClassedGuiInput <T> Item in _Items.Skip(Lock ? 0 : _StartIndex)) { Vector2f translateBy = ItemTranslation(Item); H += translateBy; draw = IsCollision(H); Item.Visible = draw; if (draw) { Item.Update(MouseController, KeyController, DeltaT, Transform); Transform.Translate(translateBy); } } }
public override void Update( MouseController MouseController, KeyController KeyController, int DeltaT, Transform Transform) { }
private void KeyPickedUp(GameObject protagonist, KeyController key) { keyDropped = false; protagonist.GetComponent <ProtagonistController>().HasKey(key); key.gameObject.SetActive(false); spotLight.gameObject.SetActive(false); }
public static int Connect(string name, KeyController _keyController) { wetMidiKeyboard = InputDevice.GetById(Convert.ToInt32(name.Split('|')[1])); { try { wetMidiKeyboard.EventReceived += MidiKeyboard_EventReceived; wetMidiKeyboard.StartEventsListening(); cts = new CancellationTokenSource(); kc = _keyController; kc.UpdateKeyMap(); Task.Run(() => { //var keyPlayLists = mtk.ArrangeKeyPlays(mtk.Index); NoteProcess(cts.Token); }, cts.Token); } catch (Exception e) { MessageBox.Show($"连接错误 \r\n {e.Message}", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } } return(0); }
public void Initialize() { floorGenerator = new FloorGenerator(environmentParameters); roomBuilder = roomPrefab.GetComponent <RoomBuilder>(); hasInitialized = true; keyController = FindObjectOfType <KeyController>(); }
public void collectKey(KeyController newKey) { if (!keysCollected.Contains(newKey)) { keysCollected.Add(newKey); } }
public void KeyClicked(KeyController keyController) { if (letters.Contains(keyController.Letter)) { uiController.ShowLetter(keyController); letters.RemoveAll(c => c == keyController.Letter); } else { TryCount--; } if (letters.Count == 0) { Score += TryCount; uiController.ShowAllKeys(); StartNewGame(false, false, false); return; } if (tryCount < 0) { string message = new StringBuilder() .AppendLine("Игра окончена.") .AppendFormat("Ваш счёт - {0}", Score) .ToString(); uiController.OpenGameOverPanel(message); return; } }
/// <summary> /// Set a bindings primary key /// </summary> public void SetKeyPrimary(string KeyName, KeyController keyCode) { HardKey key = Find(KeyName); key.Primary = keyCode; SaveXML(); }
/// <summary> /// Set a bindings primary key /// </summary> public void SetKeySecondary(string KeyName, KeyController keyAxis) { HardKey key = Find(KeyName); key.Secondary = keyAxis; SaveXML(); }
public override void Update( MouseController MouseController, KeyController KeyController, int DeltaT, Transform Transform) { if (_Movement != null) { Position = _Movement.GetPoint(DeltaT); if (_Movement.Done) { _Movement = null; } } Transform.Translate(Position); base.Update(MouseController, KeyController, DeltaT, Transform); // Display overlays since the text will not show up otherwise. if (!DISPLAYED) { Transform.Scale(1 / 64f, 1 / 64f); MOVED_DISPLAY.Update(MouseController, KeyController, DeltaT, Transform); FIRED_DISPLAY.Update(MouseController, KeyController, DeltaT, Transform); MOVING_DISPLAY.Update(MouseController, KeyController, DeltaT, Transform); WORKING_DISPLAY.Update(MouseController, KeyController, DeltaT, Transform); DISPLAYED = true; } _UnitConfigurationChangedBuffer.DispatchEvents(); }
private void decryptBtn(object sender, RoutedEventArgs e) { //Creates an instance of the KeyController Object KeyController kc = new KeyController(); //Gets IV & Encrypted Symmetric Key byte[] IV = System.IO.File.ReadAllBytes(@"C:\\Users\\SengokuMedaru\\Desktop\\keys\\IV.txt"); byte[] encryptedSymmetricKey = File.ReadAllBytes(@"C:\\Users\\SengokuMedaru\\Desktop\\keys\\encryptedSymmetricKey.txt"); //Gets the symmetric key by decrypting the encrypted symmetric key with the decryption (private) key byte[] decryptedSymmetricKey = kc.asymmetricDecryption(encryptedSymmetricKey); string fileName; OpenFileDialog dlg = new OpenFileDialog(); if (dlg.ShowDialog() == DialogResult.OK) { fileName = dlg.FileName; byte[] fileData = System.IO.File.ReadAllBytes(@fileName); byte[] plainText = kc.symmetricDecryption(fileData, decryptedSymmetricKey, IV); Console.WriteLine("Selected file is successfully decrypted!"); //Bryan, I'll need you for this //I'll have to add the file's name (which will be stored in your database I assume) at the last part of the string below System.IO.File.WriteAllBytes(@"C:\\Users\\SengokuMedaru\\Desktop\\DecryptedText\\decrypted_file.docx", plainText); Console.WriteLine(""); } else { Console.WriteLine("No file selected :("); Console.WriteLine(""); } }
public override void Update( MouseController MouseController, KeyController KeyController, int DeltaT, Transform Transform) { base.Update(MouseController, KeyController, DeltaT, Transform); _StackView.Update(MouseController, KeyController, DeltaT, Transform); }
void Awake() { if (I == null) { I = this; } }
public KeyControllerTests() { _claimsPrinciple = new ClaimsPrincipal(new ClaimsIdentity(new Claim[] { new Claim(ClaimTypes.Name, "fd7044f7-142b-43d4-b317-b6b90c6c39dc"), }, "mock")); _mockService = new Mock <IKeyService>(); // setup _mockService.Setup(x => x.FetchKey("fd7044f7-142b-43d4-b317-b6b90c6c39dc:find-key")).ReturnsAsync("test123"); _mockService.Setup(x => x.KeyExists("fd7044f7-142b-43d4-b317-b6b90c6c39dc:find-key")).ReturnsAsync(true); _mockService.Setup(x => x.SetKey("good-key", "happy-day")).ReturnsAsync(true); _mockService.Setup(x => x.SearchKeys("fd7044f7-142b-43d4-b317-b6b90c6c39dc:t*y")).ReturnsAsync(new List <string> { "toy" }); Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("fd7044f7-142b-43d4-b317-b6b90c6c39dc:toy", "a magic toy"); _mockService.Setup(x => x.SearchKeysGetValues("fd7044f7-142b-43d4-b317-b6b90c6c39dc:t*y")).ReturnsAsync(dic); _mockService.Setup(x => x.SearchKeys("fd7044f7-142b-43d4-b317-b6b90c6c39dc:not-a-key")).ReturnsAsync(new List <string>()); _keyController = new KeyController(_mockService.Object); _keyController.ControllerContext = new ControllerContext() { HttpContext = new DefaultHttpContext() { User = _claimsPrinciple } }; }
private void InitializeDevice() { foreach (var item in InputDevice.GetAll()) { item.EventReceived += (sender, ee) => { switch (ee.Event) { case NoteOnEvent @event: { Logger.Trace($"keyboard: {@event.NoteNumber} pressed"); KeyController.KeyboardPress(@event.NoteNumber); break; } case NoteOffEvent @event: { Logger.Trace($"keyboard: {@event.NoteNumber} release"); KeyController.KeyboardRelease(@event.NoteNumber); break; } } }; MidiDeviceList.Add(item); } }
static void Main() { var keyController = new KeyController(); var engine = new ExtendEngine(keyController); engine.Run(); }
public void Update( MouseController MouseController, KeyController KeyController, int DeltaT, Transform Transform) { foreach (var s in _Stacks) { s.Value.Update(MouseController, KeyController, DeltaT, Transform); } }
public override void Update(MouseController MouseController, KeyController KeyController, int DeltaT, Transform Transform) { base.Update(MouseController, KeyController, DeltaT, Transform); if (Hover) { Position += MouseController.DragDelta; } }
public void Update( MouseController MouseController, KeyController KeyController, int DeltaT, Transform Transform) { foreach (TileView t in TilesEnumerable) { t.Update(MouseController, KeyController, DeltaT, Transform); } }
public override void Update( MouseController MouseController, KeyController KeyController, int DeltaT, Transform Transform) { Transform.Translate(Position); _Text.DisplayedString = "x" + _UnitViews.Count().ToString(); _UnitViews.First().Update(MouseController, KeyController, DeltaT, Transform); _Text.Update(MouseController, KeyController, DeltaT, Transform); }
void Start() { image.enabled = false; if (instance == null) { instance = this; } }
// Start is called before the first frame update void Start() { player = GameObject.Find("Player"); script = player.GetComponent <PlayerController>(); key = GameObject.Find("Key"); keyscript = key.GetComponent <KeyController>(); no = 0; }
// Start is called before the first frame update void Start() { players[activePlayer].SetActive(true); player = FindObjectOfType <car>(); keyboard = FindObjectOfType <KeyController>(); vc.Follow = player.transform; }
public void Update( MouseController MouseController, KeyController KeyController, int DeltaT, Transform Transform) { if (_DirtyBuffer) { UpdateVertexBuffer(); _DirtyBuffer = false; } }
// Use this for initialization void Start() { keyCont = GameObject.Find ("Key").GetComponent<KeyController> (); }
// Use this for initialization void Start() { aimColor = gameObject.renderer.material.color; gameObject.renderer.material.color = new Color (aimColor.r, aimColor.g, aimColor.b, 0f); keyCon = gameObject.GetComponentInParent<KeyController> (); }
// Use this for initialization void Start() { keyCon = gameObject.GetComponent<KeyController> (); }