小小改

Signed-off-by: TRADER_FOER <lhf190@outlook.com>
This commit is contained in:
2026-07-18 11:57:29 +08:00
parent db5dbe246a
commit df4d35942a
5 changed files with 61 additions and 66 deletions

View File

@@ -213,7 +213,7 @@ Material:
- _Dst: 10
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EdgeValue: 0.012226982
- _EdgeValue: 0.83361584
- _EnvironmentReflections: 1
- _FNLfanxiangkaiguan: 0
- _Face: 1
@@ -258,7 +258,7 @@ Material:
- _Mask_scale: 1
- _Metallic: 0
- _OcclusionStrength: 1
- _Opacity: 0.987773
- _Opacity: 0.16638416
- _Parallax: 0.005
- _Pass: 0
- _QueueOffset: 0

Binary file not shown.

View File

@@ -26,7 +26,7 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
#region [] Core Effect Logic
private void UpdateHold()
{
noteVisualHold.SetHoldPercentRange(startPercent, endPercent, true);
noteVisualHold.SetHoldPercentRange(startPercent, endPercent, true, false);
}
private void UpdateTargetPercents(float songTime)

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using Dreamteck.Splines;
@@ -97,6 +97,8 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
private SplineSample offsetSample = new();
private Transform hitPointTransform;
private Vector3 hitPointBaseLocalScale = Vector3.one;
private Transform judgeEffectTransform;
private Vector3 judgeEffectBaseLocalScale = Vector3.one;
private bool isHoldVisualShown = true;
public float holdThickness => Mathf.Max(0f, transformSubmodule?.currentScale.x ?? 1f);
@@ -113,7 +115,8 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
DisableSplineSizeScale(hold?.trackPositioner);
DisableSplineSizeScale(headPoint);
DisableSplineSizeScale(tailPoint);
ApplyHitPointScaleIsolation();
ApplyHitPointScaleIsolation();
ApplyJudgeEffectScaleIsolation();
}
private void DisableSplineSizeScale(SplinePositioner positioner)
@@ -188,7 +191,7 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
{
if (extraPartList == null || extraPartList.Count == 0 || extraPartList[0] == null) return;
extraPartList[0].SetActive(isVisualShown && isHighlighted);
ApplyHitPointScaleIsolation();
ApplyHitPointScaleIsolation();
}
private void CacheHitPointTransform()
@@ -203,18 +206,38 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
private void ApplyHitPointScaleIsolation()
{
CacheHitPointTransform();
if (hitPointTransform == null) return;
ApplyHoldScaledWorldScale(hitPointTransform, hitPointBaseLocalScale);
}
Vector3 targetWorldScale = hitPointBaseLocalScale * holdThickness;
Transform parent = hitPointTransform.parent;
private void CacheJudgeEffectTransform()
{
if (judgeEffectTransform != null) return;
if (judgeEffect == null) return;
judgeEffectTransform = judgeEffect.transform;
judgeEffectBaseLocalScale = judgeEffectTransform.localScale;
}
private void ApplyJudgeEffectScaleIsolation()
{
CacheJudgeEffectTransform();
ApplyHoldScaledWorldScale(judgeEffectTransform, judgeEffectBaseLocalScale);
}
private void ApplyHoldScaledWorldScale(Transform targetTransform, Vector3 baseLocalScale)
{
if (targetTransform == null) return;
Vector3 targetWorldScale = baseLocalScale * holdThickness;
Transform parent = targetTransform.parent;
if (parent == null)
{
hitPointTransform.localScale = targetWorldScale;
targetTransform.localScale = targetWorldScale;
return;
}
Vector3 parentScale = parent.lossyScale;
hitPointTransform.localScale = new Vector3(
targetTransform.localScale = new Vector3(
DivideScaleAxis(targetWorldScale.x, parentScale.x),
DivideScaleAxis(targetWorldScale.y, parentScale.y),
DivideScaleAxis(targetWorldScale.z, parentScale.z)
@@ -298,19 +321,22 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
SetHoldPercentRange(startPercent, endPercent, true);
}
public void SetHoldPercentRange(float startPercent, float endPercent, bool rebuildImmediately)
public void SetHoldPercentRange(float startPercent, float endPercent, bool rebuildImmediately, bool updateTrackPositioner = true)
{
this.startPercent = startPercent;
this.endPercent = endPercent;
if (rebuildImmediately)
if (updateTrackPositioner && rebuildImmediately)
{
hold.trackPositioner.RebuildImmediate();
}
ApplyHoldPositionOffset(positionOffset);
hold.trackPositioner.SetPercent(startPercent);
ApplyPositionerWorldOffset(hold.trackPositioner, startPercent);
if (updateTrackPositioner)
{
hold.trackPositioner.SetPercent(startPercent);
ApplyPositionerWorldOffset(hold.trackPositioner, startPercent);
}
meshGenerator.SetClipRange(startPercent, endPercent);
ApplyHoldThicknessFromScale();
@@ -322,7 +348,8 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
headPoint.SetPercent(startPercent);
ApplyPositionerWorldOffset(headPoint, startPercent);
ApplyHitPointScaleIsolation();
ApplyHitPointScaleIsolation();
ApplyJudgeEffectScaleIsolation();
if (rebuildImmediately)
{
@@ -347,6 +374,7 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
transform.localScale = Vector3.one;
ApplyHoldThicknessFromScale();
ApplyHitPointScaleIsolation();
ApplyJudgeEffectScaleIsolation();
transformSubmodule.scaleDirtyMark = false;
willRefresh = true;
transformSubmodule.scaleOffset = Vector3.zero;
@@ -395,6 +423,7 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
ApplyHoldPositionOffset(GetCurrentPositionOffset());
ApplyHoldThicknessFromScale();
ApplyHitPointScaleIsolation();
ApplyJudgeEffectScaleIsolation();
}
#endregion
}