From 370f79a25aa838d9c1f8be8f66bcf8c23dbad51e Mon Sep 17 00:00:00 2001
From: bottlefish <781230111@qq.com>
Date: Thu, 26 Feb 2026 17:17:36 +0800
Subject: [PATCH] =?UTF-8?q?feat(huoshan):=20=E6=B7=BB=E5=8A=A0=E9=94=80?=
=?UTF-8?q?=E5=94=AE=E8=A7=86=E5=9B=BE=E8=BF=9B=E5=9C=BA=E5=8A=A8=E7=94=BB?=
=?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=99=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../SalesSystem/SaleViewEnterAnimation.cs | 60 +++++++++++++++++++
.../SaleViewEnterAnimation.cs.meta | 11 ++++
2 files changed, 71 insertions(+)
create mode 100644 Assets/Scripts/MiniGame/HuoShan/SalesSystem/SaleViewEnterAnimation.cs
create mode 100644 Assets/Scripts/MiniGame/HuoShan/SalesSystem/SaleViewEnterAnimation.cs.meta
diff --git a/Assets/Scripts/MiniGame/HuoShan/SalesSystem/SaleViewEnterAnimation.cs b/Assets/Scripts/MiniGame/HuoShan/SalesSystem/SaleViewEnterAnimation.cs
new file mode 100644
index 000000000..2c0f24ff5
--- /dev/null
+++ b/Assets/Scripts/MiniGame/HuoShan/SalesSystem/SaleViewEnterAnimation.cs
@@ -0,0 +1,60 @@
+using UnityEngine;
+
+namespace AibisDream.MiniGame.HuoShan
+{
+ ///
+ /// SaleView 进入动画控制器
+ /// 负责在进入销售系统时播放进入动画,包括:
+ /// 1. 轨道底座组伸张
+ /// 2. 内环和外边框放大
+ /// 3. 滑片从缩着变为伸出(帧动画 c→b→a)
+ /// 4. 夹片淡入
+ /// 默认保持初始(缩起)状态,进入时播放。
+ ///
+ [RequireComponent(typeof(Animator))]
+ public class SaleViewEnterAnimation : MonoBehaviour
+ {
+ private const string AnimParamTriggerEnter = "Enter";
+
+ [Header("Animator 配置")]
+ [Tooltip("Animator Controller(带 Idle/Enter 两个状态)")]
+ [SerializeField] private RuntimeAnimatorController animatorController;
+
+ private Animator _animator;
+ private int _triggerEnterId;
+
+ private void Awake()
+ {
+ _animator = GetComponent();
+ if (animatorController != null)
+ _animator.runtimeAnimatorController = animatorController;
+ _triggerEnterId = Animator.StringToHash(AnimParamTriggerEnter);
+ }
+
+ private void OnEnable()
+ {
+ // 确保初始状态为 Idle(缩起)
+ _animator.Rebind();
+ _animator.Update(0f);
+ }
+
+ ///
+ /// 播放进入动画(进入销售系统时调用)
+ ///
+ public void PlayEnterAnimation()
+ {
+ if (_animator == null || !_animator.enabled) return;
+ _animator.SetTrigger(_triggerEnterId);
+ }
+
+ ///
+ /// 重置到初始状态(可用于关闭时重置)
+ ///
+ public void ResetToIdle()
+ {
+ if (_animator == null) return;
+ _animator.Rebind();
+ _animator.Update(0f);
+ }
+ }
+}
diff --git a/Assets/Scripts/MiniGame/HuoShan/SalesSystem/SaleViewEnterAnimation.cs.meta b/Assets/Scripts/MiniGame/HuoShan/SalesSystem/SaleViewEnterAnimation.cs.meta
new file mode 100644
index 000000000..05bfc1e2b
--- /dev/null
+++ b/Assets/Scripts/MiniGame/HuoShan/SalesSystem/SaleViewEnterAnimation.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 7a2b3c4d5e6f7890abcdef1234567890
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant: