列表输入二级界面扩展List<float>,特效单元扩展
This commit is contained in:
@@ -10,63 +10,63 @@ using Sirenix.OdinInspector;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public class BloomShake : EffectBase
|
||||
public class BloomEffect : EffectBase
|
||||
{
|
||||
public float bloomTime;
|
||||
public float bloomPeak;
|
||||
public float duration;
|
||||
public float peak;
|
||||
|
||||
public BloomShake(float bloomTime, float bloomPeak)
|
||||
public BloomEffect(float duration, float peak)
|
||||
{
|
||||
this.effectTime = 0;
|
||||
this.bloomTime = bloomTime;
|
||||
this.bloomPeak = bloomPeak;
|
||||
this.duration = duration;
|
||||
this.peak = peak;
|
||||
}
|
||||
|
||||
public override void Adjust()
|
||||
{
|
||||
MMF_Player effect = LeanPool.Spawn(EditorManager.instance.basePrefabs.bloomShake).GetComponent<MMF_Player>();
|
||||
effect.GetFeedbackOfType<MMF_Bloom_URP>().ShakeDuration = bloomTime;
|
||||
effect.GetFeedbackOfType<MMF_Bloom_URP>().RemapIntensityOne = bloomPeak;
|
||||
MMF_Player effect = LeanPool.Spawn(EditorManager.instance.basePrefabs.bloomEffect).GetComponent<MMF_Player>();
|
||||
effect.GetFeedbackOfType<MMF_Bloom_URP>().ShakeDuration = duration;
|
||||
effect.GetFeedbackOfType<MMF_Bloom_URP>().RemapIntensityOne = peak;
|
||||
effect.PlayFeedbacks();
|
||||
LeanPool.Despawn(effect.gameObject, bloomTime);
|
||||
LeanPool.Despawn(effect.gameObject, duration);
|
||||
}
|
||||
|
||||
public override EffectBase_BM ConvertToBM()
|
||||
{
|
||||
return new BloomShake_BM(bloomTime, bloomPeak);
|
||||
return new BloomEffect_BM(duration, peak);
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
var container = inspector.GenerateContainer("Bloom Shake");
|
||||
var effectTimeField = inspector.GenerateInputField(this, container, "Bloom Time", nameof(bloomTime));
|
||||
var bloomPeakField = inspector.GenerateInputField(this, container, "Bloom Peak", nameof(bloomPeak));
|
||||
var effectTimeField = inspector.GenerateInputField(this, container, "Bloom Time", nameof(duration));
|
||||
var bloomPeakField = inspector.GenerateInputField(this, container, "Bloom Peak", nameof(peak));
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class BloomShake_BM : EffectBase_BM
|
||||
public class BloomEffect_BM : EffectBase_BM
|
||||
{
|
||||
public float bloomTime;
|
||||
public float bloomPeak;
|
||||
public float duration;
|
||||
public float peak;
|
||||
|
||||
public BloomShake_BM()
|
||||
public BloomEffect_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public BloomShake_BM(float bloomTime, float bloomPeak)
|
||||
public BloomEffect_BM(float duration, float peak)
|
||||
{
|
||||
this.effectTime = 0;
|
||||
this.bloomTime = bloomTime;
|
||||
this.bloomPeak = bloomPeak;
|
||||
this.duration = duration;
|
||||
this.peak = peak;
|
||||
}
|
||||
|
||||
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
|
||||
{
|
||||
return new BloomShake(bloomTime, bloomPeak);
|
||||
return new BloomEffect(duration, peak);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.Editor;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Lean.Pool;
|
||||
using MoreMountains.Feedbacks;
|
||||
using MoreMountains.FeedbacksForThirdParty;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public class CameraShakeEffect : EffectBase
|
||||
{
|
||||
public float duration;
|
||||
public float frequency;
|
||||
public float amplitudeX;
|
||||
public float amplitudeY;
|
||||
public float amplitudeZ;
|
||||
|
||||
public CameraShakeEffect(float duration, float frequency, float amplitudeX, float amplitudeY, float amplitudeZ)
|
||||
{
|
||||
this.effectTime = 0;
|
||||
this.duration = duration;
|
||||
this.frequency = frequency;
|
||||
this.amplitudeX = amplitudeX;
|
||||
this.amplitudeY = amplitudeY;
|
||||
this.amplitudeZ = amplitudeZ;
|
||||
}
|
||||
|
||||
public override void Adjust()
|
||||
{
|
||||
MMF_Player effect = LeanPool.Spawn(EditorManager.instance.basePrefabs.cameraShakeEffect).GetComponent<MMF_Player>();
|
||||
effect.GetFeedbackOfType<MMF_CameraShake>().CameraShakeProperties.Duration = duration;
|
||||
effect.GetFeedbackOfType<MMF_CameraShake>().CameraShakeProperties.Frequency = 1f / frequency;
|
||||
effect.GetFeedbackOfType<MMF_CameraShake>().CameraShakeProperties.AmplitudeX = amplitudeX;
|
||||
effect.GetFeedbackOfType<MMF_CameraShake>().CameraShakeProperties.AmplitudeY = amplitudeY;
|
||||
effect.GetFeedbackOfType<MMF_CameraShake>().CameraShakeProperties.AmplitudeZ = amplitudeZ;
|
||||
effect.PlayFeedbacks();
|
||||
LeanPool.Despawn(effect.gameObject, duration);
|
||||
}
|
||||
|
||||
public override EffectBase_BM ConvertToBM()
|
||||
{
|
||||
return new CameraShakeEffect_BM(duration, frequency, amplitudeX, amplitudeY, amplitudeZ);
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
var container = inspector.GenerateContainer("Camera Shake");
|
||||
var durationInputField = inspector.GenerateInputField(this, container, "Duration", nameof(duration));
|
||||
var frequencyInputField = inspector.GenerateInputField(this, container, "Frequency", nameof(frequency));
|
||||
var amplitudeXInputField = inspector.GenerateInputField(this, container, "Amplitude X", nameof(amplitudeX));
|
||||
var amplitudeYInputField = inspector.GenerateInputField(this, container, "Amplitude Y", nameof(amplitudeY));
|
||||
var amplitudeZInputField = inspector.GenerateInputField(this, container, "Amplitude Z", nameof(amplitudeZ));
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class CameraShakeEffect_BM : EffectBase_BM
|
||||
{
|
||||
public float duration;
|
||||
public float frequency;
|
||||
public float amplitudeX;
|
||||
public float amplitudeY;
|
||||
public float amplitudeZ;
|
||||
|
||||
public CameraShakeEffect_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public CameraShakeEffect_BM(float duration, float frequency, float amplitudeX, float amplitudeY, float amplitudeZ)
|
||||
{
|
||||
this.effectTime = 0;
|
||||
this.duration = duration;
|
||||
this.frequency = frequency;
|
||||
this.amplitudeX = amplitudeX;
|
||||
this.amplitudeY = amplitudeY;
|
||||
this.amplitudeZ = amplitudeZ;
|
||||
}
|
||||
|
||||
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
|
||||
{
|
||||
return new CameraShakeEffect(duration, frequency, amplitudeX, amplitudeY, amplitudeZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 02f91a687fb17491190605b9d6da93ee
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,72 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.Editor;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Lean.Pool;
|
||||
using MoreMountains.Feedbacks;
|
||||
using MoreMountains.FeedbacksForThirdParty;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public class ChromaticAberrationEffect : EffectBase
|
||||
{
|
||||
public float duration;
|
||||
public float peak;
|
||||
|
||||
public ChromaticAberrationEffect(float duration, float peak)
|
||||
{
|
||||
this.effectTime = 0;
|
||||
this.duration = duration;
|
||||
this.peak = peak;
|
||||
}
|
||||
|
||||
public override void Adjust()
|
||||
{
|
||||
MMF_Player effect = LeanPool.Spawn(EditorManager.instance.basePrefabs.chromaticAberrationEffect).GetComponent<MMF_Player>();
|
||||
effect.GetFeedbackOfType<MMF_ChromaticAberration_URP>().Duration = duration;
|
||||
effect.GetFeedbackOfType<MMF_ChromaticAberration_URP>().RemapIntensityOne = peak;
|
||||
effect.PlayFeedbacks();
|
||||
LeanPool.Despawn(effect.gameObject, duration);
|
||||
}
|
||||
|
||||
public override EffectBase_BM ConvertToBM()
|
||||
{
|
||||
return new ChromaticAberrationEffect_BM(duration, peak);
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
var container = inspector.GenerateContainer("Chromatic Aberration");
|
||||
var effectTimeField = inspector.GenerateInputField(this, container, "Duration", nameof(duration));
|
||||
var bloomPeakField = inspector.GenerateInputField(this, container, "Peak Value", nameof(peak));
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class ChromaticAberrationEffect_BM : EffectBase_BM
|
||||
{
|
||||
public float duration;
|
||||
public float peak;
|
||||
|
||||
public ChromaticAberrationEffect_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ChromaticAberrationEffect_BM(float duration, float peak)
|
||||
{
|
||||
this.effectTime = 0;
|
||||
this.duration = duration;
|
||||
this.peak = peak;
|
||||
}
|
||||
|
||||
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
|
||||
{
|
||||
return new ChromaticAberrationEffect(duration, peak);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ec0b0748a899444478c1463dd2479c21
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -64,11 +64,6 @@ namespace Ichni.RhythmGame
|
||||
LogWindow.Log("Effect Type not found.", Color.red);
|
||||
}
|
||||
});
|
||||
|
||||
foreach (var effect in effectSubmodule.effectCollection["Default"])
|
||||
{
|
||||
effect.SetUpInspector();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.Editor;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using MoreMountains.Feedbacks;
|
||||
using MoreMountains.FeedbacksForThirdParty;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
|
||||
namespace Ichni.RhythmGame
|
||||
{
|
||||
public class VignetteEffect : EffectBase
|
||||
{
|
||||
public float duration;
|
||||
public float peak;
|
||||
public float smoothness;
|
||||
public Color color;
|
||||
|
||||
public VignetteEffect(float duration, float peak, float smoothness, Color color)
|
||||
{
|
||||
this.effectTime = 0;
|
||||
this.duration = duration;
|
||||
this.peak = peak;
|
||||
this.smoothness = smoothness;
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public override void Adjust()
|
||||
{
|
||||
MMF_Player effect = Lean.Pool.LeanPool.Spawn(EditorManager.instance.basePrefabs.vignetteEffect).GetComponent<MMF_Player>();
|
||||
effect.GetFeedbackOfType<MMF_Vignette_URP>().Duration = duration;
|
||||
effect.GetFeedbackOfType<MMF_Vignette_URP>().RemapIntensityOne = peak;
|
||||
if (EditorManager.instance.postProcessingManager.globalVolume.profile.TryGet(out Vignette vignette))
|
||||
{
|
||||
vignette.smoothness.value = smoothness;
|
||||
vignette.color.value = color;
|
||||
}
|
||||
effect.PlayFeedbacks();
|
||||
Lean.Pool.LeanPool.Despawn(effect.gameObject, duration);
|
||||
}
|
||||
|
||||
public override EffectBase_BM ConvertToBM()
|
||||
{
|
||||
return new VignetteEffect_BM(duration, peak, smoothness, color);
|
||||
}
|
||||
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
var container = inspector.GenerateContainer("Vignette");
|
||||
var durationField = inspector.GenerateInputField(this, container, "Duration", nameof(duration));
|
||||
var peakField = inspector.GenerateInputField(this, container, "Peak Value", nameof(peak));
|
||||
var smoothnessField = inspector.GenerateInputField(this, container, "Smoothness", nameof(smoothness));
|
||||
var colorField = inspector.GenerateBaseColorPicker(this, container, "Color", nameof(color));
|
||||
container.SetDeviver(1);
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
{
|
||||
public class VignetteEffect_BM : EffectBase_BM
|
||||
{
|
||||
public float duration;
|
||||
public float peak;
|
||||
public float smoothness;
|
||||
public Color color;
|
||||
|
||||
public VignetteEffect_BM()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public VignetteEffect_BM(float duration, float peak, float smoothness, Color color)
|
||||
{
|
||||
this.duration = duration;
|
||||
this.peak = peak;
|
||||
this.smoothness = smoothness;
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
|
||||
{
|
||||
return new VignetteEffect(duration, peak, smoothness, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 376e99f179fef44f0b49cef589dd558a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user