与编辑器同步,增加sync优化bloom,添加打包时自动打包主题包的特性
(怎么这么多meta文件啊) Signed-off-by: TRADER_FOER <lhf190@outlook.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using SLSUtilities.Rendering.PostProcessing;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
|
||||
@@ -10,11 +11,13 @@ namespace Ichni.RhythmGame
|
||||
public float peak;
|
||||
public AnimationCurve intensityCurve;
|
||||
|
||||
private Bloom _bloom;
|
||||
private AnimeBloom _bloom;
|
||||
private static float _bloomBasicValue = -1;
|
||||
|
||||
#endregion
|
||||
|
||||
#region [初始化] Initialization
|
||||
public BloomEffect(float effectTime, float peak, AnimationCurve intensityCurve)
|
||||
public BloomEffect(float effectTime, float peak, AnimationCurve intensityCurve)
|
||||
: base(effectTime) // 激活时间线
|
||||
{
|
||||
this.effectTime = effectTime;
|
||||
@@ -28,6 +31,10 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
PostProcessingManager.GlobalVolume.profile.TryGet(out _bloom);
|
||||
}
|
||||
if (_bloomBasicValue < 0 && _bloom != null)
|
||||
{
|
||||
_bloomBasicValue = _bloom.intensity.value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -42,7 +49,7 @@ namespace Ichni.RhythmGame
|
||||
if (_bloom != null)
|
||||
{
|
||||
float currentIntensity = intensityCurve.Evaluate(effectProgressPercent) * peak;
|
||||
_bloom.intensity.value = currentIntensity;
|
||||
_bloom.intensity.value = _bloomBasicValue + currentIntensity;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +59,7 @@ namespace Ichni.RhythmGame
|
||||
|
||||
private void ResetEffect()
|
||||
{
|
||||
if (_bloom != null) _bloom.intensity.value = 0f;
|
||||
if (_bloom != null) _bloom.intensity.value = _bloomBasicValue;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace Ichni.RhythmGame
|
||||
}
|
||||
|
||||
protected void SetEnableEmission() => meshRenderer.material.SetInt("_EnableEmission", enableEmission ? 1 : 0);
|
||||
protected void SetEnableZWrite() => meshRenderer.material.SetInt("_ZWrite", zWrite ? 1 : 0);
|
||||
protected void SetEnableZWrite() => meshRenderer.material.SetFloat("_ZWrite", zWrite ? 1 : 0);
|
||||
protected void SetEmissionIntensity() => meshRenderer.material.SetColor("_EmissionColor", Color.white * Mathf.Pow(2, emissionIntensity));
|
||||
protected void SetUV()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user