Esempio n. 1
0
        public float PlayAction(Interaction action, Transform pose, AbstractHapticDevice haptics, bool randomizePitch)
        {
            if (action == Interaction.None)
            {
                return(0);
            }
            else
            {
                if (haptics != null)
                {
                    var expr = GetHapticExpressions(action);
                    if (expr != HapticExpression.None)
                    {
                        haptics.Play(expr);
                    }
                }

#if UNITY_MODULES_AUDIO
                var clips           = GetClipCollection(action);
                var reallyRandomize = randomizePitch && clips?.RandomizeClipPitch == true;
                var clip            = clips?.Random();
                if (clip != null)
                {
                    return(PlayAudioClip(clip, pose, reallyRandomize));
                }
#endif
                return(0);
            }
        }
Esempio n. 2
0
 public float PlayAction(Interaction action, AbstractHapticDevice haptics)
 {
     return(PlayAction(action, camT, haptics, false));
 }
Esempio n. 3
0
 public float PlayAction(Interaction action, AbstractHapticDevice haptics, bool randomizePitch)
 {
     return(PlayAction(action, camT, haptics, randomizePitch));
 }
Esempio n. 4
0
 public float PlayAction(Interaction action, Transform pose, AbstractHapticDevice haptics)
 {
     return(PlayAction(action, pose, haptics, false));
 }