AfterInitialize调整

This commit is contained in:
SoulliesOfficial
2025-07-14 04:22:50 -04:00
parent 81ac6de8dc
commit 3eedadd139
20 changed files with 63720 additions and 16256 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 6dbdd314784e80440b48088e6357c1ef
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -149,6 +149,7 @@ namespace Ichni.RhythmGame
{
matchedElement = LookAt.GenerateElement(elementName, elementGuid, tags, false,
GetElement(attachedElementGuid), GetElement(lookAtObjectGuid), enabling.ConvertToGameType());
matchedElement.matchedBM = this;
}
public override GameElement DuplicateBM(GameElement parent)
@@ -156,6 +157,11 @@ namespace Ichni.RhythmGame
return LookAt.GenerateElement(elementName, Guid.NewGuid(), tags, false, parent,
GetElement(lookAtObjectGuid), enabling.ConvertToGameType());
}
public override void AfterExecute()
{
(matchedElement as LookAt).lookAtObject = GetElement(lookAtObjectGuid);
}
}
}
}

View File

@@ -52,19 +52,6 @@ namespace Ichni.RhythmGame
}
}
// public virtual void SetTimeDuration()
// {
//
// }
//
// public void ApplyTimeDuration()
// {
// childElementList.ForEach(x => x.ApplyTimeDuration());
// timeDurationSubmodule?.SetDurationFromChildren(
// childElementList.Select(x => x.timeDurationSubmodule).ToList());
// }
//
public interface IHaveInteraction
{
public void TriggerInteraction();
@@ -81,6 +68,15 @@ namespace Ichni.RhythmGame
/// 从存档类中生成游戏物体
/// </summary>
public abstract void ExecuteBM();
/// <summary>
/// 在AfterInitialize中被调用用于处理GameElement的“需要引用”的物体在此物体后面生成的情况。
/// 注意如果使用此函数需要在ExecuteBM中设置 matchedElement.matchedBM = this;
/// </summary>
public virtual void AfterExecute()
{
}
}
}
}

View File

@@ -60,15 +60,14 @@ namespace Ichni.RhythmGame
{
(EditorManager.instance.beatmapContainer).lowPriorityActions.Add(() =>
{
var a = effectBM.ConvertToGameType(attachedGameElement);
EffectBase a = effectBM.ConvertToGameType(attachedGameElement);
effectList.Add(a);
a.AccommodatingList = effectList;
});
}
else
{
var a = effectBM.ConvertToGameType(attachedGameElement);
EffectBase a = effectBM.ConvertToGameType(attachedGameElement);
effectList.Add(a);
a.AccommodatingList = effectList;
}

View File

@@ -93,20 +93,17 @@ namespace Ichni.RhythmGame
elementList.ForEach(element =>
{
//#if UNITY_EDITOR
if (element == null)
{
Debug.LogError("Null element detected in elementList. Skipping execution.");
return;
}
//Debug.Log(element.GetType());
if (LowPriorityGameElementTypes.Contains(element.GetType()))
{
return;
}
//#endif
if (element is GameElement_BM gameElement)
{
GameElement_BM.identifier.Add(gameElement.elementGuid, gameElement);
@@ -120,7 +117,6 @@ namespace Ichni.RhythmGame
if (element == null)
{
Debug.LogError("Null element detected in elementList during low-priority execution. Skipping execution.");
return;
}
@@ -129,7 +125,7 @@ namespace Ichni.RhythmGame
element.ExecuteBM();
}
});
EditorManager.instance.beatmapContainer.ExecuteLowPriorityActions();
}
}
@@ -138,7 +134,7 @@ namespace Ichni.RhythmGame
{
public static readonly List<Type> LowPriorityGameElementTypes = new()
{
typeof(NoteJudgeSubmodule_BM),
//typeof(NoteJudgeSubmodule_BM),
};
public static readonly List<Type> LowPriorityDataTypes = new()

View File

@@ -86,7 +86,7 @@ namespace Ichni.RhythmGame
/// </summary>
public virtual void AfterInitialize()
{
//SetEditorSubmodules();
matchedBM?.AfterExecute();
}
/// <summary>

View File

@@ -121,7 +121,6 @@ namespace Ichni
beatmapContainer.gameElementList.ForEach(gameElement =>
{
gameElement.AfterInitialize();
gameElement.Refresh();
});
}

