后处理+FEEL完全改进
This commit is contained in:
19
Assets/Scripts/MainGame/Effects/DamageNumberText.cs
Normal file
19
Assets/Scripts/MainGame/Effects/DamageNumberText.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using DamageNumbersPro;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Cielonos.MainGame
|
||||
{
|
||||
public class DamageNumberText : MonoBehaviour
|
||||
{
|
||||
public DamageNumber main;
|
||||
}
|
||||
|
||||
public static class DamageNumberTextExtensions
|
||||
{
|
||||
public static DamageNumberText Spawn(this DamageNumberText prefab)
|
||||
{
|
||||
prefab.main.Spawn();
|
||||
return prefab;
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/MainGame/Effects/DamageNumberText.cs.meta
Normal file
2
Assets/Scripts/MainGame/Effects/DamageNumberText.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 39efce2b6a5b2b74e9f95573a238547c
|
||||
@@ -1,30 +0,0 @@
|
||||
using SLSFramework.General;
|
||||
using Beautify.Universal;
|
||||
|
||||
namespace Cielonos.MainGame.Effects
|
||||
{
|
||||
public partial class ChromaticAberrationSubmodule : PostProcessingSubmoduleBase
|
||||
{
|
||||
public LerpFloat intensity;
|
||||
|
||||
public ChromaticAberrationSubmodule(PostProcessingManager owner) : base(owner)
|
||||
{
|
||||
this.intensity = new LerpFloat(0, 0.05f);
|
||||
}
|
||||
|
||||
public override void Update(float factor)
|
||||
{
|
||||
intensity.Update(factor);
|
||||
if (owner.GetVolumeComponent<Beautify.Universal.Beautify>(out var beautify))
|
||||
{
|
||||
beautify.chromaticAberrationIntensity.value = intensity.currentValue * 0.1f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public partial class ChromaticAberrationSubmodule
|
||||
{
|
||||
public void ModifyIntensity(float value) => ModifyCurrentValue(intensity, value);
|
||||
public void SetIntensity(float value) => SetCurrentValue(intensity, value);
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4c4d822e0b008874595c833896ced6b8
|
||||
@@ -1,51 +0,0 @@
|
||||
using SLSFramework.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Cielonos.MainGame.Effects
|
||||
{
|
||||
public partial class TonemappingSubmodule : PostProcessingSubmoduleBase
|
||||
{
|
||||
public LerpFloat saturate;
|
||||
public LerpFloat contrast;
|
||||
public LerpFloat brightness;
|
||||
public LerpColor tintColor;
|
||||
|
||||
public TonemappingSubmodule(PostProcessingManager owner) : base(owner)
|
||||
{
|
||||
this.saturate = new LerpFloat(1.2f, 0.05f);
|
||||
this.brightness = new LerpFloat(1f, 0.05f);
|
||||
this.contrast = new LerpFloat(1.15f, 0.05f);
|
||||
this.tintColor = new LerpColor(new Color(0.9411765f, 1, 1), 0.05f);
|
||||
}
|
||||
|
||||
public override void Update(float factor)
|
||||
{
|
||||
saturate.Update(factor);
|
||||
brightness.Update(factor);
|
||||
contrast.Update(factor);
|
||||
tintColor.Update(factor);
|
||||
if(owner.GetVolumeComponent<Beautify.Universal.Beautify>(out var beautify))
|
||||
{
|
||||
beautify.saturate.value = saturate.currentValue;
|
||||
beautify.brightness.value = brightness.currentValue;
|
||||
beautify.contrast.value = contrast.currentValue;
|
||||
beautify.tintColor.value = tintColor.currentValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public partial class TonemappingSubmodule
|
||||
{
|
||||
public void ModifySaturate(float value) => ModifyCurrentValue(saturate, value);
|
||||
public void SetSaturate(float value) => SetCurrentValue(saturate, value);
|
||||
|
||||
public void ModifyBrightness(float value) => ModifyCurrentValue(brightness, value);
|
||||
public void SetBrightness(float value) => SetCurrentValue(brightness, value);
|
||||
|
||||
public void ModifyContrast(float value) => ModifyCurrentValue(contrast, value);
|
||||
public void SetContrast(float value) => SetCurrentValue(contrast, value);
|
||||
|
||||
public void ModifyTintColor(Color value) => ModifyCurrentValue(tintColor, value);
|
||||
public void SetTintColor(Color value) => SetCurrentValue(tintColor, value);
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b40b17602d6f8fe4f86ca42ae86514e4
|
||||
@@ -15,9 +15,7 @@ namespace Cielonos
|
||||
|
||||
public RadialBlurSubmodule radialBlurSm;
|
||||
public SpeedLinesSubmodule speedLinesSm;
|
||||
public ChromaticAberrationSubmodule chromaticAberrationSm;
|
||||
public RGBSplitGlitchSubmodule rgbSplitGlitchSm;
|
||||
public TonemappingSubmodule tonemappingSm;
|
||||
|
||||
[Tooltip("主要的后处理 Volume")]
|
||||
[SerializeField]
|
||||
@@ -32,9 +30,7 @@ namespace Cielonos
|
||||
base.Awake();
|
||||
radialBlurSm = new RadialBlurSubmodule(this);
|
||||
speedLinesSm = new SpeedLinesSubmodule(this);
|
||||
chromaticAberrationSm = new ChromaticAberrationSubmodule(this);
|
||||
rgbSplitGlitchSm = new RGBSplitGlitchSubmodule(this);
|
||||
tonemappingSm = new TonemappingSubmodule(this);
|
||||
if (volume != null)
|
||||
{
|
||||
profile = volume.profile;
|
||||
@@ -48,11 +44,11 @@ namespace Cielonos
|
||||
|
||||
private void Update()
|
||||
{
|
||||
radialBlurSm.Update(MainGameManager.PlayerTimeScale);
|
||||
speedLinesSm.Update(MainGameManager.PlayerTimeScale);
|
||||
rgbSplitGlitchSm.Update(MainGameManager.PlayerTimeScale);
|
||||
chromaticAberrationSm.Update(MainGameManager.PlayerTimeScale);
|
||||
tonemappingSm.Update(MainGameManager.PlayerTimeScale);
|
||||
//radialBlurSm.Update(MainGameManager.PlayerTimeScale);
|
||||
speedLinesSm.Update(MainGameManager.Player.selfTimeSm.TimeScale);
|
||||
//rgbSplitGlitchSm.Update(MainGameManager.PlayerTimeScale);
|
||||
//chromaticAberrationSm.Update(MainGameManager.PlayerTimeScale);
|
||||
//tonemappingSm.Update(MainGameManager.PlayerTimeScale);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -13,10 +13,11 @@ namespace Cielonos.MainGame
|
||||
[NonSerialized]
|
||||
public CharacterBase creator;
|
||||
|
||||
public bool affectedByCreatorTimeScale = true;
|
||||
|
||||
public List<ParticleSystem> particles = new List<ParticleSystem>();
|
||||
|
||||
[NonSerialized]
|
||||
public List<ParticleSystem.MainModule> particleMainModules = new List<ParticleSystem.MainModule>();
|
||||
[NonSerialized] private List<ParticleSystem.MainModule> particleMainModules;
|
||||
|
||||
public static GameObject Spawn(GameObject vfxPrefab, CharacterBase creator, Transform parent = null)
|
||||
{
|
||||
@@ -45,10 +46,14 @@ namespace Cielonos.MainGame
|
||||
}
|
||||
|
||||
base.OnSpawn();
|
||||
particleMainModules = new List<ParticleSystem.MainModule>();
|
||||
foreach (var ps in particles)
|
||||
|
||||
if (particleMainModules == null)
|
||||
{
|
||||
particleMainModules.Add(ps.main);
|
||||
particleMainModules = new List<ParticleSystem.MainModule>();
|
||||
foreach (var ps in particles)
|
||||
{
|
||||
particleMainModules.Add(ps.main);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,22 +68,25 @@ namespace Cielonos.MainGame
|
||||
particles.Add(ps);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
float deltaTime = Time.deltaTime;
|
||||
float timeScale = 1f;
|
||||
|
||||
|
||||
if (creator != null)
|
||||
{
|
||||
deltaTime = creator.selfTimeSm.DeltaTime;
|
||||
timeScale = creator.selfTimeSm.timeScaleCoefficient.Value;
|
||||
timeScale = creator.selfTimeSm.TimeScale;
|
||||
}
|
||||
|
||||
|
||||
UpdateTimer(deltaTime);
|
||||
particleMainModules.ForEach(main => main.simulationSpeed = timeScale);
|
||||
if (affectedByCreatorTimeScale)
|
||||
{
|
||||
particleMainModules.ForEach(main => main.simulationSpeed = timeScale);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetCreator(CharacterBase character)
|
||||
{
|
||||
creator = character;
|
||||
|
||||
Reference in New Issue
Block a user