一些特效

This commit is contained in:
SoulliesOfficial
2025-06-28 03:01:03 -04:00
parent 16418804e4
commit 1a3d37d9b5
216 changed files with 41141 additions and 2728 deletions

View File

@@ -12,6 +12,8 @@ namespace Ichni.Editor
public class DynamicUIEmissionColorPicker : DynamicUIElement
{
private string emissionEnabledName, colorParameterName, emissionIntensityName;
private bool canDisableEmission;
public Toggle toggleEnableEmission;
public TMP_InputField inputFieldEmissionR;
public TMP_InputField inputFieldEmissionG;
@@ -27,15 +29,27 @@ namespace Ichni.Editor
string emissionEnabledName, string colorParameterName, string emissionIntensityName)
{
base.Initialize(baseElement, title, colorParameterName);
canDisableEmission = emissionEnabledName != "NULL"; //如果对应的EmissionColor强制开启那么其enabledName为"NULL"不需要显示Toggle
this.emissionEnabledName = emissionEnabledName;
this.colorParameterName = colorParameterName;
this.emissionIntensityName = emissionIntensityName;
bool enableEmission = (bool)connectedBaseElement.GetType().GetField(emissionEnabledName).GetValue(connectedBaseElement);
if(canDisableEmission)
{
bool enableEmission = (bool)connectedBaseElement.GetType().GetField(emissionEnabledName).GetValue(connectedBaseElement);
toggleEnableEmission.isOn = enableEmission;
toggleEnableEmission.onValueChanged.AddListener(_ => ApplyParameters());
}
else
{
toggleEnableEmission.gameObject.SetActive(false);
}
Color emissionColor = (Color)connectedBaseElement.GetType().GetField(colorParameterName).GetValue(connectedBaseElement);
float emissionIntensity = (float)connectedBaseElement.GetType().GetField(emissionIntensityName).GetValue(connectedBaseElement);
toggleEnableEmission.isOn = enableEmission;
inputFieldEmissionR.text = emissionColor.r.ToString();
inputFieldEmissionG.text = emissionColor.g.ToString();
inputFieldEmissionB.text = emissionColor.b.ToString();
@@ -48,8 +62,6 @@ namespace Ichni.Editor
sliderG.onValueChanged.AddListener(SliderChange);
sliderB.onValueChanged.AddListener(SliderChange);
toggleEnableEmission.onValueChanged.AddListener(_ => ApplyParameters());
inputFieldEmissionR.onEndEdit.AddListener(_ => ApplyParameters());
inputFieldEmissionG.onEndEdit.AddListener(_ => ApplyParameters());
inputFieldEmissionB.onEndEdit.AddListener(_ => ApplyParameters());
@@ -64,8 +76,12 @@ namespace Ichni.Editor
Color emissionColor = new Color(float.Parse(inputFieldEmissionR.text), float.Parse(inputFieldEmissionG.text),
float.Parse(inputFieldEmissionB.text));
float emissionIntensity = float.Parse(inputFieldEmissionI.text);
connectedBaseElement.GetType().GetField(emissionEnabledName).SetValue(connectedBaseElement, enableEmission);
if (canDisableEmission)
{
connectedBaseElement.GetType().GetField(emissionEnabledName).SetValue(connectedBaseElement, enableEmission);
}
connectedBaseElement.GetType().GetField(colorParameterName).SetValue(connectedBaseElement, emissionColor);
connectedBaseElement.GetType().GetField(emissionIntensityName).SetValue(connectedBaseElement, emissionIntensity);
colorPreview.color = emissionColor;
@@ -82,8 +98,11 @@ namespace Ichni.Editor
public override DynamicUIElement AddListenerFunction(UnityAction action)
{
toggleEnableEmission.onValueChanged.AddListener(_ => action());
if (canDisableEmission)
{
toggleEnableEmission.onValueChanged.AddListener(_ => action());
}
inputFieldEmissionR.onEndEdit.AddListener(_ => action());
inputFieldEmissionG.onEndEdit.AddListener(_ => action());
inputFieldEmissionB.onEndEdit.AddListener(_ => action());

View File

@@ -2,6 +2,7 @@ using System.Collections;
using System.Collections.Generic;
using Ichni.Editor;
using Ichni.RhythmGame.Beatmap;
using Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse;
using Sirenix.Utilities;
using UnityEngine;
using UnityEngine.Events;
@@ -96,8 +97,9 @@ namespace Ichni.RhythmGame
var effectNameInputField = inspector.GenerateInputField(subcontainer, "Effect Name");
var addEffectButton = inspector.GenerateButton(this, subcontainer, "Add Effect", () =>
{
if (EffectCollection.TryGetValue(effectNameInputField.GetValue<string>(), out var newEffect))
if (EffectCollection.TryGetValue(effectNameInputField.GetValue<string>(), out EffectBase newEffect))
{
newEffect.attachedGameElement = attachedGameElement;
effectCollection[effect.Key].Add(newEffect);
inspectorMain.SetInspector(attachedGameElement);
}
@@ -128,14 +130,15 @@ namespace Ichni.RhythmGame
{
{ "Bloom", new BloomEffect(1, 2, CustomCurvePresets.Parabolic(1, 0, 1)) },
{ "CameraShake", new CameraShakeEffect(1, 50, 1, 1, 1) },
{"CameraOffset", new CameraOffsetEffect(0.2f, Vector3.forward, CustomCurvePresets.CustomPeakTimeParabolic(1,0,1,0.3f))},
{"CameraTilt", new CameraTiltEffect(0.2f, new Vector3(0,0,5), CustomCurvePresets.CustomPeakTimeParabolic(1,0,1, 0.3f))},
{ "CameraOffset", new CameraOffsetEffect(0.2f, Vector3.forward, CustomCurvePresets.CustomPeakTimeParabolic(1, 0, 1, 0.3f)) },
{ "CameraTilt", new CameraTiltEffect(0.2f, new Vector3(0, 0, 5), CustomCurvePresets.CustomPeakTimeParabolic(1, 0, 1, 0.3f)) },
{ "ChromaticAberration", new ChromaticAberrationEffect(1, 1, CustomCurvePresets.Parabolic(1, 0, 1)) },
{ "Vignette", new VignetteEffect(1, 1, 0.4f, Color.black, CustomCurvePresets.Parabolic(1, 0, 1)) },
{ "SetInteger", new SetIntegerEffect("New Variable", 0, false, 0, 1) },
{ "EnableControl", new EnableControlEffect(null, "New Variable", 0, false, "") },
{ "LowPassFilter", new LowPassFilterEffect(1, 10, CustomCurvePresets.Parabolic(1, 0, 1)) },
{ "HighPassFilter", new HighPassFilterEffect(1, 22000, CustomCurvePresets.Parabolic(1, 0, 1)) }
{ "HighPassFilter", new HighPassFilterEffect(1, 22000, CustomCurvePresets.Parabolic(1, 0, 1)) },
{ "DTM_RippleEffect", new DTMRippleEffect(false, 0.5f, Color.white, 0) }
};
}
@@ -195,6 +198,7 @@ namespace Ichni.RhythmGame
}
public BaseElement_BM matchedBM { get; set; }
public GameElement attachedGameElement { get; set; }
/// <summary>
/// 效果的持续时间如果为0则表示瞬间效果

View File

@@ -5,74 +5,70 @@ using UnityEngine;
using UnityEngine.Profiling;
using UnityEngine.Serialization;
[CreateAssetMenu(fileName = "BasePrefabsCollection", menuName = "Ichni/BasePrefabsCollection", order = 0)]
public class BasePrefabsCollection : SerializedScriptableObject
namespace Ichni.RhythmGame
{
[Title("基础预制体")] public GameObject emptyObject;
public GameObject elementFolder;
public GameObject gameCamera;
[CreateAssetMenu(fileName = "BasePrefabsCollection", menuName = "Ichni/BasePrefabsCollection", order = 0)]
public class BasePrefabsCollection : SerializedScriptableObject
{
[Title("基础预制体")] public GameObject emptyObject;
public GameObject elementFolder;
public GameObject gameCamera;
[Title("Track相关")] public GameObject track;
public GameObject trackDisplay;
public GameObject pathNode;
public Material defaultTrackMaterial;
public GameObject sampler;
[Title("Track相关")] public GameObject track;
public GameObject trackDisplay;
public GameObject pathNode;
public Material defaultTrackMaterial;
public GameObject sampler;
[Title("Trail相关")] public GameObject trail;
public Material defaultTrailMaterial;
[Title("Trail相关")] public GameObject trail;
public Material defaultTrailMaterial;
[Title("Note 相关")] public GameObject tapNote;
public GameObject stayNote;
public GameObject holdNote;
public GameObject flickNote;
[Title("Note 判定UI")]
public GameObject fullscreenNearTimeHint;
public GameObject areaHint;
public GameObject triggerHint;
[Title("Note 相关")] public GameObject tapNote;
public GameObject stayNote;
public GameObject holdNote;
public GameObject flickNote;
[Title("Note 判定UI")] public GameObject fullscreenNearTimeHint;
public GameObject areaHint;
public GameObject triggerHint;
[Title("Effect相关")]
public GameObject bloomEffect;
public GameObject cameraShakeEffect;
public GameObject cameraTiltEffect;
public GameObject chromaticAberrationEffect;
public GameObject vignetteEffect;
public GameObject lowPassFilterEffect;
public GameObject highPassFilterEffect;
[Title("Effect相关")] public GameObject bloomEffect;
public GameObject cameraShakeEffect;
public GameObject cameraTiltEffect;
public GameObject chromaticAberrationEffect;
public GameObject vignetteEffect;
public GameObject lowPassFilterEffect;
public GameObject highPassFilterEffect;
[Title("Inspector相关")]
public GameObject inspectorSecondaryWindow;
[Title("Inspector相关")] public GameObject inspectorSecondaryWindow;
[Title("DynamicUI相关-Simple")]
public GameObject dynamicUIContainer;
public GameObject dynamicUISubcontainer;
public GameObject inputField;
public GameObject vector3InputField;
public GameObject parameterText;
public GameObject hintText;
public GameObject button;
public GameObject toggle;
public GameObject enumDropdown;
public GameObject stringListDropdown;
public GameObject baseColorPicker;
public GameObject emissionColorPicker;
[Title("DynamicUI相关-Composite")]
public GameObject generalSecondaryWindow;
public GameObject compositeParameterWindow;
public GameObject inputFieldUnit;
public GameObject animatedFloatUnit;
public GameObject animatedIntUnit;
public GameObject animatedBoolUnit;
public GameObject customCurveKeyframeUnit;
public GameObject customCurveWrapModeUnit;
public GameObject gradientColorKeyUnit;
public GameObject gradientAlphaKeyUnit;
public GameObject stringIntPairUnit;
[Title("图形化动画编辑器")]
public GameObject graphicalFlexibleFloatWindow;
[Title("DynamicUI相关-Simple")] public GameObject dynamicUIContainer;
public GameObject dynamicUISubcontainer;
public GameObject inputField;
public GameObject vector3InputField;
public GameObject parameterText;
public GameObject hintText;
public GameObject button;
public GameObject toggle;
public GameObject enumDropdown;
public GameObject stringListDropdown;
public GameObject baseColorPicker;
public GameObject emissionColorPicker;
[Title("DynamicUI相关-Composite")] public GameObject generalSecondaryWindow;
public GameObject compositeParameterWindow;
public GameObject inputFieldUnit;
public GameObject animatedFloatUnit;
public GameObject animatedIntUnit;
public GameObject animatedBoolUnit;
public GameObject customCurveKeyframeUnit;
public GameObject customCurveWrapModeUnit;
public GameObject gradientColorKeyUnit;
public GameObject gradientAlphaKeyUnit;
public GameObject stringIntPairUnit;
[Title("图形化动画编辑器")] public GameObject graphicalFlexibleFloatWindow;
//采音器
//采音器
[Title("Background相关")]
public Sprite defaultBackground;
public Material defaultSkyboxMaterial;
}
[Title("Background相关")] public Sprite defaultBackground;
public Material defaultSkyboxMaterial;
}
}

View File

@@ -0,0 +1,27 @@
using System.Collections;
using System.Collections.Generic;
using Sirenix.OdinInspector;
using UnityEngine;
namespace Ichni.RhythmGame
{
[CreateAssetMenu(fileName = "BasePrefabsCollection", menuName = "Ichni/CustomPrefabsCollection", order = 0)]
public class CustomPrefabsCollection : SerializedScriptableObject
{
public string themeBundleName = "theme_bundle_name_here";
public Dictionary<string, GameObject> Prefabs = new Dictionary<string, GameObject>();
public GameObject GetPrefab(string prefabName)
{
if (Prefabs.TryGetValue(prefabName, out GameObject prefab))
{
return prefab;
}
else
{
Debug.LogError($"Prefab '{prefabName}' not found in {themeBundleName} collection.");
return null;
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4dbc31cf60d8a0549a2be9b95e816376
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -26,7 +26,7 @@ namespace Ichni
public BackgroundController backgroundController;
public GridController gridController;
public CameraManager cameraManager;
public PostProcessingManager postProcessingManager;
public Ichni.Editor.PostProcessingManager postProcessingManager;
public Canvas judgeHintCanvas;
public Canvas inspectorCanvas;
public Timeline timeline;
@@ -39,6 +39,7 @@ namespace Ichni
public NoteBase.NoteJudgeType currentJudgeType;
public bool useNotePrefab;
public BasePrefabsCollection basePrefabs;
public Dictionary<string, CustomPrefabsCollection> customPrefabs;
public NoteAudioCollection noteAudioCollection;
[Title("Runtime Global Elements")]