コード例 #1
0
    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();
                    }
                }
            }
        }
    }
コード例 #2
0
ファイル: Game.cs プロジェクト: matsgottenbos/omi
        /* 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);
                }
            }
        }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     animatorController  = GetComponent <Animator>();
     player              = FindObjectOfType <PlayerController>();
     playerKeyController = player.GetComponent <KeyController>();
     treasure            = GetComponent <DropController>();
 }
コード例 #4
0
    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());
    }
コード例 #5
0
 void HandleKeyCollision(KeyController kc)
 {
     EventHub.Instance.FireEvent(new KeyCollectedEvent()
     {
         keyType = kc.keyType
     });
 }
コード例 #6
0
 // 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;
 }
コード例 #7
0
        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);
                }
            }
        }
コード例 #8
0
 public override void Update(
     MouseController MouseController,
     KeyController KeyController,
     int DeltaT,
     Transform Transform)
 {
 }
コード例 #9
0
ファイル: KeyController.cs プロジェクト: TonyPwny/CS428P1
 private void KeyPickedUp(GameObject protagonist, KeyController key)
 {
     keyDropped = false;
     protagonist.GetComponent <ProtagonistController>().HasKey(key);
     key.gameObject.SetActive(false);
     spotLight.gameObject.SetActive(false);
 }
コード例 #10
0
        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);
        }
コード例 #11
0
 public void Initialize()
 {
     floorGenerator = new FloorGenerator(environmentParameters);
     roomBuilder    = roomPrefab.GetComponent <RoomBuilder>();
     hasInitialized = true;
     keyController  = FindObjectOfType <KeyController>();
 }
コード例 #12
0
 public void collectKey(KeyController newKey)
 {
     if (!keysCollected.Contains(newKey))
     {
         keysCollected.Add(newKey);
     }
 }
コード例 #13
0
    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;
        }
    }
コード例 #14
0
        /// <summary>
        /// Set a bindings primary key
        /// </summary>
        public void SetKeyPrimary(string KeyName, KeyController keyCode)
        {
            HardKey key = Find(KeyName);

            key.Primary = keyCode;
            SaveXML();
        }
コード例 #15
0
        /// <summary>
        /// Set a bindings primary key
        /// </summary>
        public void SetKeySecondary(string KeyName, KeyController keyAxis)
        {
            HardKey key = Find(KeyName);

            key.Secondary = keyAxis;
            SaveXML();
        }
コード例 #16
0
        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();
        }
コード例 #17
0
        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("");
            }
        }
コード例 #18
0
        public override void Update(
            MouseController MouseController, KeyController KeyController, int DeltaT, Transform Transform)
        {
            base.Update(MouseController, KeyController, DeltaT, Transform);

            _StackView.Update(MouseController, KeyController, DeltaT, Transform);
        }
コード例 #19
0
 void Awake()
 {
     if (I == null)
     {
         I = this;
     }
 }
コード例 #20
0
        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
                }
            };
        }
コード例 #21
0
        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);
            }
        }
コード例 #22
0
        static void Main()
        {
            var keyController = new KeyController();
            var engine        = new ExtendEngine(keyController);

            engine.Run();
        }
コード例 #23
0
 public void Update(
     MouseController MouseController, KeyController KeyController, int DeltaT, Transform Transform)
 {
     foreach (var s in _Stacks)
     {
         s.Value.Update(MouseController, KeyController, DeltaT, Transform);
     }
 }
コード例 #24
0
 public override void Update(MouseController MouseController, KeyController KeyController, int DeltaT, Transform Transform)
 {
     base.Update(MouseController, KeyController, DeltaT, Transform);
     if (Hover)
     {
         Position += MouseController.DragDelta;
     }
 }
コード例 #25
0
ファイル: MapView.cs プロジェクト: layagyasz/OpenPanzerBlitz
 public void Update(
     MouseController MouseController, KeyController KeyController, int DeltaT, Transform Transform)
 {
     foreach (TileView t in TilesEnumerable)
     {
         t.Update(MouseController, KeyController, DeltaT, Transform);
     }
 }
コード例 #26
0
 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);
 }
コード例 #27
0
 void Start()
 {
     image.enabled = false;
     if (instance == null)
     {
         instance = this;
     }
 }
コード例 #28
0
 // 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;
 }
コード例 #29
0
ファイル: GameController.cs プロジェクト: nmurguet/prototipos
    // Start is called before the first frame update
    void Start()
    {
        players[activePlayer].SetActive(true);
        player = FindObjectOfType <car>();

        keyboard  = FindObjectOfType <KeyController>();
        vc.Follow = player.transform;
    }
コード例 #30
0
 public void Update(
     MouseController MouseController, KeyController KeyController, int DeltaT, Transform Transform)
 {
     if (_DirtyBuffer)
     {
         UpdateVertexBuffer();
         _DirtyBuffer = false;
     }
 }
コード例 #31
0
ファイル: KeyHeldInGoalHandler.cs プロジェクト: jperk51/Alter
 // Use this for initialization
 void Start()
 {
     keyCont = GameObject.Find ("Key").GetComponent<KeyController> ();
 }
コード例 #32
0
 // 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> ();
 }
コード例 #33
0
 // Use this for initialization
 void Start()
 {
     keyCon = gameObject.GetComponent<KeyController> ();
 }