private void Awake() { Screen.set_orientation((ScreenOrientation)3); this.player = ReInput.get_players().GetPlayer(0); ReInput.add_InputSourceUpdateEvent(new Action(this.OnInputUpdate)); this.controller = (CustomController)((Player.ControllerHelper) this.player.controllers).GetControllerWithTag((ControllerType)20, "TiltController"); }
internal override void UpdateValues(CustomController vrController) { Vector2 result = Vector2.zero; if (vectorAction != null) { result = vectorAction.axis; } if (upButton != null && upButton.state) { result.y += 1; } if (rightButton != null && rightButton.state) { result.x += 1; } if (downButton != null && downButton.state) { result.y -= 1; } if (leftButton != null && leftButton.state) { result.x -= 1; } vrController.SetAxisValueById(xAxisID, result.x); vrController.SetAxisValueById(yAxisID, result.y); }
internal override void UpdateValues(CustomController vrControllers) { bool state = UnityInputHelper.GetJoystickButtonValueByJoystickIndex(joystickID, inputIndex); bool isReleasing = false; if (state != lastState) { lastChangeTime = Time.realtimeSinceStartup; lastState = state; } float timeSinceLastChange = Time.realtimeSinceStartup - lastChangeTime; if (state) { canRelease = timeSinceLastChange < 0.4f; } else { isReleasing = canRelease && timeSinceLastChange < 0.1f; } if (state) { vrControllers.SetButtonValueById(inputIDs[0], state); } if (isReleasing) { vrControllers.SetButtonValueById(inputIDs[1], isReleasing); } }
// Use this for initialization void Start() { input = PlayerTarget.GetComponent<PlayerInputController>(); machine = PlayerTarget.GetComponent<MoodiePlayerMachine>(); controller = PlayerTarget.GetComponent<CustomController>(); target = PlayerTarget.transform; }
public void AtivaTudo() { skinModels[PlayerPrefsManager.Instance.prefsVariables.skinIndex].ChangeCustom(true); skin2Models[PlayerPrefsManager.Instance.prefsVariables.skinIndex].ChangeCustom(true); hairModels[PlayerPrefsManager.Instance.prefsVariables.hairIndex].ChangeCustom(true); hair2Models[PlayerPrefsManager.Instance.prefsVariables.hairIndex].ChangeCustom(true); shirtModels[PlayerPrefsManager.Instance.prefsVariables.shirtIndex].ChangeCustom(true); shirt2Models[PlayerPrefsManager.Instance.prefsVariables.shirtIndex].ChangeCustom(true); legModels[PlayerPrefsManager.Instance.prefsVariables.legsIndex].ChangeCustom(true); leg2Models[PlayerPrefsManager.Instance.prefsVariables.legsIndex].ChangeCustom(true); shoeModels[PlayerPrefsManager.Instance.prefsVariables.shoeIndex].ChangeCustom(true); shoe2Models[PlayerPrefsManager.Instance.prefsVariables.shoeIndex].ChangeCustom(true); oculosModels[PlayerPrefsManager.Instance.prefsVariables.oculosIndex].ChangeCustom(true); oculos2Models[PlayerPrefsManager.Instance.prefsVariables.oculosIndex].ChangeCustom(true); maskModels[PlayerPrefsManager.Instance.prefsVariables.maskIndex].ChangeCustom(true); mask2Models[PlayerPrefsManager.Instance.prefsVariables.maskIndex].ChangeCustom(true); boneModels[PlayerPrefsManager.Instance.prefsVariables.boneIndex].ChangeCustom(true); bone2Models[PlayerPrefsManager.Instance.prefsVariables.boneIndex].ChangeCustom(true); pupilaModels[PlayerPrefsManager.Instance.prefsVariables.sombrancelhaIndex].ChangeCustom(true); pupila2Models[PlayerPrefsManager.Instance.prefsVariables.sombrancelhaIndex].ChangeCustom(true); sobrancelhaModels[PlayerPrefsManager.Instance.prefsVariables.sombrancelhaIndex].ChangeCustom(true); sobrancelha2EsqModels[PlayerPrefsManager.Instance.prefsVariables.sombrancelhaIndex].ChangeCustom(true); sobrancelha2DirModels[PlayerPrefsManager.Instance.prefsVariables.sombrancelhaIndex].ChangeCustom(true); customController = GetComponent <CustomController>(); customController.TiraCustomDesativada(); Debug.Log("[CustomDisplay] AtivaTudo()"); }
public void TestViewData() { CustomController obj = new CustomController(); var result = obj.ReturnViewData(1) as ViewResult; Assert.AreEqual("Swaroop Kumar", result.ViewData["name"]); }
private void Initialize() { gamepad = GetComponent <Fyo.SocketGamepad>(); // Find the controller we want to manage Player player = ReInput.players.GetPlayer(playerId); // get the player controller = player.controllers.GetControllerWithTag <CustomController>(controllerTag); // get the controller if (controller == null) { Debug.LogError("A matching controller was not found for tag \"" + controllerTag + "\""); } // Callback Update Method: // Set callbacks to retrieve current element values. // This is a different way of updating the element values in the controller. // You set an update function for axes and buttons and these functions will be called // to retrieve the current source element values on every update loop in which input is updated. if (controller != null) { controller.SetAxisUpdateCallback(GetAxisValueCallback); controller.SetButtonUpdateCallback(GetButtonValueCallback); } initialized = true; }
private LiveBetsBase(IHubConnectionContext <dynamic> clients) { Clients = clients; _shortMatchCodes = new Dictionary <string, SavedMatch>(); gameToSave = new List <Game>(); //the controller below is for testing please comment it initailisation to save server resources myController = new MyController(); myApiController = new MatchController(); _gamesWithLiveScoresAndOdds.Clear(); cc = new CustomController(); BetDatabase = cc.BetDatabase; //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Important, please take caution!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1 // firt check if there are some games in the db then populate their MatchNo's in memeory to avoid duplicate ShortCodes setInitialGamesFromDb(); //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1 _liveBetUrls = new List <LiveBetSource> { new LiveBetSource { Name = "Scores", Url = "http://www.goalserve.com/getfeed/d1aa4f5599064db8b343090338221a49/soccernew/inplay" }, new LiveBetSource { Name = "Odds", Url = "http://www.goalserve.com/getfeed/d1aa4f5599064db8b343090338221a49/lines/soccer-inplay" } }; GetchAllGamesFromServiceProvider().Wait(); _timer = new Timer(UpdateGames, null, _updateInterval, _updateInterval); }
public void Streamer_GuestConnected(object sender, Parsec.ParsecGuest guest) { int parsecPlayerId = _parsecPlayerIdCount; _parsecPlayerIdCount++; if (rewiredPlayers.Count == 0) { Debug.LogWarning("ParsecManager : No rewired players to assign"); return; } string rewiredPlayerId = _GetAvailableRewiredPlayer(); CustomController csControllerJoystick = ReInput.controllers.CreateCustomController(0, "Parsec_" + guest.id); CustomController csControllerKeyboard = ReInput.controllers.CreateCustomController(1, "Parsec_" + guest.id); CustomController csControllerMouse = ReInput.controllers.CreateCustomController(2, "Parsec_" + guest.id); ParsecInput.AssignGuestToPlayer(guest, parsecPlayerId); Player rewiredPlayer = ReInput.players.GetPlayer(rewiredPlayerId); ParsecRewiredInput.AssignCustomControllerToUser(guest, csControllerJoystick); ParsecRewiredInput.AssignKeyboardControllerToUser(guest, csControllerKeyboard); ParsecRewiredInput.AssignMouseControllerToUser(guest, csControllerMouse); rewiredPlayer.controllers.AddController(csControllerJoystick, true); rewiredPlayer.controllers.AddController(csControllerKeyboard, true); rewiredPlayer.controllers.AddController(csControllerMouse, true); _rewiredPlayerByGuestIds.Add(guest.id, rewiredPlayerId); _guestIdByRewiredPlayer.Add(rewiredPlayerId, guest.id); _customControllersByGuestIds.Add(guest.id, new CustomController[] { csControllerJoystick, csControllerKeyboard, csControllerMouse }); }
private void Initialize() { ReInput.add_InputSourceUpdateEvent(new Action(this.OnInputSourceUpdate)); this.joysticks = (TouchJoystickExample[])((Component)this).GetComponentsInChildren <TouchJoystickExample>(); this.buttons = (TouchButtonExample[])((Component)this).GetComponentsInChildren <TouchButtonExample>(); this.axisCount = this.joysticks.Length * 2; this.buttonCount = this.buttons.Length; this.axisValues = new float[this.axisCount]; this.buttonValues = new bool[this.buttonCount]; this.controller = (CustomController)((Player.ControllerHelper)ReInput.get_players().GetPlayer(this.playerId).controllers).GetControllerWithTag <CustomController>(this.controllerTag); if (this.controller == null) { Debug.LogError((object)("A matching controller was not found for tag \"" + this.controllerTag + "\"")); } if (((Controller)this.controller).get_buttonCount() != this.buttonValues.Length || ((ControllerWithAxes)this.controller).get_axisCount() != this.axisValues.Length) { Debug.LogError((object)"Controller has wrong number of elements!"); } if (this.useUpdateCallbacks && this.controller != null) { this.controller.SetAxisUpdateCallback(new Func <int, float>(this.GetAxisValueCallback)); this.controller.SetButtonUpdateCallback(new Func <int, bool>(this.GetButtonValueCallback)); } this.initialized = true; }
// Use this for initialization void Start() { input = PlayerTarget.GetComponent <PlayerInputController>(); machine = PlayerTarget.GetComponent <MoodiePlayerMachine>(); controller = PlayerTarget.GetComponent <CustomController>(); target = PlayerTarget.transform; }
private void button1_Click(object sender, EventArgs e) { PathSettings.localPath = @"C:\Users\radek\Documents\"; PathSettings.remotePath = @"/home/radek/Pliki/"; ConnectionSettings connection = new ConnectionSettings(); connection.Ip = ipTextBox.Text; int n; bool isNumeric = int.TryParse(portTextBox.Text, out n); connection.Port = portTextBox.Text; connection.Username = "******"; connection.Password = "******"; if (!isNumeric) { var result = System.Windows.Forms.MessageBox.Show("Błąd", "Niepoprawny format portu", System.Windows.Forms.MessageBoxButtons.OK); } else { CustomController controller = new CustomController(connector = new Connector(connection, customProgressBar)); controller.processDownloads(); } // statusLabel.Text = connector.getConnectionStatus(); // // listOfFiles = connector.sendCommand(); // Thread thr = new Thread(new ThreadStart(connector.downloadFile)); // thr.Start(); }
void Awake() { Screen.orientation = ScreenOrientation.Landscape; player = ReInput.players.GetPlayer(0); // get the Rewired Player ReInput.InputSourceUpdateEvent += OnInputUpdate; // subscribe to input update event controller = (CustomController)player.controllers.GetControllerWithTag(ControllerType.Custom, "TiltController"); // get the Custom Controller from the player by the Tag set in the editor }
public void TestContactView() { CustomController obj = new CustomController(); var result = obj.ReturnViews(1) as ViewResult; Assert.AreEqual("Contact", result.ViewName); }
private void Awake() { Screen.orientation = ScreenOrientation.LandscapeLeft; this.player = ReInput.players.GetPlayer(0); ReInput.InputSourceUpdateEvent += new Action(this.OnInputUpdate); this.controller = (CustomController)this.player.controllers.GetControllerWithTag(ControllerType.Custom, "TiltController"); }
// Update is called once per frame void Update() { //if (Input.GetMouseButtonDown(0)) if (CustomController.GetButtonDown(Constants.TakePicture)) { if (cameraSnap == null || CameraReady == false) { return; } cameraSnap.SnapShutter(); TakePicture(); if (cameraSFX != null) { cameraSFX.Play(); } if (picText != null) { picText.text = (allPics.Length - picIndex).ToString(); } } if (CustomController.GetButtonDown(Constants.ReadyCamera)) { ReadyCamera(); } if (CustomController.GetButtonUp(Constants.ReadyCamera)) { UnReadyCamera(); } }
public void TestAboutViews() { CustomController obj = new CustomController(); var result = obj.ReturnViews(2) as ViewResult; Assert.AreEqual("About", result.ViewName); }
private void Initialize() { ReInput.InputSourceUpdateEvent += new Action(this.OnInputSourceUpdate); this.touchController = base.GetComponent <TouchControllerExample>(); this.axisCount = this.touchController.joysticks.Length * 2; this.buttonCount = this.touchController.buttons.Length; this.axisValues = new float[this.axisCount]; this.buttonValues = new bool[this.buttonCount]; Player player = ReInput.players.GetPlayer(this.playerId); this.controller = player.controllers.GetControllerWithTag <CustomController>(this.controllerTag); if (this.controller == null) { Debug.LogError("A matching controller was not found for tag \"" + this.controllerTag + "\""); } if (this.controller.buttonCount != this.buttonValues.Length || this.controller.axisCount != this.axisValues.Length) { Debug.LogError("Controller has wrong number of elements!"); } if (this.useUpdateCallbacks && this.controller != null) { this.controller.SetAxisUpdateCallback(new Func <int, float>(this.GetAxisValueCallback)); this.controller.SetButtonUpdateCallback(new Func <int, bool>(this.GetButtonValueCallback)); } this.initialized = true; }
public void GetTest(string extraRole, bool valid) { var username = RandomString(); var password = RandomString(); var membershipProvider = new MockCMSMembershipProvider { ValidUser = true }; var roleProvider = new MockCMSRoleProvider(); var db = DatabaseFixture.NewDbContext(); var context = ContextTestUtils.CreateMockHttpContext(); roleProvider.UserRoles.AddRange(new[] { "APIOnly", extraRole }); db.WriteContentSql("GetTest", "--API\r\nSELECT TOP 10 * FROM dbo.People"); CreateUser(username, password, roles: new[] { "Access" }); context.Headers["Authorization"] = BasicAuthenticationString(username, password); CMSMembershipProvider.SetCurrentProvider(membershipProvider); CMSRoleProvider.SetCurrentProvider(roleProvider); var authenticated = AuthHelper.AuthenticateDeveloper(HttpContextFactory.Current, additionalRole: "APIOnly").IsAuthenticated; authenticated.ShouldBe(valid); if (valid) { var controller = new CustomController(new Lifecycle.RequestManager()) { Request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/CustomAPI/GetTest") }; var results = controller.Get("GetTest"); results.Count().ShouldBeGreaterThan(0); (results.First().PeopleId as int?).ShouldNotBeNull(); } }
//private readonly ApplicationDbContext db = new ApplicationDbContext(); public ReceiptPrintController() { _timeFormmater = new TimeFormmater(); cc = new CustomController(); BetDatabase = cc.BetDatabase; // _userManager = this.RequestContext.Principal.Identity//cc.UserManager; }
public void ResetRewired() { ReInput.Reset(); #if (UNITY_IOS || UNITY_TVOS || UNITY_STANDALONE_OSX) appleVirtualController = null; #endif }
private void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { child = other.GetComponent <CustomController>(); rigi.interpolation = RigidbodyInterpolation.Interpolate; } }
private void Start() { player = ReInput.players.GetPlayer(0); ReInput.InputSourceUpdateEvent += OnInputUpdate; // subscribe to input update event controller = (CustomController)player.controllers.GetControllerWithTag(ControllerType.Custom, "Touch"); buttonRect = TouchControlsManager.RectTransformToScreenSpace(rectTransform); }
private static void OnAppleControllerDisconnected() { if (!Application.isPlaying) { return; } player.controllers.RemoveController(appleVirtualController); appleVirtualController = null; }
private void OnTriggerExit(Collider other) { if (other.CompareTag("Player")) { child.GiveParentVelocity(new Vector3(0, 0, 0)); child = null; rigi.interpolation = RigidbodyInterpolation.None; } }
//set control buttons to display current configuration void UpdateButtonText() { ReadyCameraControl.GetComponentInChildren <Text>().text = CustomController.GetButtonInput(Constants.ReadyCamera); TakePictureControl.GetComponentInChildren <Text>().text = CustomController.GetButtonInput(Constants.TakePicture); ThrowObjectControl.GetComponentInChildren <Text>().text = CustomController.GetButtonInput(Constants.ThrowObject); PauseControl.GetComponentInChildren <Text>().text = CustomController.GetButtonInput(Constants.Pause); RunControl.GetComponentInChildren <Text>().text = CustomController.GetButtonInput(Constants.RunButton); CrouchControl.GetComponentInChildren <Text>().text = CustomController.GetButtonInput(Constants.CrouchButton); }
private void Start() { rewiredPlayer = ReInput.players.GetPlayer(0); lookRect = RectTransformToScreenSpace(lookRectTransform); ReInput.InputSourceUpdateEvent += OnRewiredInputUpdate; // subscribe to input update event controller = (CustomController)rewiredPlayer.controllers.GetControllerWithTag(ControllerType.Custom, "Touch"); EnemySpawner.OnLevelClear += OnLevelClear; }
public void RestoreDefaults() { if (NormalButtonSFX != null) { NormalButtonSFX.Play(); } CustomController.RestoreDefaults(); UpdateButtonText(); CustomController.SaveAllKeys(); }
// Start is called before the first frame update private void Awake() { if (Instance == null) { Instance = this; } else { Destroy(gameObject); } }
// Use this for initialization void Start() { Time.timeScale = 1; Object.DontDestroyOnLoad(this.gameObject); endprompt.gameObject.SetActive(false); Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; //initialize controls CustomController.LoadAllKeys(); }
internal override void UpdateValues(CustomController vrControllers) { float value = UnityInputHelper.GetJoystickAxisRawValueByJoystickIndex(joystickID, inputIndex); if (invert) { value = -value; } foreach (int inputID in inputIDs) { vrControllers.SetAxisValueById(inputID, value); } }
void Start () { // Put any code here you want to run ONCE, when the object is initialized input = gameObject.GetComponent<PlayerInputController>(); // Grab the controller object from our object controller = gameObject.GetComponent<CustomController>(); // Our character's current facing direction, planar to the ground lookDirection = transform.forward; // Set our currentState to idle on startup currentState = PlayerStates.Idle; }
public void Initialize() { Debug.Log("InputManager.Initialize()"); camera = camera != null ? camera : Camera.main; player = ReInput.players.GetPlayer( playerId ); controller = player.controllers.GetControllerWithTag<CustomController>( controllerTag ); if ( controller == null ) { Debug.LogError( "No controller found with tag: " + controllerTag ); return; } ReInput.InputSourceUpdateEvent += OnInputSourceUpdate; }
private void Initialize() { // Subscribe to the input source update event so we can update our source element data before controllers are updated ReInput.InputSourceUpdateEvent += OnInputSourceUpdate; // Get the touch controller touchController = GetComponent<Demos.TouchControllerExample>(); // Get expected element counts axisCount = touchController.joysticks.Length * 2; // 2 axes per stick buttonCount = touchController.buttons.Length; // Set up arrays to store our current source element values axisValues = new float[axisCount]; buttonValues = new bool[buttonCount]; // Find the controller we want to manage Player player = ReInput.players.GetPlayer(playerId); // get the player controller = player.controllers.GetControllerWithTag<CustomController>(controllerTag); // get the controller if(controller == null) { Debug.LogError("A matching controller was not found for tag \"" + controllerTag + "\""); } // Verify controller has the number of elements we're expecting if(controller.buttonCount != buttonValues.Length || controller.axisCount != axisValues.Length) { // controller has wrong number of elements Debug.LogError("Controller has wrong number of elements!"); } // Callback Update Method: // Set callbacks to retrieve current element values. // This is a different way of updating the element values in the controller. // You set an update function for axes and buttons and these functions will be called // to retrieve the current source element values on every update loop in which input is updated. if(useUpdateCallbacks && controller != null) { controller.SetAxisUpdateCallback(GetAxisValueCallback); controller.SetButtonUpdateCallback(GetButtonValueCallback); } initialized = true; }
public OxyPlotGraphViewer() { Controller = new CustomController(); }
//Use this for pre-initialization void Awake() { //set up links move_controller = this.gameObject.GetComponent<CustomController>(); }
void Awake() { Screen.orientation = ScreenOrientation.Landscape; player = ReInput.players.GetPlayer(0); // get the Rewired Player ReInput.InputSourceUpdateEvent += OnInputUpdate; // subscribe to input update event controller = (CustomController)player.controllers.GetControllerWithTag(ControllerType.Custom, "TiltController"); // get the Custom Controller from the player by the Tag set in the editor }