Commit 3924fd11 authored by SherryChaos's avatar SherryChaos

bug fix

parent 87102988
...@@ -72239,7 +72239,7 @@ RectTransform: ...@@ -72239,7 +72239,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0.000030517578} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 300} m_SizeDelta: {x: 0, y: 300}
m_Pivot: {x: 0.5, y: 1} m_Pivot: {x: 0.5, y: 1}
--- !u!1 &1117266860 --- !u!1 &1117266860
...@@ -97569,7 +97569,7 @@ MonoBehaviour: ...@@ -97569,7 +97569,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 2083794100} m_HandleRect: {fileID: 2083794100}
m_Direction: 2 m_Direction: 2
m_Value: 0 m_Value: 0
m_Size: 0.5588235 m_Size: 0.55882347
m_NumberOfSteps: 0 m_NumberOfSteps: 0
m_OnValueChanged: m_OnValueChanged:
m_PersistentCalls: m_PersistentCalls:
...@@ -144,7 +144,7 @@ namespace YgomGame.Bg ...@@ -144,7 +144,7 @@ namespace YgomGame.Bg
} }
effectSettings = new Dictionary<BgEffectSettingInner.AnimationLabelDefine, List<BgEffectSettingInner>>(); effectSettings = new Dictionary<BgEffectSettingInner.AnimationLabelDefine, List<BgEffectSettingInner>>();
for (int i = 1; i < 27; i++) for (int i = 0; i < 27; i++)
{ {
var labelDefine = (BgEffectSettingInner.AnimationLabelDefine)i; var labelDefine = (BgEffectSettingInner.AnimationLabelDefine)i;
var list = new List<BgEffectSettingInner>(); var list = new List<BgEffectSettingInner>();
...@@ -219,11 +219,30 @@ namespace YgomGame.Bg ...@@ -219,11 +219,30 @@ namespace YgomGame.Bg
animationLabel = param.animationLabel; animationLabel = param.animationLabel;
break; break;
} }
var animator = GetComponent<Animator>(); if (TryGetComponent<Animator>(out var animator))
if (animator != null) {
animator.SetTrigger(label.ToString()); animator.SetTrigger(label.ToString());
}
effectSettings.TryGetValue(BgEffectSettingInner.AnimationLabelDefine.None, out var settings);
if (settings != null)
foreach (var setting in settings)
if (setting != null && setting.gameObject != null)
{
setting.gameObject.SetActive(true);
setting.PlayEffect(label);
if (setting.particle != null)
setting.particle.Play();
if (setting.animator != null)
setting.animator.SetTrigger(label.ToString());
else
{
setting.gameObject.SetActive(false);
setting.gameObject.SetActive(true);
}
}
effectSettings.TryGetValue(animationLabel, out var settings); effectSettings.TryGetValue(animationLabel, out settings);
if (settings != null) if (settings != null)
foreach (var setting in settings) foreach (var setting in settings)
if (setting != null && setting.gameObject != null) if (setting != null && setting.gameObject != null)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment