mirror of
https://github.com/FriendshipIsEpic/FiE-Game.git
synced 2025-02-18 11:24:22 +01:00
38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
using UnityEngine;
|
|
|
|
namespace UnityStandardAssets.CinematicEffects
|
|
{
|
|
public partial class AmbientOcclusion : MonoBehaviour
|
|
{
|
|
// Observer class that detects changes on properties
|
|
struct PropertyObserver
|
|
{
|
|
// AO properties
|
|
bool _downsampling;
|
|
bool _ambientOnly;
|
|
|
|
// Camera properties
|
|
int _pixelWidth;
|
|
int _pixelHeight;
|
|
|
|
// Check if it has to reset itself for property changes.
|
|
public bool CheckNeedsReset(Settings setting, Camera camera)
|
|
{
|
|
return
|
|
_downsampling != setting.downsampling ||
|
|
_ambientOnly != setting.ambientOnly ||
|
|
_pixelWidth != camera.pixelWidth ||
|
|
_pixelHeight != camera.pixelHeight;
|
|
}
|
|
|
|
// Update the internal state.
|
|
public void Update(Settings setting, Camera camera)
|
|
{
|
|
_downsampling = setting.downsampling;
|
|
_ambientOnly = setting.ambientOnly;
|
|
_pixelWidth = camera.pixelWidth;
|
|
_pixelHeight = camera.pixelHeight;
|
|
}
|
|
}
|
|
}
|
|
}
|