@@ -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
|
||||
|
||||
BIN
Assets/FR2_Cache.asset
LFS
BIN
Assets/FR2_Cache.asset
LFS
Binary file not shown.
@@ -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)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user