修改步进模式进入动画,新增透镜动画
This commit is contained in:
@@ -442,14 +442,13 @@ namespace AibisDream.FixSystem
|
||||
bodyModule.SwitchModuleGroup(ModuleState.Head);
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.BodyModule);
|
||||
}
|
||||
|
||||
// 开启表达系统视图(无参数版本,使用默认配置)
|
||||
expressionManager.OpenView();
|
||||
|
||||
// 切换到表达相机
|
||||
yield return TimelineCenter.Instance.PlayTimelineAsync("透镜/透镜in");
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.Expression);
|
||||
yield return UIManager.Instance.GetPanel<PlayToolPanel>().FadeInAsync(0.5f);
|
||||
|
||||
// 切换到深度表达相机
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.ExpressionDeep);
|
||||
yield return UIManager.Instance.GetPanel<PlayToolPanel>().FadeOutAsync(0.5f);
|
||||
@@ -459,13 +458,17 @@ namespace AibisDream.FixSystem
|
||||
{
|
||||
var expressionManager = FixSystemCenter.SystemDic.Get<ExpressionManager>();
|
||||
var bodyModuleSystem = FixSystemCenter.SystemDic.Get<BodyModuleSystem>();
|
||||
yield return UIManager.Instance.GetPanel<PlayToolPanel>().FadeInAsync(0.5f);
|
||||
|
||||
// 重置身体模块
|
||||
bodyModuleSystem.ResetPlug();
|
||||
|
||||
// 关闭表达系统视图
|
||||
expressionManager.CloseView();
|
||||
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.Expression);
|
||||
yield return UIManager.Instance.GetPanel<PlayToolPanel>().FadeOutAsync(0.5f);
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.BodyModule);
|
||||
yield return TimelineCenter.Instance.PlayTimelineAsync("透镜/透镜out");
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,11 +128,15 @@ namespace AibisDream.MiniGame.Language
|
||||
/// <summary>
|
||||
/// 播放进入动画,并在完成后释放控制权(禁用 Animator),
|
||||
/// 以便 SliderController 等代码控制滑片等物件。
|
||||
/// 完成后激活 SliderController,使其接受滑片控制并显示等离子体。
|
||||
/// </summary>
|
||||
public IEnumerator PlaySaleViewEnterAnimationAndReleaseWhenDone()
|
||||
{
|
||||
if (saleViewEnterAnimation != null)
|
||||
yield return saleViewEnterAnimation.PlayEnterAnimationAndReleaseWhenDone();
|
||||
// if (saleViewEnterAnimation != null)
|
||||
// yield return saleViewEnterAnimation.PlayEnterAnimationAndReleaseWhenDone();
|
||||
// // 进入动画完成,激活滑片控制(等离子体与 Slider 才接受控制)
|
||||
yield return TimelineCenter.Instance.PlayTimelineAsync("步进模式/进入步进模式");
|
||||
sliderController?.SetControlActive(true);
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
@@ -416,7 +420,7 @@ namespace AibisDream.MiniGame.Language
|
||||
if (saleView != null)
|
||||
{
|
||||
saleView.SetActive(true);
|
||||
// saleViewEnterAnimation?.PlayEnterAnimation();
|
||||
sliderController?.SetPlasmaActive(true); // OpenView 时等离子体激活,360° 满弧
|
||||
Debug.Log("[SalesManager] 销售系统已打开");
|
||||
}
|
||||
else
|
||||
@@ -431,6 +435,8 @@ namespace AibisDream.MiniGame.Language
|
||||
public void CloseView()
|
||||
{
|
||||
UnsubscribeFromCrankSlider();
|
||||
sliderController?.SetControlActive(false);
|
||||
sliderController?.SetPlasmaActive(false);
|
||||
saleViewEnterAnimation?.ResetToIdle();
|
||||
if (saleView != null)
|
||||
{
|
||||
|
||||
@@ -91,6 +91,13 @@ namespace AibisDream.MiniGame.HuoShan
|
||||
[Tooltip("滑片滑动到目标位置完成时触发")]
|
||||
public UnityEvent onSlideComplete;
|
||||
|
||||
[Header("控制激活")]
|
||||
[Tooltip("等离子体是否激活:OpenView 时设为 true,显示 360° 满弧")]
|
||||
[SerializeField] private bool isPlasmaActive = false;
|
||||
|
||||
[Tooltip("滑片控制是否激活:进入动画完成后由 SalesManager 调用 SetControlActive(true),才接受 SlideTo 等")]
|
||||
[SerializeField] private bool isControlActive = false;
|
||||
|
||||
[Header("调试测试")]
|
||||
[Tooltip("勾选后,拖拽下方滑块可直接测试滑片与弧线(Play 模式下生效,优先于程序控制)")]
|
||||
[SerializeField] private bool useTestSlider;
|
||||
@@ -126,8 +133,12 @@ namespace AibisDream.MiniGame.HuoShan
|
||||
|
||||
private void Update()
|
||||
{
|
||||
UpdateSliderPosition();
|
||||
UpdatePlasmaGlow();
|
||||
if (isControlActive)
|
||||
UpdateSliderPosition();
|
||||
if (isPlasmaActive)
|
||||
UpdatePlasmaGlow(isControlActive ? null : (float?)1f); // 未接受控制时固定 360° 满弧
|
||||
else if (plasmaParticleSystem != null && _particles != null && _particles.Length > 0)
|
||||
plasmaParticleSystem.SetParticles(_particles, 0); // 未激活时清空,避免 OpenView 前乱点
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
@@ -290,8 +301,7 @@ namespace AibisDream.MiniGame.HuoShan
|
||||
_particlePhases[i] = (float)i / maxParticleCount;
|
||||
}
|
||||
|
||||
ps.Play();
|
||||
ps.Emit(maxParticleCount);
|
||||
// 不在此处 Emit,避免 OpenView 前出现乱点;首次 isPlasmaActive 时由 UpdatePlasmaGlow 再 Emit
|
||||
}
|
||||
|
||||
private void ApplyPlasmaMaterial(ParticleSystemRenderer renderer)
|
||||
@@ -343,11 +353,12 @@ namespace AibisDream.MiniGame.HuoShan
|
||||
return _generatedSoftCircleTexture;
|
||||
}
|
||||
|
||||
private void UpdatePlasmaGlow()
|
||||
/// <param name="progressOverride">若不为 null,则用此值作为进度(如 OpenView 时固定 360° 满弧=1)</param>
|
||||
private void UpdatePlasmaGlow(float? progressOverride = null)
|
||||
{
|
||||
if (plasmaParticleSystem == null || ringCenter == null || _particles == null) return;
|
||||
|
||||
float progress = Mathf.Clamp01(_currentAngle / slideAngleRange);
|
||||
float progress = progressOverride ?? Mathf.Clamp01(_currentAngle / slideAngleRange);
|
||||
|
||||
// 进度为 0 时隐藏粒子
|
||||
if (progress <= 0.001f)
|
||||
@@ -356,9 +367,10 @@ namespace AibisDream.MiniGame.HuoShan
|
||||
return;
|
||||
}
|
||||
|
||||
// 顺时针:弧线从 startAngleOffset 向负角度延伸
|
||||
// 弧线跨度由 progress 决定(360° 时 progress=1)
|
||||
float effectiveAngle = progress * slideAngleRange;
|
||||
float startRad = -startAngleOffset * Mathf.Deg2Rad;
|
||||
float endRad = -(startAngleOffset + _currentAngle) * Mathf.Deg2Rad;
|
||||
float endRad = -(startAngleOffset + effectiveAngle) * Mathf.Deg2Rad;
|
||||
float arcSpan = endRad - startRad;
|
||||
|
||||
float z = sliderTransform != null ? sliderTransform.position.z : ringCenter.position.z;
|
||||
@@ -367,8 +379,10 @@ namespace AibisDream.MiniGame.HuoShan
|
||||
int aliveCount = plasmaParticleSystem.GetParticles(_particles);
|
||||
if (aliveCount == 0)
|
||||
{
|
||||
plasmaParticleSystem.Play();
|
||||
plasmaParticleSystem.Emit(maxParticleCount);
|
||||
return;
|
||||
aliveCount = plasmaParticleSystem.GetParticles(_particles);
|
||||
if (aliveCount == 0) return;
|
||||
}
|
||||
|
||||
// 随进度在 min~max 间平滑过渡粒子数量
|
||||
@@ -490,11 +504,34 @@ namespace AibisDream.MiniGame.HuoShan
|
||||
|
||||
#region 公共方法
|
||||
|
||||
/// <summary>
|
||||
/// 设置等离子体是否激活。OpenView 时调用 SetPlasmaActive(true),显示 360° 满弧。
|
||||
/// </summary>
|
||||
public void SetPlasmaActive(bool active)
|
||||
{
|
||||
isPlasmaActive = active;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置滑片控制是否激活。进入动画完成后由 SalesManager 调用 SetControlActive(true),
|
||||
/// 此后才接受 SlideTo/SlideToSegment 等控制。
|
||||
/// </summary>
|
||||
public void SetControlActive(bool active)
|
||||
{
|
||||
isControlActive = active;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 控制是否已激活
|
||||
/// </summary>
|
||||
public bool IsControlActive => isControlActive;
|
||||
|
||||
/// <summary>
|
||||
/// 移动到指定角度
|
||||
/// </summary>
|
||||
public void SlideTo(float angle, float duration = 0.5f)
|
||||
{
|
||||
if (!isControlActive) return;
|
||||
angle = Mathf.Clamp(angle, 0f, slideAngleRange);
|
||||
|
||||
if (_moveTween != null)
|
||||
|
||||
Reference in New Issue
Block a user