示例#1
0
    // Token: 0x060063E4 RID: 25572 RVA: 0x00237354 File Offset: 0x00235754
    private void Start()
    {
        VRCAudioManager.ApplyGameAudioMixerSettings(base.GetComponent <AudioSource>());
        AudioSource component = base.GetComponent <AudioSource>();

        this.SetParameters(ref component);
    }
示例#2
0
    /// <summary>
    /// Start this instance.
    /// </summary>
    void Start()
    {
#if VRC_CLIENT
        VRCAudioManager.ApplyGameAudioMixerSettings(GetComponent <AudioSource>());
#endif

        // jnuccio: moved SetParameters() call here from Awake
        // We might iterate through multiple sources / game object
        var source = GetComponent <AudioSource>();
        SetParameters(ref source);
    }
示例#3
0
    /// <summary>
    /// Start this instance.
    /// </summary>
    void Start()
    {
#if VRC_CLIENT
        var source = GetComponent <AudioSource>();

        if (source != null && source.outputAudioMixerGroup != VRCAudioManager.GetAvatarGroup())
        {
            VRCAudioManager.ApplyGameAudioMixerSettings(source);
        }
#endif
    }
示例#4
0
    // Token: 0x06005BD5 RID: 23509 RVA: 0x00200B3C File Offset: 0x001FEF3C
    public IEnumerator ProcessSceneObjects(Action onDone)
    {
        List <Transform> rootTransforms = new List <Transform>();

        Transform[] allTransforms = Tools.FindSceneObjectsOfTypeAll <Transform>();
        foreach (Transform item in from t in allTransforms
                 where t != null && t.parent == null && t.gameObject != null && !t.gameObject.CompareTag("VRCGlobalRoot")
                 select t)
        {
            rootTransforms.Add(item);
        }
        yield return(null);

        if (!this.sceneDescriptor.useAssignedLayers)
        {
            foreach (Transform transform in rootTransforms)
            {
                try
                {
                    Tools.SetLayerRecursively(transform.gameObject, LayerMask.NameToLayer("Environment"), LayerMask.NameToLayer("Interactive"));
                }
                catch (Exception exception)
                {
                    Debug.LogException(exception, transform.gameObject);
                }
            }
        }
        else
        {
            Debug.Log("This level has elected to use it's own Unity Layers. If things like physics and collision are messed up, this is a likely reason.");
        }
        yield return(null);

        Physics.gravity = this.sceneDescriptor.gravity;
        Debug.Log("<color=yellow>Loading scene's render settings.</color>");
        if (this.sceneDescriptor.layerCollisionArr != null)
        {
            bool[,] array = Tools.OneDArrayToTwoDArray <bool>(this.sceneDescriptor.layerCollisionArr, 32, 32);
            int numReservedLayers = Tools.GetNumReservedLayers();
            for (int i = 0; i < 32; i++)
            {
                for (int j = 0; j < 32; j++)
                {
                    if (i >= numReservedLayers || j >= numReservedLayers)
                    {
                        bool ignore = !array[i, j];
                        if (i == LayerMask.NameToLayer("UI") || i == LayerMask.NameToLayer("UiMenu") || i == LayerMask.NameToLayer("StereoLeft") || i == LayerMask.NameToLayer("StereoRight") || j == LayerMask.NameToLayer("UI") || j == LayerMask.NameToLayer("UiMenu") || j == LayerMask.NameToLayer("StereoLeft") || j == LayerMask.NameToLayer("StereoRight"))
                        {
                            ignore = true;
                        }
                        Physics.IgnoreLayerCollision(i, j, ignore);
                    }
                }
            }
        }
        yield return(null);

        VRC_SpecialLayer[] layers = Tools.FindSceneObjectsOfTypeAll <VRC_SpecialLayer>();
        foreach (VRC_SpecialLayer vrc_SpecialLayer in from l in layers
                 where l != null && !l.transform.root.gameObject.CompareTag("VRCGlobalRoot")
                 select l)
        {
            try
            {
                vrc_SpecialLayer.Apply();
            }
            catch (Exception exception2)
            {
                Debug.LogException(exception2, vrc_SpecialLayer.gameObject);
            }
        }
        yield return(null);

        VRCAudioManager.DisableAllExtraAudioListeners();
        yield return(null);

        AudioSource[] audioSources = Tools.FindSceneObjectsOfTypeAll <AudioSource>();
        foreach (AudioSource audioSource in audioSources)
        {
            VRCAudioManager.ApplyGameAudioMixerSettings(audioSource);
        }
        yield return(null);

        if (this.sceneDescriptor.autoSpatializeAudioSources)
        {
            Debug.Log("Auto spatializing AudioSources...");
            try
            {
                AddONSPAudioSourceComponent.ApplyDefaultSpatializationToAudioSources();
            }
            catch (Exception exception3)
            {
                Debug.LogException(exception3, this.sceneDescriptor.gameObject);
            }
        }
        yield return(null);

        onDone();
        yield break;
    }