您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
35 行
1.4 KiB
35 行
1.4 KiB
|
|
namespace Cinemachine.PostFX
|
|
{
|
|
/// <summary>Integrates Cinemachine with PostProcessing V1 stack.</summary>
|
|
/// Since PostPorcessing V1 does not create a define in Player settings the
|
|
/// way V2 does, we do it ourselves if we detect the presence of PostProcessing V1
|
|
class PostFXAutoImport
|
|
{
|
|
[UnityEditor.InitializeOnLoad]
|
|
class EditorInitialize
|
|
{
|
|
static EditorInitialize()
|
|
{
|
|
#if UNITY_POST_PROCESSING_STACK_V2
|
|
// We have PPv2
|
|
CinemachinePostProcessing.InitializeModule();
|
|
#else
|
|
// Check for PostProcessing V1. Define symbol if we have it.
|
|
if (Cinemachine.Utility.ReflectionHelpers.TypeIsDefined("UnityEngine.PostProcessing.PostProcessingBehaviour"))
|
|
{
|
|
if (Cinemachine.Editor.ScriptableObjectUtility.AddDefineForAllBuildTargets("UNITY_POST_PROCESSING_STACK_V1"))
|
|
{
|
|
string path = Cinemachine.Editor.ScriptableObjectUtility.CinemachineInstallAssetPath + "/PostFX/CinemachinePostFX.cs";
|
|
UnityEditor.AssetDatabase.ImportAsset(path, UnityEditor.ImportAssetOptions.ForceUpdate);
|
|
}
|
|
}
|
|
#if UNITY_POST_PROCESSING_STACK_V1
|
|
// We have PPv1
|
|
CinemachinePostFX.InitializeModule();
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
}
|
|
}
|