Esempio n. 1
0
        void LoadScene()
        {
            switch (feedback)
            {
            case Feedback.NotificationSuccess:
                TapticManager.Notification(NotificationFeedback.Success);
                break;

            case Feedback.NotificationWarning:
                TapticManager.Notification(NotificationFeedback.Warning);
                break;

            case Feedback.NorificationError:
                TapticManager.Notification(NotificationFeedback.Error);
                break;

            case Feedback.ImpactLight:
                TapticManager.Impact(ImpactFeedback.Light);
                break;

            case Feedback.ImpactMidium:
                TapticManager.Impact(ImpactFeedback.Midium);
                break;

            case Feedback.ImpactHeavy:
                TapticManager.Impact(ImpactFeedback.Heavy);
                break;

            case Feedback.Selection:
                TapticManager.Selection();
                break;
            }
        }
Esempio n. 2
0
        void OnCollisionEnter(Collision collision)
        {
            float volume = collision.relativeVelocity.magnitude;

            audioSource.PlayOneShot(se, volume);
            Debug.LogFormat("hit :{0}", volume);

            ImpactFeedback feedback;

            if (volume < 2)
            {
                feedback = ImpactFeedback.Light;
            }
            else if (volume < 5)
            {
                feedback = ImpactFeedback.Medium;
            }
            else
            {
                feedback = ImpactFeedback.Heavy;
            }
            TapticManager.Impact(feedback);
        }
Esempio n. 3
0
 public void OnImpactClick(int index)
 {
     TapticManager.Impact((ImpactFeedback)index);
     Debug.LogFormat("impact {0}", index);
 }