Example #1
0
    public GameObject GetAudioSource(bool instantiate = true)
    {
        VRSolution currentVRSolution = GetCurrentVRSolution();

        if (currentVRSolution != null && currentVRSolution._audioSourcePrefab != null)
        {
            if (instantiate)
            {
                return(UnityEngine.Object.Instantiate(currentVRSolution._audioSourcePrefab));
            }
            return(currentVRSolution._audioSourcePrefab);
        }
        return(null);
    }
Example #2
0
 private VRSolution GetCurrentVRSolution()
 {
     if (_vrPlatforms.ContainsKey(Application.platform))
     {
         VRSolution vRSolution = _vrPlatforms[Application.platform];
         if (vRSolution != null && vRSolution._audioSourcePrefab != null)
         {
             return(vRSolution);
         }
     }
     if (_defaultVRSolution < _vrSolutions.Count)
     {
         return(_vrSolutions[_defaultVRSolution]);
     }
     return(null);
 }