超级爆改
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 41993de9eb4184946b271ed039f2827a
|
||||
guid: f31c8f1dc317daf4abfedc72480bca94
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@@ -33,46 +33,8 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
public override void SetUpInspector()
|
||||
{
|
||||
base.SetUpInspector();
|
||||
|
||||
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
|
||||
|
||||
// --- Sky ---
|
||||
var skyContainer = inspector.GenerateContainer("DTMStarrySkybox - Sky");
|
||||
var skyFields = skyContainer.GenerateSubcontainer(3);
|
||||
inspector.GenerateBaseColorPicker(this, skyFields, "Sky Color", nameof(skyColor)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateBaseColorPicker(this, skyFields, "Horizon", nameof(horizon)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, skyFields, "Horizon Strength", nameof(horizonStrength)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, skyFields, "Horizon Sky Height", nameof(horizonSkyHeight)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
|
||||
// --- Stars ---
|
||||
var starsContainer = inspector.GenerateContainer("DTMStarrySkybox - Stars");
|
||||
var starsFields = starsContainer.GenerateSubcontainer(3);
|
||||
inspector.GenerateToggle(this, starsFields, "Use Star Map", nameof(useStarMap)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, starsFields, "Star Map Texture Name", nameof(starMapTextureName)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, starsFields, "Star Density", nameof(starDensity)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, starsFields, "Star Size", nameof(starSize)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateBaseColorPicker(this, starsFields, "Star Color", nameof(starColor)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateToggle(this, starsFields, "Prevent Stars In Front Of Sun", nameof(preventStarsInFrontOfSun)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
|
||||
// --- Sun ---
|
||||
var sunContainer = inspector.GenerateContainer("DTMStarrySkybox - Sun");
|
||||
var sunFields = sunContainer.GenerateSubcontainer(3);
|
||||
inspector.GenerateToggle(this, sunFields, "Have Sun", nameof(haveSun)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, sunFields, "Sun Mask Texture Name", nameof(sunMaskTextureName)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, sunFields, "Sun Mask Size", nameof(sunMaskSize)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, sunFields, "Sun Mask Spherize", nameof(sunMaskSpherize)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, sunFields, "Sun Disc Size", nameof(sunDiscSize)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateBaseColorPicker(this, sunFields, "Sun Color One", nameof(sunColorOne)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateBaseColorPicker(this, sunFields, "Sun Color Two", nameof(sunColorTwo)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, sunFields, "Sun Gradient Strength", nameof(sunGradientStrength)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, sunFields, "Sun Gradient Height", nameof(sunGradientHeight)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
|
||||
// --- Fog ---
|
||||
var fogContainer = inspector.GenerateContainer("DTMStarrySkybox - Fog");
|
||||
var fogFields = fogContainer.GenerateSubcontainer(3);
|
||||
inspector.GenerateInputField(this, fogFields, "Fog Height", nameof(fogHeight)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, fogFields, "Fog Power", nameof(fogPower)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
inspector.GenerateInputField(this, fogFields, "Fog Contrast", nameof(fogContrast)).AddListenerFunction(UpdateSkyboxProperties);
|
||||
// 让强劲的特性打包流去替接管全部 20 几个杂毛元素生成,并自动分装成横列!
|
||||
Ichni.Editor.DynamicUIAutoBuilder.AutoBuild(this, EditorManager.instance.uiManager.inspector);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -101,7 +101,6 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
heightFogGlobal.fogColorDuo = fogColorDuo;
|
||||
|
||||
heightFogGlobal.skyboxFogIntensity = skyboxFogIntensity;
|
||||
Debug.Log(heightFogGlobal.skyboxFogIntensity);
|
||||
heightFogGlobal.skyboxFogHeight = skyboxFogHeight;
|
||||
heightFogGlobal.skyboxFogFalloff = skyboxFogFalloff;
|
||||
heightFogGlobal.skyboxFogOffset = skyboxFogOffset;
|
||||
|
||||
@@ -25,6 +25,10 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
public float tubeRadius = 10f;
|
||||
|
||||
public Renderer meshRenderer;
|
||||
|
||||
public override bool haveBaseColor => false;
|
||||
public override bool haveEmissionColor => true;
|
||||
|
||||
#endregion
|
||||
|
||||
#region [生命周期与工厂] Lifecycle & Factory
|
||||
@@ -66,10 +70,14 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
if (meshRenderer != null)
|
||||
{
|
||||
meshRenderer.InitializeShader(); // 实例化材质 / Instantiate material
|
||||
UpdateMaterialProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public override void AfterInitialize()
|
||||
{
|
||||
UpdateMaterialProperties();
|
||||
}
|
||||
|
||||
public override void OnDirtyRefresh(Dictionary<string, bool> flags)
|
||||
{
|
||||
UpdateMaterialProperties();
|
||||
@@ -99,7 +107,7 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
mat.SetFloat("_TubeRadius", tubeRadius);
|
||||
|
||||
// Sync color mapped from unified generic submodule
|
||||
mat.SetColor("_Color0", colorSubmodule.currentBaseColor);
|
||||
mat.SetColor("_Color0", colorSubmodule.GetCurrentEmissionColor());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +117,7 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
// Sync environment color changes
|
||||
if (meshRenderer != null && meshRenderer.material != null)
|
||||
{
|
||||
meshRenderer.material.SetColor("_Color0", colorSubmodule.currentBaseColor);
|
||||
meshRenderer.material.SetColor("_Color0", colorSubmodule.GetCurrentEmissionColor());
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -17,34 +17,55 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
[NonSerialized] public Material skyboxMaterial;
|
||||
|
||||
// --- Sky ---
|
||||
[Ichni.Editor.DynamicUIEmissionColor("Sky Color", Group = "DTMStarrySkybox - Sky")]
|
||||
public Color skyColor = Color.blue;
|
||||
[Ichni.Editor.DynamicUIEmissionColor("Horizon", Group = "DTMStarrySkybox - Sky")]
|
||||
public Color horizon = Color.cyan;
|
||||
[Ichni.Editor.DynamicUI("Horizon Strength", Group = "DTMStarrySkybox - Sky")]
|
||||
public float horizonStrength = 2f;
|
||||
[Ichni.Editor.DynamicUI("Horizon Sky Height", Group = "DTMStarrySkybox - Sky")]
|
||||
public float horizonSkyHeight = 0.7f;
|
||||
|
||||
// --- Stars ---
|
||||
[Ichni.Editor.DynamicUI("Use Star Map", Group = "DTMStarrySkybox - Stars")]
|
||||
public bool useStarMap = true;
|
||||
[Ichni.Editor.DynamicUI("Star Density", Group = "DTMStarrySkybox - Stars")]
|
||||
public float starDensity = 30f;
|
||||
[Ichni.Editor.DynamicUI("Star Size", Group = "DTMStarrySkybox - Stars")]
|
||||
public float starSize = 75f;
|
||||
[Ichni.Editor.DynamicUIEmissionColor("Star Color", Group = "DTMStarrySkybox - Stars")]
|
||||
public Color starColor = Color.white;
|
||||
[Ichni.Editor.DynamicUI("Prevent Stars In Front Of Sun", Group = "DTMStarrySkybox - Stars")]
|
||||
public bool preventStarsInFrontOfSun = true;
|
||||
// 通过 ThemeBundle 字符串名称查找贴图
|
||||
public string starMapTextureName = "None";
|
||||
[Ichni.Editor.DynamicUI("Star Map Texture (Name)", Group = "DTMStarrySkybox - Stars", Span = 3)]
|
||||
public string starMapTextureName = "None"; // 较长文本强行占满全行
|
||||
|
||||
// --- Sun Mask ---
|
||||
[Ichni.Editor.DynamicUI("Have Sun", Group = "DTMStarrySkybox - Sun")]
|
||||
public bool haveSun = false;
|
||||
[Ichni.Editor.DynamicUI("Sun Mask Texture (Name)", Group = "DTMStarrySkybox - Sun", Span = 3)]
|
||||
public string sunMaskTextureName = "None";
|
||||
[Ichni.Editor.DynamicUI("Sun Mask Size", Group = "DTMStarrySkybox - Sun")]
|
||||
public float sunMaskSize = 0.02f;
|
||||
[Ichni.Editor.DynamicUI("Sun Mask Spherize", Group = "DTMStarrySkybox - Sun")]
|
||||
public float sunMaskSpherize = 13.2f;
|
||||
[Ichni.Editor.DynamicUI("Sun Disc Size", Group = "DTMStarrySkybox - Sun")]
|
||||
public float sunDiscSize = 1f;
|
||||
[Ichni.Editor.DynamicUIEmissionColor("Sun Color One", Group = "DTMStarrySkybox - Sun")]
|
||||
public Color sunColorOne = Color.white;
|
||||
[Ichni.Editor.DynamicUIEmissionColor("Sun Color Two", Group = "DTMStarrySkybox - Sun")]
|
||||
public Color sunColorTwo = Color.white;
|
||||
[Ichni.Editor.DynamicUI("Sun Gradient Strength", Group = "DTMStarrySkybox - Sun")]
|
||||
public float sunGradientStrength = 3.7f;
|
||||
[Ichni.Editor.DynamicUI("Sun Gradient Height", Group = "DTMStarrySkybox - Sun")]
|
||||
public float sunGradientHeight = 1.23f;
|
||||
|
||||
// --- Fog ---
|
||||
[Ichni.Editor.DynamicUI("Fog Height", Group = "DTMStarrySkybox - Fog")]
|
||||
public float fogHeight = 1f;
|
||||
[Ichni.Editor.DynamicUI("Fog Power", Group = "DTMStarrySkybox - Fog")]
|
||||
public float fogPower = 0.5f;
|
||||
[Ichni.Editor.DynamicUI("Fog Contrast", Group = "DTMStarrySkybox - Fog")]
|
||||
public float fogContrast = 40f;
|
||||
|
||||
#endregion
|
||||
@@ -136,9 +157,9 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
|
||||
// -- Sky --
|
||||
skyboxMaterial.SetColor("_SkyColor", skyColor);
|
||||
skyboxMaterial.SetColor("_Horizon", horizon);
|
||||
skyboxMaterial.SetColor("_HorizonColor", horizon);
|
||||
skyboxMaterial.SetFloat("_HorizonStrength", horizonStrength);
|
||||
skyboxMaterial.SetFloat("_HorizonSkyHeight", horizonSkyHeight);
|
||||
skyboxMaterial.SetFloat("_HorizonHeight", horizonSkyHeight);
|
||||
|
||||
// -- Stars --
|
||||
skyboxMaterial.SetFloat("_UseStarMap", useStarMap ? 1f : 0f);
|
||||
@@ -183,6 +204,11 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
public override void Refresh()
|
||||
{
|
||||
base.Refresh();
|
||||
|
||||
// 加入自动材质同步网:所有的数值被 UI 工具(如撤回系统或滚动输入)修改时,UI 均会默认调用 Refresh() 结束更改。
|
||||
// 此时自动将最新参数一次性烘焙至天空盒,再也无需每个 Inspector 元件去手动 AddListener()!
|
||||
UpdateSkyboxProperties();
|
||||
|
||||
if (skyboxMaterial != null)
|
||||
{
|
||||
RenderSettings.skybox = skyboxMaterial;
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
if (isFirstGenerated)
|
||||
{
|
||||
enableTimes = new FlexibleBool();
|
||||
/*enableTimes = new FlexibleBool();
|
||||
|
||||
if (parentElement is TrackHeadPoint trackHeadPoint)
|
||||
{
|
||||
@@ -80,24 +80,24 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
enableTimes.Add(new AnimatedBool(0f, false));
|
||||
enableTimes.Add(new AnimatedBool(1f, true));
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
//SetUpTweeners();
|
||||
trailRenderer = trailBody.GetComponent<TrailRenderer>();
|
||||
var rotationBySpeedModule = headCircleParticle.rotationBySpeed;
|
||||
rotationBySpeedModule.z = 0;
|
||||
headPoint.transform.localScale = Vector3.zero;
|
||||
headCircle.transform.localScale = Vector3.zero;
|
||||
//var rotationBySpeedModule = headCircleParticle.rotationBySpeed;
|
||||
//rotationBySpeedModule.z = 0;
|
||||
//headPoint.transform.localScale = Vector3.zero;
|
||||
//headCircle.transform.localScale = Vector3.zero;
|
||||
|
||||
renderers.ForEach(rend => rend.InitializeShader());
|
||||
//renderers.ForEach(rend => rend.InitializeShader());
|
||||
}
|
||||
|
||||
public override void Refresh()
|
||||
{
|
||||
base.Refresh();
|
||||
|
||||
renderers.ForEach(rend =>
|
||||
/*renderers.ForEach(rend =>
|
||||
{
|
||||
if (colorSubmodule.emissionEnabled)
|
||||
{
|
||||
@@ -108,22 +108,17 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
rend.material.DisableKeyword("_EMISSION_ON");
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Debug.Log(rend.material.IsKeywordEnabled("_EMISSION_ON") + " " + rend.material.IsKeywordEnabled("_USEREDASALPHA_ON"));
|
||||
|
||||
rend.material.SetColor("_BaseColor", colorSubmodule.currentBaseColor);
|
||||
rend.material.SetColor("_EmissionColor", colorSubmodule.GetCurrentEmissionColor());
|
||||
});
|
||||
});*/
|
||||
}
|
||||
public override void AfterInitialize()
|
||||
{
|
||||
base.AfterInitialize();
|
||||
renderers.ForEach(rend =>
|
||||
/*renderers.ForEach(rend =>
|
||||
{
|
||||
rend.material.EnableKeyword("_USEREDASALPHA_ON");
|
||||
});
|
||||
});*/
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -134,12 +129,12 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
enableTimes.UpdateFlexibleBool(songTime);
|
||||
if (enableTimes.value && !isHeadEnabled)
|
||||
{
|
||||
EnableHead();
|
||||
//EnableHead();
|
||||
isHeadEnabled = true;
|
||||
}
|
||||
else if (!enableTimes.value && isHeadEnabled)
|
||||
{
|
||||
DisableHead();
|
||||
//DisableHead();
|
||||
isHeadEnabled = false;
|
||||
}
|
||||
|
||||
@@ -154,13 +149,13 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
if (isHeadEnabled && headRotateSpeed.animations.Count > 0)
|
||||
{
|
||||
headRotateSpeed.UpdateFlexibleFloat(songTime);
|
||||
var rotationBySpeedModule = headCircleParticle.rotationBySpeed;
|
||||
rotationBySpeedModule.z = headRotateSpeed.value;
|
||||
/*var rotationBySpeedModule = headCircleParticle.rotationBySpeed;
|
||||
rotationBySpeedModule.z = headRotateSpeed.value;*/
|
||||
}
|
||||
|
||||
if (Keyboard.current.tKey.wasPressedThisFrame)
|
||||
{
|
||||
TriggerInteraction();
|
||||
// TriggerInteraction();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ Shader "Soullies/DTM_RandomGridTube"
|
||||
[Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend("Src Blend", Float) = 5 // SrcAlpha
|
||||
[Enum(UnityEngine.Rendering.BlendMode)] _DstBlend("Dst Blend", Float) = 10 // OneMinusSrcAlpha
|
||||
[Enum(Off, 0, On, 1)] _ZWrite("Z Write", Float) = 0
|
||||
[Enum(Front, Back, Off)] _CullMode("Cull Mode", Float) = 1 // Front (Inside)
|
||||
[Enum(Front, 0, Back, 1, Off, 2)] _CullMode("Cull Mode", Float) = 1 // Front (Inside)
|
||||
}
|
||||
|
||||
SubShader
|
||||
|
||||
Reference in New Issue
Block a user