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

            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;
        }
 /// <summary>
 /// Determines if the Probe Reference Volume Profile is equivalent to another one.
 /// </summary>
 /// <param name ="otherProfile">The profile to compare with.</param>
 /// <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);
 }
Esempio n. 3
0
 /// <summary>
 /// Determines if the Probe Reference Volume Profile is equivalent to another one.
 /// </summary>
 /// <param name ="otherProfile">The profile to compare with.</param>
 /// <returns>Whether the Probe Reference Volume Profile is equivalent to another one.</returns>
 public bool IsEquivalent(ProbeReferenceVolumeProfile otherProfile)
 {
     return(minDistanceBetweenProbes == otherProfile.minDistanceBetweenProbes &&
            cellSize == otherProfile.cellSize &&
            maxSubdivision == otherProfile.maxSubdivision &&
            normalBias == otherProfile.normalBias);
 }
Esempio n. 4
0
 internal void SetProfileForScene(string sceneGUID, ProbeReferenceVolumeProfile profile)
 {
     if (sceneProfiles == null)
     {
         sceneProfiles = new Dictionary <string, ProbeReferenceVolumeProfile>();
     }
     sceneProfiles[sceneGUID] = profile;
 }
        private void Start()
        {
#if UNITY_EDITOR
            if (m_Profile == null)
            {
                m_Profile = CreateReferenceVolumeProfile(gameObject.scene, gameObject.name);
            }
#endif
            QueueAssetLoading();
        }
Esempio n. 6
0
        internal void SetProfileForScene(Scene scene, ProbeReferenceVolumeProfile profile)
        {
            if (sceneProfiles == null)
            {
                sceneProfiles = new Dictionary <string, ProbeReferenceVolumeProfile>();
            }

            var sceneGUID = GetSceneGUID(scene);

            sceneProfiles[sceneGUID] = profile;
        }
Esempio n. 7
0
        private void Start()
        {
#if UNITY_EDITOR
            if (m_Profile == null)
            {
                m_Profile = CreateReferenceVolumeProfile(gameObject.scene, gameObject.name);
            }

            CheckInit();
#else   // In player we load on start
            QueueAssetLoading();
#endif
        }
Esempio n. 8
0
        private void OnValidate()
        {
            if (!enabled || !gameObject.activeSelf)
            {
                return;
            }

            if (m_Profile != null)
            {
                m_PrevProfile = m_Profile;
                QueueAssetLoading();
            }

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

            m_PrevAsset = volumeAsset;
        }
Esempio n. 9
0
 internal void StoreProfileData(ProbeReferenceVolumeProfile profile)
 {
     cellSizeInBricks         = profile.cellSizeInBricks;
     simplificationLevels     = profile.simplificationLevels;
     minDistanceBetweenProbes = profile.minDistanceBetweenProbes;
 }