private void OnValidate()
        {
            if (!enabled || !gameObject.activeSelf)
            {
                return;
            }

            if (ShaderConfig.s_EnableProbeVolumes == 1)
            {
                if (m_Profile != null)
                {
                    bool hasIndexDimensionChangedOnProfileSwitch = m_PrevProfile == null || (m_PrevProfile != null && m_PrevProfile.indexDimensions != m_Profile.indexDimensions);
                    if (hasIndexDimensionChangedOnProfileSwitch)
                    {
                        var refVol = ProbeReferenceVolume.instance;
                        refVol.AddPendingIndexDimensionChange(indexDimensions);
                    }

                    m_PrevProfile = m_Profile;
                    QueueAssetLoading();
                }

                if (volumeAsset != m_PrevAsset && m_PrevAsset != null)
                {
                    ProbeReferenceVolume.instance.AddPendingAssetRemoval(m_PrevAsset);
                }

                m_PrevAsset = volumeAsset;
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Determines if the Probe Reference Volume Profile is equivalent to another one.
 /// </summary>
 /// <returns>Whether the Probe Reference Volume Profile is equivalent to another one.</returns>
 public bool IsEquivalent(ProbeReferenceVolumeProfile otherProfile)
 {
     return(brickSize == otherProfile.brickSize &&
            cellSize == otherProfile.cellSize &&
            maxSubdivision == otherProfile.maxSubdivision &&
            normalBias == otherProfile.normalBias);
 }
        private void Start()
        {
            if (ShaderConfig.s_EnableProbeVolumes == 1 && m_Profile == null)
            {
                m_Profile = CreateReferenceVolumeProfile(gameObject.scene, gameObject.name);
            }

            CheckInit();
        }