private void Start() { audioSource = GetComponent <AudioSource>(); Door = GameObject.Find("Door_Pivot"); Vibscript = Door.gameObject.GetComponent <VibrateController>(); //Vibscript.enabled = false; }
public GameObject destinationEmpty; // Drag and drop an empty object to the place it needs to stop rotating towards. void Start() { vibrate = transform.Find("/Vibration").GetComponent <VibrateController>(); screwDriver = GameObject.Find("/TorquePlaceholder/Torque"); screwDriverPivot = screwDriver.transform.GetChild(0).gameObject; audioData = GetComponent <AudioSource>(); }
void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("Player")) { VibrateController.vibrateControllerForXSeconds(0.1f, 0.7f, 0.7f); print(audioSource.name); if (audioSource != null) { audioSource.Play(); } other.GetComponent <Player_Movement>().addDirectionalForce(this.transform.up, force, jumpTime); GetComponent <Animator>().SetTrigger("Triggered"); } else if (other.CompareTag("Box")) { print(audioSource.name); if (audioSource != null) { audioSource.Play(); } other.GetComponent <BoxBounce>().addDirectionalForce(this.transform.up, force * 1.2f); GetComponent <Animator>().SetTrigger("Triggered"); } }
public ReActionTest() { InitializeComponent(); g_Results = new List <KeyValuePair <int, Nullable <int> > >(); g_VibrateController = VibrateController.Default; }
private void ProcessScan(Result successfulScan, TimeSpan scanTime, CodeType scanType) { bool flag = true; if (this._resultCache == null) { flag = true; } else { if (this._resultCache.Text.Length == successfulScan.Text.Length && this._resultCache.Text.Substring(1, 10) == successfulScan.Text.Substring(1, 10)) { flag = false; } } if (flag) { this._resultCache = successfulScan; if (scanType == CodeType.QRCode) { ParsedResult scanObject = ResultParser.parseResult(successfulScan); this.RaiseOnScanSuccessful(scanType, successfulScan.Text, scanObject, scanTime); } else { this.RaiseOnScanSuccessful(scanType, successfulScan.Text, successfulScan.Text, scanTime); } if (this.VibrateOnSuccess) { VibrateController @default = VibrateController.Default; @default.Start(this.VibrationTime); } } }
public void newCutscene(Vector2 finalPosition, float pan_duration, float stay_duration, Player_EnterDoors linkedDoor) { VibrateController.vibrateControllerForXSeconds(pan_duration + stay_duration, 0, 0); Time.timeScale = 0; inCutscene = true; StartCoroutine(panCamera(this.transform.position, Time.realtimeSinceStartup, finalPosition, pan_duration, stay_duration, linkedDoor)); }
public void PlaySound() { if (_strongBeat > PickerBeat.SelectedIndex) { _strongBeat = 0; } using (Stream stream = TitleContainer.OpenStream("Res/Sound/rhythm.wav")) { SoundEffect effect = SoundEffect.FromStream(stream); SoundEffectInstance sei = effect.CreateInstance(); if (_strongBeat == 0) { sei.Volume = (float)(SliderVolume.Value * 1); } else { sei.Volume = (float)(SliderVolume.Value * 0.6); } FrameworkDispatcher.Update(); sei.Play(); } _strongBeat++; if (CheckBoxVibrate.IsChecked.Value) { VibrateController vibController = VibrateController.Default; TimeSpan ts = TimeSpan.FromMilliseconds(50); vibController.Start(ts); } }
public VibrateListBoxPage() { InitializeComponent(); mainSettings = new AppSettings(); // Vibrate Device MainVibrateController = VibrateController.Default; // Events TrillVibrate.Tap += TrillVibrate_Tap; TrillVibrateButton.Tap += TrillVibrateButton_Tap; SpicatoVibrate.Tap += SpicatoVibrate_Tap; SpicatoVibrateButton.Tap += SpicatoVibrateButton_Tap; PizzicatoVibrate.Tap += PizzicatoVibrate_Tap; PizzicatoVibrateButton.Tap += PizzicatoVibrateButton_Tap; StaccatoVibrate.Tap += StaccatoVibrate_Tap; StaccatoVibrateButton.Tap += StaccatoVibrateButton_Tap; TenutoVibrate.Tap += TenutoVibrate_Tap; TenutoVibrateButton.Tap += TenutoVibrateButton_Tap; FermataVibrate.Tap += FermataVibrate_Tap; FermataVibrateButton.Tap += FermataVibrateButton_Tap; SnakeVibrate.Tap += SnakeVibrate_Tap; SnakeVibrateButton.Tap += SnakeVibrateButton_Tap; ZigZagVibrate.Tap += ZigZagVibrate_Tap; ZigZagVibrateButton.Tap += ZigZagVibrateButton_Tap; RandomVibrate.Tap += RandomVibrate_Tap; RandomVibrateButton.Tap += RandomVibrateButton_Tap; }
public Game_Page() { haptic = VibrateController.Default; InitializeComponent(); // Get the content manager from the application contentManager = (Application.Current as App).Content; // Create a timer for this page timer = new GameTimer(); timer.UpdateInterval = TimeSpan.FromTicks(333333); timer.Update += OnUpdate; timer.Draw += OnDraw; LayoutUpdated += new EventHandler(GamePage_LayoutUpdated); // Disable the auto-sleep mode so that the app will be kept alive even when the // user is not interacting with the device Microsoft.Phone.Shell.PhoneApplicationService.Current.UserIdleDetectionMode = Microsoft.Phone.Shell.IdleDetectionMode.Disabled; if (!IsolatedStorageSettings.ApplicationSettings.Contains("GamesPlayed")) { IsolatedStorageSettings.ApplicationSettings["GamesPlayed"] = 1; } else { IsolatedStorageSettings.ApplicationSettings["GamesPlayed"] = (int)IsolatedStorageSettings.ApplicationSettings["GamesPlayed"] + 1; } IsolatedStorageSettings.ApplicationSettings.Save(); }
void vibrateTimer_Tick(object sender, EventArgs e) { VibrateController vibrate = VibrateController.Default; vibrate.Start(TimeSpan.FromMilliseconds(5000)); vibrateTimer.Stop(); }
void OnTriggerEnter2D(Collider2D coll) { if (coll.gameObject.name == "Player Prefab") { coll.GetComponent <Checkpoint_Handler>().returnToLastCheckpoint(); GameObject.Find("DeathScreen").GetComponent <Animator>().SetTrigger("Die"); VibrateController.vibrateControllerForXSeconds(0.5f, 0.3f, 0.3f); } }
private void handleError(string error) { GameState.getInstance().resetTurn(); VibrateController vibrate = VibrateController.Default; //vibrate the phone for 2 seconds vibrate.Start(TimeSpan.FromMilliseconds(2000)); MessageBox.Show(error, "Error", MessageBoxButton.OK); }
public void Pause() { _paused = true; auxObj.SetActive(true); GameObject.Find("EventSystem").GetComponent <GUI_FirstSelected>().setFirstSelected(GameObject.Find("Pause_Resume")); Cursor.visible = true; Time.timeScale = 0f; VibrateController.stopVibrations(); }
public void MainMenu() { stopAtmosphericAndMusic(); introScreen.SetActive(true); GameObject.Find("DeathScreen").GetComponent <Animator>().SetTrigger("StartGame"); //GameObject.Find("EventSystem").GetComponent<GUI_FirstSelected>().setFirstSelected(GameObject.Find("Play")); Time.timeScale = 0; VibrateController.stopVibrations(); }
public static void vibrate(double sek) { if (varina) { VibrateController testVibrateController = VibrateController.Default; if (sek > 0) { testVibrateController.Start(TimeSpan.FromSeconds(sek)); } } }
private void LeftArrow(object sender, MouseEventArgs e) { BorderLeftArrow.Background = _setImage("SelectedArrow.png"); BorderMiddleArrow.Background = _setImage("Arrow.png"); BorderRightArrow.Background = _setImage("Arrow.png"); //far left arrow _selectedArrow = 3; //causes the phone to vibrate when the 3rd arrow is selected VibrateController vibrate = VibrateController.Default; vibrate.Start(TimeSpan.FromMilliseconds(50)); }
/// <summary> /// Invokes the Tapped event and allows subclasses to perform actions when tapped. /// </summary> protected virtual void OnTapped() { if (vibrate) { VibrateController vc = VibrateController.Default; vc.Start(TimeSpan.FromMilliseconds(50)); } if (Tapped != null) { Tapped(this, EventArgs.Empty); } }
protected override void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("Box")) { VibrateController.vibrateControllerForXSeconds(0.2f, 0.6f, 0.6f); other.gameObject.SetActive(false); childTrigger(); if (this.GetComponent <TriggerCutscene>() != null) { this.GetComponent <TriggerCutscene>().trigger(); } } }
void Start() { vibrate = transform.Find("/Vibration").GetComponent <VibrateController>(); time = new Stopwatch(); leftHandThumbTip = GameObject.Find("/CameraPlaceholder/LeftHand/LeftHandSkinnedMesh/hands:l_hand_world/hands:b_l_hand/hands:b_l_thumb1" + "/hands:b_l_thumb2/hands:b_l_thumb3/hands:b_l_thumb_ignore"); rightHandThumbTip = GameObject.Find("/CameraPlaceholder/RightHand/RightHandSkinnedMesh/hands:l_hand_world/hands:b_l_hand/hands:b_l_thumb1" + "/hands:b_l_thumb2/hands:b_l_thumb3/hands:b_l_thumb_ignore"); leftButtonObj = GameObject.Find("LeftButtonPos"); rightButtonObj = GameObject.Find("RightButtonPos"); diaphragmDestination = GameObject.Find("DiaphragmPosition"); diaphragm = GameObject.Find("/DetailedPump2/Diaphragm"); audioData = GetComponent <AudioSource>(); }
public GamePage() { InitializeComponent(); // Get the content manager from the application contentManager = (Application.Current as App).Content; // Create a timer for this page timer = new GameTimer(); timer.UpdateInterval = TimeSpan.FromTicks(333333); timer.Update += OnUpdate; timer.Draw += OnDraw; //currentGameState = GameState.MainMenu; //selectedDifficulty = Difficulty.Medium; vibrate = VibrateController.Default; }
private void initialiseComponents() { leftGrip = transform.Find("/PressureReleaser/L_Grip").gameObject; rightGrip = transform.Find("/PressureReleaser/R_Grip").gameObject; leftHandAnim = transform.Find("/CameraPlaceholder/LeftHand").gameObject.GetComponent <HandAnimation>(); rightHandAnim = transform.Find("/CameraPlaceholder/RightHand").gameObject.GetComponent <HandAnimation>(); steam = transform.Find("/PressureReleaser/Steam/PressurisedSteam").gameObject.GetComponent <ParticleSystem>(); gas = transform.Find("/PressureReleaser/Steam/PressurisedSteam/Gas").gameObject.GetComponent <ParticleSystem>(); vibrate = transform.Find("/Vibration").GetComponent <VibrateController>(); leftOriginalOrientation = leftGrip.transform.rotation; rightOriginalOrientation = rightGrip.transform.rotation; leftGrip.GetComponent <Rigidbody>().constraints = RigidbodyConstraints.FreezePosition | RigidbodyConstraints.FreezeRotation; rightGrip.GetComponent <Rigidbody>().constraints = RigidbodyConstraints.FreezePosition | RigidbodyConstraints.FreezeRotation; gas.Stop(); steam.Stop(); }
public Game1() { graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = 480; graphics.PreferredBackBufferHeight = 800; graphics.ApplyChanges(); TouchPanel.EnabledGestures = GestureType.HorizontalDrag | GestureType.DragComplete; vibrate = VibrateController.Default; braileData = new Braile(graphics); controls = new Controls(graphics); Content.RootDirectory = "Content"; // Frame rate is 30 fps by default for Windows Phone. TargetElapsedTime = TimeSpan.FromTicks(333333); // Extend battery life under lock. InactiveSleepTime = TimeSpan.FromSeconds(1); }
public override void HandleInput(InputState input) { foreach (GestureSample gesture in input.Gestures) { if (gesture.GestureType == GestureType.Tap) { if (gesture.Position.X >= position_suivant.X && gesture.Position.X <= font_titre.MeasureString(suivant).X + position_suivant.X && gesture.Position.Y >= position_suivant.Y && gesture.Position.Y <= font_titre.MeasureString(suivant).Y + position_suivant.Y) { if (page < 3) { if (vibrate) { VibrateController vc = VibrateController.Default; vc.Start(TimeSpan.FromMilliseconds(50)); } page++; } else { if (vibrate) { VibrateController vc = VibrateController.Default; vc.Start(TimeSpan.FromMilliseconds(50)); } this.ExitScreen(); ScreenManager.AddScreen(new OptionScreen()); } } } } base.HandleInput(input); }
void handleJumpInput1() { if (!alreadyPressedJump && !inTrampolin && MyInput.GetJump()) { if (grounded /*|| !jumpedTwice*/) { //if (!grounded) { // jumpedTwice = true; // Jump (); //} else { singleStompSource.pitch = 0.8f; singleStompSource.Play(); Jump(); VibrateController.vibrateControllerForXSeconds(0.05f, 0.2f, 0.2f); //anim.SetBool ("Ground", false); //} } else if (CanWallJump && !alreadyWallJumped) { if (huggingFrontWall) { JumpBackward(); alreadyWallJumped = true; } else if (huggingBackWall) { JumpForward(); alreadyWallJumped = true; } else { jumpNext = true; } } } }
private void Report(SyncCompleteInfo result) { string msg = null; var details = _db.Details; var settings = AppSettings.Instance; switch (result.Result) { case SyncResults.NoChange: // Toast wenn Sync erfolgreich if (settings.SyncToast) { Deployment.Current.Dispatcher.BeginInvoke(() => { VibrateController vibrate = VibrateController.Default; vibrate.Start(TimeSpan.FromMilliseconds(100)); new ToastPrompt { Title = Strings.Sync_Title, Message = Strings.Sync_MessNoChange, TextOrientation = Orientation.Vertical, }.Show(); }); } break; case SyncResults.Downloaded: using (var buffer = new MemoryStream(result.Database)) _db.SetDatabase(buffer, details); details.HasLocalChanges = false; details.Modified = result.Modified; _db.SaveDetails(); // Toast wenn Sync erfolgreich if (settings.SyncToast) { Deployment.Current.Dispatcher.BeginInvoke(() => { VibrateController vibrate = VibrateController.Default; vibrate.Start(TimeSpan.FromMilliseconds(100)); new ToastPrompt { Title = Strings.Sync_Title, Message = Strings.Sync_MessDownSucc, TextOrientation = Orientation.Vertical, }.Show(); }); } break; case SyncResults.Uploaded: details.HasLocalChanges = false; details.Modified = result.Modified; _db.SaveDetails(); // Toast wenn Sync erfolgreich if (settings.SyncToast) { Deployment.Current.Dispatcher.BeginInvoke(() => { VibrateController vibrate = VibrateController.Default; vibrate.Start(TimeSpan.FromMilliseconds(100)); new ToastPrompt { Title = Strings.Sync_Title, Message = Strings.Sync_MessUpSucc, TextOrientation = Orientation.Vertical, }.Show(); }); } break; case SyncResults.Conflict: details.Url = result.Path; details.HasLocalChanges = false; details.Modified = result.Modified; _db.SaveDetails(); msg = string.Format( Properties.Resources.Conflict, result.ConflictPath); break; case SyncResults.Failed: msg = Properties.Resources .DownloadError; break; } _reporter(_db, result.Result, msg); }
public void onVibrateTest() { VibrateController.vibrate(millisecondsToVibrate); }
public void onVibrateCancelTest() { VibrateController.cancel(); }
public void onVibratePatternRepeatTest() { long[] pattern = { 500, 1000 }; VibrateController.vibrate(pattern, 0); }
public void onVibratePatternTest() { long[] pattern = { 0, 500, 1000, 2500, 3000, 4000 }; VibrateController.vibrate(pattern, -1); }
void Awake() { Instance = this; }