View File

@@ -1861,6 +1861,9 @@
"value" : "7e1f2e2d-1e13-4ad9-b14f-1cca01476469"
}
}
],
"lowPriorityElementList" : [
],
"attachedElementGuid" : {
"value" : "00000000-0000-0000-0000-000000000000"

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -11,7 +11,7 @@ using Unity.Cinemachine;
using System;
// using Unity.Properties;
[CustomEditor(typeof(PostProcessingController))]
[CustomEditor(typeof(NBPostProcessingController))]
public class PostProcessingControllerGUI : Editor
{
private SerializedProperty _managerProperty;
@@ -21,7 +21,7 @@ public class PostProcessingControllerGUI : Editor
public override void OnInspectorGUI()
{
PostProcessingController ppController = (PostProcessingController)target;
NBPostProcessingController ppController = (NBPostProcessingController)target;
serializedObject.Update();
_managerProperty = serializedObject.FindProperty("_manager");
@@ -340,10 +340,10 @@ public class PostProcessingControllerGUI : Editor
if (isIndentBlock) EditorGUI.indentLevel--;
}
void ReflectMethod(string methodName,PostProcessingController controller)
void ReflectMethod(string methodName,NBPostProcessingController controller)
{
serializedObject.ApplyModifiedProperties();
MethodInfo privateMethod = typeof(PostProcessingController).GetMethod(methodName, BindingFlags.NonPublic | BindingFlags.Instance);
MethodInfo privateMethod = typeof(NBPostProcessingController).GetMethod(methodName, BindingFlags.NonPublic | BindingFlags.Instance);
if (privateMethod != null)
{
privateMethod.Invoke(controller, null);

View File

@@ -4,26 +4,26 @@ using UnityEngine;
using UnityEditor;
using System.Reflection;
[CustomEditor(typeof(PostProcessingManager))]
[CustomEditor(typeof(NBPostProcessingManager))]
public class PostProcessingManagerGUI : Editor
{
private PostProcessingManager _ppManager;
private NBPostProcessingManager _ppManager;
public override void OnInspectorGUI()
{
_ppManager = (PostProcessingManager)target;
_ppManager = (NBPostProcessingManager)target;
serializedObject.Update();
DrawToggle("controllerIndexFlags","_controllerIndexFlags");
DrawToggle("色散开关",PostProcessingManager.chromaticAberrationToggles);
DrawToggle("径向扭曲开关",PostProcessingManager.distortSpeedToggles);
DrawToggle("径向模糊开关",PostProcessingManager.radialBlurToggles);
DrawToggle("色散开关",NBPostProcessingManager.chromaticAberrationToggles);
DrawToggle("径向扭曲开关",NBPostProcessingManager.distortSpeedToggles);
DrawToggle("径向模糊开关",NBPostProcessingManager.radialBlurToggles);
#if CINIMACHINE_3_0
DrawToggle("震屏开关",PostProcessingManager.cameraShakeToggles);
#endif
DrawToggle("肌理开关",PostProcessingManager.overlayTextureToggles);
DrawToggle("黑白闪开关",PostProcessingManager.flashToggles);
DrawToggle("暗角开关",PostProcessingManager.vignetteToggles);
DrawToggle32("ShaderFlags", PostProcessingManager.material.GetInteger(NBPostProcessFlags.FlagsId));
DrawToggle("肌理开关",NBPostProcessingManager.overlayTextureToggles);
DrawToggle("黑白闪开关",NBPostProcessingManager.flashToggles);
DrawToggle("暗角开关",NBPostProcessingManager.vignetteToggles);
DrawToggle32("ShaderFlags", NBPostProcessingManager.material.GetInteger(NBPostProcessFlags.FlagsId));
}
@@ -51,7 +51,7 @@ public class PostProcessingManagerGUI : Editor
int ReflectIntValue(string propertyName)
{
FieldInfo privateField = typeof(PostProcessingManager).GetField(propertyName, BindingFlags.NonPublic | BindingFlags.Instance);
FieldInfo privateField = typeof(NBPostProcessingManager).GetField(propertyName, BindingFlags.NonPublic | BindingFlags.Instance);
if (privateField != null)
{

View File

@@ -118,7 +118,7 @@ namespace MhRender.RendererFeatures
// Shader shader = Shader.Find("XuanXuan/Postprocess/NBPostProcessUber");
NBPostProcessMaterial = CoreUtils.CreateEngineMaterial(Shader.Find("XuanXuan/Postprocess/NBPostProcessUber"));
PostProcessingManager.InitMat();
NBPostProcessingManager.InitMat();
// if (Application.isPlaying)
// {
@@ -439,7 +439,7 @@ namespace MhRender.RendererFeatures
public static Material _material;
public Mesh _fullScreenMesh;
public NBPostProcessFlags _shaderFlag => PostProcessingManager.flags;
public NBPostProcessFlags _shaderFlag => NBPostProcessingManager.flags;
private Vector4 _lastOutlineProps;
public Vector4 outLinePorps = Vector4.one;

View File

@@ -13,14 +13,14 @@ using UnityEditor;
[ExecuteInEditMode]
public class PostProcessingController : MonoBehaviour
public class NBPostProcessingController : MonoBehaviour
{
#if UNITY_EDITOR
public AnimBool[] AnimBools = new AnimBool[10];
#endif
// [ShowInInspector][ReadOnly]
[SerializeField]
private PostProcessingManager _manager;
//[SerializeField]
public NBPostProcessingManager _manager;
public int index
{
@@ -225,7 +225,7 @@ public class PostProcessingController : MonoBehaviour
return;
}
_manager = PostProcessingManager.Instance;
_manager = NBPostProcessingManager.Instance;
_manager.InitController(this);
InitAllSettings();
@@ -245,30 +245,30 @@ public class PostProcessingController : MonoBehaviour
void SetScreenCenterPos()
{
PostProcessingManager.customScreenCenterPos = customScreenCenterPos;
NBPostProcessingManager.customScreenCenterPos = customScreenCenterPos;
_lastCustomScreenCenterPos = customScreenCenterPos;
}
void SetUVFromDistort()
{
PostProcessingManager.isDistortScreenUVMode = distortScreenUVMode;
PostProcessingManager.isCaByDistort = caFromDistort;
PostProcessingManager.isRadialBlurByDistort = radialBlurFromDistort;
NBPostProcessingManager.isDistortScreenUVMode = distortScreenUVMode;
NBPostProcessingManager.isCaByDistort = caFromDistort;
NBPostProcessingManager.isRadialBlurByDistort = radialBlurFromDistort;
}
private void SetTexture()
{
if(PostProcessingManager.material == null) return;
if(NBPostProcessingManager.material == null) return;
if (distortSpeedToggle)
{
if (distortSpeedTexture != null)
{
PostProcessingManager.material.SetTexture(_distortSpeedTextureID, distortSpeedTexture);
PostProcessingManager.distortTextureMidValue = distortTextureMidValue;
NBPostProcessingManager.material.SetTexture(_distortSpeedTextureID, distortSpeedTexture);
NBPostProcessingManager.distortTextureMidValue = distortTextureMidValue;
}
else
{
PostProcessingManager.material.SetTexture(_distortSpeedTextureID, null);
NBPostProcessingManager.material.SetTexture(_distortSpeedTextureID, null);
}
}
@@ -276,34 +276,34 @@ public class PostProcessingController : MonoBehaviour
{
if (overlayTexturePolarCoordMode)
{
PostProcessingManager.flags.SetFlagBits(NBPostProcessFlags.FLAG_BIT_OVERLAYTEXTURE_POLLARCOORD);
NBPostProcessingManager.flags.SetFlagBits(NBPostProcessFlags.FLAG_BIT_OVERLAYTEXTURE_POLLARCOORD);
}
else
{
PostProcessingManager.flags.ClearFlagBits(NBPostProcessFlags.FLAG_BIT_OVERLAYTEXTURE_POLLARCOORD);
NBPostProcessingManager.flags.ClearFlagBits(NBPostProcessFlags.FLAG_BIT_OVERLAYTEXTURE_POLLARCOORD);
}
if (overlayTexture)
{
Debug.Log("SetOverlayTexture");
PostProcessingManager.material.SetTexture(_overlayTextureID,overlayTexture);
NBPostProcessingManager.material.SetTexture(_overlayTextureID,overlayTexture);
}
else
{
Debug.Log("ClearOverlayTexture");
PostProcessingManager.material.SetTexture(_overlayTextureID,null);
NBPostProcessingManager.material.SetTexture(_overlayTextureID,null);
}
if (overlayMaskTexture)
{
Debug.Log("SetOverlayMaskTexture");
PostProcessingManager.material.SetTexture(_textureOverlayMaskProperty,overlayMaskTexture);
PostProcessingManager.flags.SetFlagBits(NBPostProcessFlags.FLAG_BIT_OVERLAYTEXTURE_MASKMAP);
NBPostProcessingManager.material.SetTexture(_textureOverlayMaskProperty,overlayMaskTexture);
NBPostProcessingManager.flags.SetFlagBits(NBPostProcessFlags.FLAG_BIT_OVERLAYTEXTURE_MASKMAP);
}
else
{
Debug.Log("ClearOverlayMaskTexture");
PostProcessingManager.flags.ClearFlagBits(NBPostProcessFlags.FLAG_BIT_OVERLAYTEXTURE_MASKMAP);
NBPostProcessingManager.flags.ClearFlagBits(NBPostProcessFlags.FLAG_BIT_OVERLAYTEXTURE_MASKMAP);
}
}
@@ -311,15 +311,15 @@ public class PostProcessingController : MonoBehaviour
private void SetToggles()
{
SetBit(ref PostProcessingManager.chromaticAberrationToggles,index,chromaticAberrationToggle);
SetBit(ref PostProcessingManager.distortSpeedToggles,index,distortSpeedToggle);
SetBit(ref NBPostProcessingManager.chromaticAberrationToggles,index,chromaticAberrationToggle);
SetBit(ref NBPostProcessingManager.distortSpeedToggles,index,distortSpeedToggle);
#if CINIMACHINE_3_0
SetBit(ref PostProcessingManager.cameraShakeToggles,index,cameraShakeToggle);
#endif
SetBit(ref PostProcessingManager.overlayTextureToggles,index,overlayTextureToggle);
SetBit(ref PostProcessingManager.flashToggles,index,flashToggle);
SetBit(ref PostProcessingManager.radialBlurToggles,index,radialBlurToggle);
SetBit(ref PostProcessingManager.vignetteToggles,index,vignetteToggle);
SetBit(ref NBPostProcessingManager.overlayTextureToggles,index,overlayTextureToggle);
SetBit(ref NBPostProcessingManager.flashToggles,index,flashToggle);
SetBit(ref NBPostProcessingManager.radialBlurToggles,index,radialBlurToggle);
SetBit(ref NBPostProcessingManager.vignetteToggles,index,vignetteToggle);
#if UNITY_EDITOR
SetTexture();
@@ -329,15 +329,15 @@ public class PostProcessingController : MonoBehaviour
private void ClearToggles()
{
SetBit(ref PostProcessingManager.chromaticAberrationToggles,index,false);
SetBit(ref PostProcessingManager.distortSpeedToggles,index,false);
SetBit(ref NBPostProcessingManager.chromaticAberrationToggles,index,false);
SetBit(ref NBPostProcessingManager.distortSpeedToggles,index,false);
#if CINIMACHINE_3_0
SetBit(ref PostProcessingManager.cameraShakeToggles,index,false);
#endif
SetBit(ref PostProcessingManager.overlayTextureToggles,index,false);
SetBit(ref PostProcessingManager.flashToggles,index,false);
SetBit(ref PostProcessingManager.radialBlurToggles,index,false);
SetBit(ref PostProcessingManager.vignetteToggles,index,false);
SetBit(ref NBPostProcessingManager.overlayTextureToggles,index,false);
SetBit(ref NBPostProcessingManager.flashToggles,index,false);
SetBit(ref NBPostProcessingManager.radialBlurToggles,index,false);
SetBit(ref NBPostProcessingManager.vignetteToggles,index,false);
}
private bool _lastChormaticAberrationToggle = false;
@@ -455,7 +455,7 @@ public class PostProcessingController : MonoBehaviour
isFirstUpdate = false;
return;
}
if(!PostProcessingManager.material) return;
if(!NBPostProcessingManager.material) return;
//#if UNITY_EDITOR
//Odin的ToggleGroup和OnValueChange功能冲突导致不一定生效。不好调试。所以用手动的方式更新。
bool isToggleChanged = false;
@@ -482,35 +482,35 @@ public class PostProcessingController : MonoBehaviour
if (chromaticAberrationToggle)
{
PostProcessingManager.chromaticAberrationIntensity =
Mathf.Max(PostProcessingManager.chromaticAberrationIntensity, chromaticAberrationIntensity);
PostProcessingManager.chromaticAberrationPos =
Mathf.Max(PostProcessingManager.chromaticAberrationPos, chromaticAberrationPos);
PostProcessingManager.chromaticAberrationRange =
Mathf.Max(PostProcessingManager.chromaticAberrationRange, chromaticAberrationRange);
NBPostProcessingManager.chromaticAberrationIntensity =
Mathf.Max(NBPostProcessingManager.chromaticAberrationIntensity, chromaticAberrationIntensity);
NBPostProcessingManager.chromaticAberrationPos =
Mathf.Max(NBPostProcessingManager.chromaticAberrationPos, chromaticAberrationPos);
NBPostProcessingManager.chromaticAberrationRange =
Mathf.Max(NBPostProcessingManager.chromaticAberrationRange, chromaticAberrationRange);
}
if (distortSpeedToggle)
{
if (index == PostProcessingManager.laseUpdateControllerIndex)
if (index == NBPostProcessingManager.laseUpdateControllerIndex)
{
//只有这里才会更新Scale
PostProcessingManager.material.SetVector(_distortSpeedTextureStID, distortSpeedTexSt);
NBPostProcessingManager.material.SetVector(_distortSpeedTextureStID, distortSpeedTexSt);
}
PostProcessingManager.distortSpeedIntensity =
Mathf.Max(PostProcessingManager.distortSpeedIntensity, distortSpeedIntensity);
PostProcessingManager.distortSpeedPosition =
Mathf.Max(PostProcessingManager.distortSpeedPosition, distortSpeedPosition);
PostProcessingManager.distortSpeedRange =
Mathf.Max(PostProcessingManager.distortSpeedRange, distortSpeedRange);
PostProcessingManager.distortSpeedMoveSpeedX =
Mathf.Abs(PostProcessingManager.distortSpeedMoveSpeedX) > Mathf.Abs(distortSpeedMoveSpeedX)
? PostProcessingManager.distortSpeedMoveSpeedX
NBPostProcessingManager.distortSpeedIntensity =
Mathf.Max(NBPostProcessingManager.distortSpeedIntensity, distortSpeedIntensity);
NBPostProcessingManager.distortSpeedPosition =
Mathf.Max(NBPostProcessingManager.distortSpeedPosition, distortSpeedPosition);
NBPostProcessingManager.distortSpeedRange =
Mathf.Max(NBPostProcessingManager.distortSpeedRange, distortSpeedRange);
NBPostProcessingManager.distortSpeedMoveSpeedX =
Mathf.Abs(NBPostProcessingManager.distortSpeedMoveSpeedX) > Mathf.Abs(distortSpeedMoveSpeedX)
? NBPostProcessingManager.distortSpeedMoveSpeedX
: distortSpeedMoveSpeedX;
PostProcessingManager.distortSpeedMoveSpeedY =
Mathf.Abs(PostProcessingManager.distortSpeedMoveSpeedY) > Mathf.Abs(distortSpeedMoveSpeed)
? PostProcessingManager.distortSpeedMoveSpeedY
NBPostProcessingManager.distortSpeedMoveSpeedY =
Mathf.Abs(NBPostProcessingManager.distortSpeedMoveSpeedY) > Mathf.Abs(distortSpeedMoveSpeed)
? NBPostProcessingManager.distortSpeedMoveSpeedY
: distortSpeedMoveSpeed;
}
@@ -525,47 +525,47 @@ public class PostProcessingController : MonoBehaviour
if (overlayTextureToggle)
{
if (index == PostProcessingManager.laseUpdateControllerIndex)
if (index == NBPostProcessingManager.laseUpdateControllerIndex)
{
PostProcessingManager.material.SetVector(_overlayTextureStID, overlayTextureSt);
PostProcessingManager.material.SetVector(_textureOverlayMaskStProperty, overlayMaskTextureSt);
PostProcessingManager.material.SetVector(_textureOverlayAnimProperty,overlayTextureAnim);
NBPostProcessingManager.material.SetVector(_overlayTextureStID, overlayTextureSt);
NBPostProcessingManager.material.SetVector(_textureOverlayMaskStProperty, overlayMaskTextureSt);
NBPostProcessingManager.material.SetVector(_textureOverlayAnimProperty,overlayTextureAnim);
}
PostProcessingManager.overlayTextureIntensity = Mathf.Max(PostProcessingManager.overlayTextureIntensity,
NBPostProcessingManager.overlayTextureIntensity = Mathf.Max(NBPostProcessingManager.overlayTextureIntensity,
overlayTextureIntensity);
}
if (flashToggle)
{
PostProcessingManager.flashDesaturateIntensity =
Mathf.Max(PostProcessingManager.flashDesaturateIntensity, flashDeSaturateIntensity);
PostProcessingManager.flashInvertIntensity =
Mathf.Max(PostProcessingManager.flashInvertIntensity, flashInvertIntensity);
PostProcessingManager.flashContrast =
Mathf.Max(PostProcessingManager.flashContrast, flashContrast);
PostProcessingManager.flashColor = flashColor;
NBPostProcessingManager.flashDesaturateIntensity =
Mathf.Max(NBPostProcessingManager.flashDesaturateIntensity, flashDeSaturateIntensity);
NBPostProcessingManager.flashInvertIntensity =
Mathf.Max(NBPostProcessingManager.flashInvertIntensity, flashInvertIntensity);
NBPostProcessingManager.flashContrast =
Mathf.Max(NBPostProcessingManager.flashContrast, flashContrast);
NBPostProcessingManager.flashColor = flashColor;
}
if (radialBlurToggle)
{
PostProcessingManager.radialBlurIntensity =
Mathf.Max(PostProcessingManager.radialBlurIntensity, radialBlurIntensity);
PostProcessingManager.radialBlurSampleCount = Mathf.Max(PostProcessingManager.radialBlurSampleCount,
NBPostProcessingManager.radialBlurIntensity =
Mathf.Max(NBPostProcessingManager.radialBlurIntensity, radialBlurIntensity);
NBPostProcessingManager.radialBlurSampleCount = Mathf.Max(NBPostProcessingManager.radialBlurSampleCount,
radialBlurSampleCount);
PostProcessingManager.radialBlurPos = Mathf.Max(PostProcessingManager.radialBlurPos, radialBlurPos);
PostProcessingManager.radialBlurRange = Mathf.Max(PostProcessingManager.radialBlurRange, radialBlurRange);
NBPostProcessingManager.radialBlurPos = Mathf.Max(NBPostProcessingManager.radialBlurPos, radialBlurPos);
NBPostProcessingManager.radialBlurRange = Mathf.Max(NBPostProcessingManager.radialBlurRange, radialBlurRange);
}
if (vignetteToggle)
{
PostProcessingManager.vignetteIntensity =
Mathf.Max(PostProcessingManager.vignetteIntensity, vignetteIntensity);
PostProcessingManager.vignetteRoundness = Mathf.Max(PostProcessingManager.vignetteRoundness, vignetteRoundness);
PostProcessingManager.vignetteSmothness = Mathf.Max(PostProcessingManager.vignetteSmothness, vignetteSmothness);
if (index == PostProcessingManager.laseUpdateControllerIndex)
NBPostProcessingManager.vignetteIntensity =
Mathf.Max(NBPostProcessingManager.vignetteIntensity, vignetteIntensity);
NBPostProcessingManager.vignetteRoundness = Mathf.Max(NBPostProcessingManager.vignetteRoundness, vignetteRoundness);
NBPostProcessingManager.vignetteSmothness = Mathf.Max(NBPostProcessingManager.vignetteSmothness, vignetteSmothness);
if (index == NBPostProcessingManager.laseUpdateControllerIndex)
{
PostProcessingManager.material.SetColor(_vignetteColorID,vignetteColor);
NBPostProcessingManager.material.SetColor(_vignetteColorID,vignetteColor);
}
}
@@ -586,7 +586,7 @@ public class PostProcessingController : MonoBehaviour
{
GameObject Effect = new GameObject();
Effect.name = "NBPostprocessController";
PostProcessingController controller = Effect.AddComponent<PostProcessingController>();
NBPostProcessingController controller = Effect.AddComponent<NBPostProcessingController>();
UnityEditor.Selection.activeObject = Effect;
}

View File

@@ -17,26 +17,26 @@ using MhRender.RendererFeatures;
[ExecuteAlways]
public class PostProcessingManager : MonoBehaviour
public class NBPostProcessingManager : MonoBehaviour
{
//单例实现
private static PostProcessingManager _instance = null;
private static NBPostProcessingManager _instance = null;
public static PostProcessingManager Instance
public static NBPostProcessingManager Instance
{
get
{
if (_instance == null)
{
#if UNITY_2022_1_OR_NEWER
_instance = FindFirstObjectByType<PostProcessingManager>();
_instance = FindFirstObjectByType<NBPostProcessingManager>();
#else
_instance = FindObjectOfType<PostProcessingManager>();
#endif
if (_instance == null)
{
GameObject singletonObj = new GameObject();
_instance = singletonObj.AddComponent<PostProcessingManager>();
_instance = singletonObj.AddComponent<NBPostProcessingManager>();
if (Application.isPlaying)
{
singletonObj.name = "NBPostProcessManager";
@@ -62,7 +62,7 @@ public class PostProcessingManager : MonoBehaviour
}
else
{
DestroyImmediate(this);
//DestroyImmediate(this);
}
}
@@ -88,7 +88,7 @@ public class PostProcessingManager : MonoBehaviour
public static void InitMat()
{
flags.SetMaterial(PostProcessingManager.material);
flags.SetMaterial(NBPostProcessingManager.material);
if (_instance)
{
_instance.ResetEffect();
@@ -197,7 +197,7 @@ public class PostProcessingManager : MonoBehaviour
return count;
}
//每次Controller触发Play都会触发Init
public void InitController(PostProcessingController controller)
public void InitController(NBPostProcessingController controller)
{
#if CINIMACHINE_3_0
if (controller.cinemachineCamera != null)
@@ -210,7 +210,7 @@ public class PostProcessingManager : MonoBehaviour
controller.SetIndex(GetControllerIndex());
}
public void EndController(PostProcessingController controller)
public void EndController(NBPostProcessingController controller)
{
#if CINIMACHINE_3_0
if (currentVirtualCamera == controller.cinemachineCamera)