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); }
/// <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); }
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(); }
internal void SetProfileForScene(Scene scene, ProbeReferenceVolumeProfile profile) { if (sceneProfiles == null) { sceneProfiles = new Dictionary <string, ProbeReferenceVolumeProfile>(); } var sceneGUID = GetSceneGUID(scene); sceneProfiles[sceneGUID] = profile; }
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 }
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; }
internal void StoreProfileData(ProbeReferenceVolumeProfile profile) { cellSizeInBricks = profile.cellSizeInBricks; simplificationLevels = profile.simplificationLevels; minDistanceBetweenProbes = profile.minDistanceBetweenProbes; }