From d67e53ae6cb3136b8e1836978b93a3021460ba29 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期四, 25 十二月 2025 16:56:16 +0800
Subject: [PATCH] Merge branch 'master' of http://mobile.secondworld.net.cn:10010/r/Project_SG_scripts
---
Main/Component/UI/Common/SkeletonIllusionShadow.cs | 54 +++++++++++++++++++++++++++++++++---------------------
1 files changed, 33 insertions(+), 21 deletions(-)
diff --git a/Main/Component/UI/Common/SkeletonIllusionShadow.cs b/Main/Component/UI/Common/SkeletonIllusionShadow.cs
index 6deefb6..52471c3 100644
--- a/Main/Component/UI/Common/SkeletonIllusionShadow.cs
+++ b/Main/Component/UI/Common/SkeletonIllusionShadow.cs
@@ -13,37 +13,40 @@
private readonly List<GameObject> illusionShadows = new List<GameObject>();
private SkeletonAnimation skeletonAnimation;
+ private Color color = Color.white;
+
private bool createSwitch = false;
private int curFrame = 0;
- private int frameInteral = 2;
+ private int frameInteral = 6;
public void SetSkeletonAnimation(SkeletonAnimation _skeletonAnimation)
{
skeletonAnimation = _skeletonAnimation;
}
- public void Show(bool v)
+ public void Show(bool v, Color _color = default)
{
createSwitch = v;
curFrame = 0;
+ color = _color;
if (!v)
{
// 娓呯悊鎵�鏈夋畫褰卞璞�
- for (int i = illusionShadows.Count - 1; i >= 0; i--)
- {
- var go = illusionShadows[i];
- if (go != null)
- {
- DOTween.Kill(go, complete: false);
- if (Application.isPlaying)
- Destroy(go);
- else
- DestroyImmediate(go);
- }
- }
- illusionShadows.Clear();
+ // for (int i = illusionShadows.Count - 1; i >= 0; i--)
+ // {
+ // var go = illusionShadows[i];
+ // if (go != null)
+ // {
+ // DOTween.Kill(go, complete: false);
+ // if (Application.isPlaying)
+ // Destroy(go);
+ // else
+ // DestroyImmediate(go);
+ // }
+ // }
+ // illusionShadows.Clear();
}
}
@@ -89,19 +92,28 @@
playedEntry.TrackTime = trackEntry.TrackTime;
sa.timeScale = 0;
- sa.AnimationState.TimeScale = 0;
- playedEntry.TimeScale = 0;
RendererAdjuster parent = skeletonAnimation.GetComponentInParent<RendererAdjuster>();
- objTest.AddMissingComponent<RendererAdjuster>().SetSortingOrder(parent.sortingOrder);
- sa.skeleton.A = skeletonAnimation.skeleton.A;
+ if (parent == null)
+ {
+ BattleDebug.LogError("SkeletonIllusionShadow 鍒涘缓娈嬪奖澶辫触锛屾壘涓嶅埌 RendererAdjuster 缁勪欢");
+ GameObject.DestroyImmediate(objTest);
+ return;
+ }
+
+ objTest.AddMissingComponent<RendererAdjuster>().SetSortingOrder(parent.sortingOrder - 1);
+
+ sa.skeleton.R = color.r;
+ sa.skeleton.G = color.g;
+ sa.skeleton.B = color.b;
+ sa.skeleton.A = 0.5F; //skeletonAnimation.skeleton.A;
// 浣跨敤DoTween鍋歛lpha娣″嚭锛孴ween涓巓bjTest缁戝畾锛屼究浜庣粺涓�Kill
- DOTween.To(() => sa.skeleton.A, x => { sa.skeleton.A = x; sa.LateUpdate(); }, 0f, 0.5f)
+ DOTween.To(() => sa.skeleton.A, x => { sa.skeleton.A = x; sa.LateUpdate(); }, 0f, 1f)
.SetTarget(objTest);
// 瀹夊叏閿�姣侊紝绉婚櫎寮曠敤
- _ = DestroyIllusionShadowAfterAsync(objTest, 0.5f);
+ _ = DestroyIllusionShadowAfterAsync(objTest, 1f);
}
--
Gitblit v1.8.0