public void Start() { gameObject.AddComponent(typeof(LevelLoader)); levelLoader = GetComponent <LevelLoader>(); haptics = GetComponent <Haptics>(); haptics.SetInputSource(leftHandRay ? SteamVR_Input_Sources.LeftHand : SteamVR_Input_Sources.RightHand); }
void OnCollisionEnter(Collision collision) { Building building = collision.collider.gameObject.GetComponent <Building>(); if (building == null || building.health <= 0) { return; } building.health -= 1; if (effect != null) { effect.transform.position = collision.contacts[0].point; effect.Emit(10); } Haptics.ProvideHaptics(hand, hapticAmountOnHit); if (building.health <= 0) { if (onDestroyBuilding != null) { onDestroyBuilding.Invoke(); } for (int i = 0; i < collision.collider.gameObject.transform.childCount; ++i) { Rigidbody rb = collision.collider.gameObject.transform.GetChild(i).GetComponent <Rigidbody>(); rb.isKinematic = false; rb.useGravity = true; } collision.collider.enabled = false; } }
// Start is called before the first frame update void Awake() { //Obtenemos el objeto de la mano de Steam VR y el joint. m_pose = GetComponent <SteamVR_Behaviour_Pose>(); m_joint = GetComponent <FixedJoint>(); m_hapticActions = GetComponent <Haptics>(); }
private void CreateTaskButton_Click(object sender, RoutedEventArgs e) { SoundFX.PlayFinishCreatingTaskSound(); Haptics.ApplyCreateTaskButtonPressHaptics(); ToDoTask.CreateNote(taskDetailsTextBox.Text); App.NavService.Navigate(typeof(MainPage)); }
public void Soft() { try { Thread t = new Thread(new ThreadStart(delegate() { Haptics.HapticsNote[] _hapticsNotes = new Haptics.HapticsNote[1]; _hapticsNotes[0].magnitude = 20; _hapticsNotes[0].startingMagnitude = 0; _hapticsNotes[0].startTimeDuration = 0; _hapticsNotes[0].duration = 100; _hapticsNotes[0].endTimeDuration = 0; _hapticsNotes[0].endingMagnitude = 0; _hapticsNotes[0].style = Haptics.NoteStyle.Sharp; _hapticsNotes[0].period = 2; Haptics.PlayNotes(handle, 1, _hapticsNotes, false, null); })); t.Start(); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message, "Haptic.Soft"); } }
private async void CompletedStampToggleButton_Checked(object sender, RoutedEventArgs e) { await updateListedTaskFromCompletionResult(); if (PageStuff.navigating == false) { Haptics.ApplyCompletedStampHaptics(); SoundFX.PlayCompletedSound(); } }
private void GetController() { if (MLInput.IsStarted && connector?.ConnectedController != null) { Device = connector.ConnectedController; MLInput.OnControllerButtonDown += MLInput_OnControllerButtonDown; MLInput.OnControllerButtonUp += MLInput_OnControllerButtonUp; Haptics.SetController(Device); } }
public void OnDestroy() { if (IsConnected) { Haptics.SetController(null); CleanupConnector(false); MLInput.OnControllerButtonDown -= MLInput_OnControllerButtonDown; MLInput.OnControllerButtonUp -= MLInput_OnControllerButtonUp; Device = null; } }
private void AddTaskButton_Click(object sender, RoutedEventArgs e) { Haptics.ApplyAddTaskButtonPressHaptics(); Frame.ContentTransitions = new TransitionCollection(); var navThemeTransition = new NavigationThemeTransition { DefaultNavigationTransitionInfo = new EntranceNavigationTransitionInfo() }; Frame.ContentTransitions.Add(navThemeTransition); App.NavService.Navigate(typeof(CreateTaskPage)); }
void Start() { temp = null; hand = gameObject.GetComponent <Rigidbody> (); goingFast = false; previousPosition = gameObject.transform.position; if (SceneManager.GetActiveScene().name == "WackAMole") { molesScript = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GroundMoles> (); } haptics = GameObject.FindGameObjectWithTag("GameManager").GetComponent <Haptics> (); }
private void TimerHit(object state) { Haptics.HapticsNote[] _hapticsNotes = new Haptics.HapticsNote[1]; _hapticsNotes[0].magnitude = 20; _hapticsNotes[0].startingMagnitude = 0; _hapticsNotes[0].startTimeDuration = 0; _hapticsNotes[0].duration = 50; _hapticsNotes[0].endTimeDuration = 0; _hapticsNotes[0].endingMagnitude = 0; _hapticsNotes[0].style = Haptics.NoteStyle.Sharp; _hapticsNotes[0].period = 50; Haptics.PlayNotes(handle, 1, _hapticsNotes, false, null); }
public bool Play() { bool result = true; #if SAMSUNG m_hapticsNotes[0].magnitude = 255; SmiResultCode r = Haptics.PlayNotes(m_hapticsHandle, 1, m_hapticsNotes, false, m_defaultHapticsNotification); return(r == SmiResultCode.Success); #endif return(result); ////if (NativeMethods.VibratePlay(0, IntPtr.Zero, uint.MaxValue, uint.MaxValue) != 0) //if (NativeMethods.VibratePlay(0, IntPtr.Zero, 1, NativeMethods.INFINITE) != 0) //{ // return false; //} //return true; }
private void CompletedStampToggleButton_Click(object sender, RoutedEventArgs e) { UpdateUIAutomation(); if (TaskItem.IsCompleted == true) { Haptics.ApplyCompletedStampHaptics(); SoundFX.PlayCompletedSound(); } else { Haptics.ApplyEraseCompletedStampHaptics(); } if (TaskItem != null) { ToDoTask.AcknowledgeIsCompletedStateChange(this.TaskItem.IsCompleted); } else { Debug.WriteLine("Crash Prevented! - Value of TaskItem was null"); } }
private bool InitHaptics() { bool result = true; if (Haptics.Open(ref m_hapticsHandle) != SmiResultCode.Success) { result = false; } else { m_hapticsNotes = new Haptics.HapticsNote[1]; m_hapticsNotes[0].magnitude = 255; m_hapticsNotes[0].startingMagnitude = 0; m_hapticsNotes[0].endingMagnitude = 0; m_hapticsNotes[0].duration = 50; m_hapticsNotes[0].endTimeDuration = 0; m_hapticsNotes[0].startTimeDuration = 0; m_hapticsNotes[0].style = Haptics.NoteStyle.Sharp; m_hapticsNotes[0].period = 0; m_defaultHapticsNotification = DefaultNotification; } return(result); }
private void AppBarButton_Click(object sender, RoutedEventArgs e) { Haptics.ApplyEraseCompletedStampHaptics(); onScreenInput.TryHide(); CreateTaskButton.Focus(FocusState.Programmatic); }
void Awake() { Instance = this; }
private async void CompletedStampToggleButton_Unchecked(object sender, RoutedEventArgs e) { await updateListedTaskFromCompletionResult(); Haptics.ApplyEraseCompletedStampHaptics(); }