Skip to content

Commit 238daf3

Browse files
committed
more robust message popup animation trigger
1 parent 9ffb11e commit 238daf3

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

Packages/Sequence-Unity/Sequence/Samples~/Demo/Resources/Prefabs/EcosystemWallet/Profile/EcosystemWalletProfile.prefab

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,10 +354,9 @@ MonoBehaviour:
354354
m_OnClick:
355355
m_PersistentCalls:
356356
m_Calls:
357-
- m_Target: {fileID: 5446996412557963390}
358-
m_TargetAssemblyTypeName: Sequence.Boilerplates.SequenceEcosystemWalletWindow,
359-
SequenceExamples
360-
m_MethodName:
357+
- m_Target: {fileID: 7406499202603429039}
358+
m_TargetAssemblyTypeName: Sequence.Boilerplates.EcosystemWalletProfile, SequenceBoilerplates
359+
m_MethodName: CopySignature
361360
m_Mode: 1
362361
m_Arguments:
363362
m_ObjectArgument: {fileID: 0}

Packages/Sequence-Unity/Sequence/SequenceBoilerplates/Scripts/Common/MessagePopup.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ public class MessagePopup : MonoBehaviour
1818

1919
public void Show(string message, bool error = false)
2020
{
21+
gameObject.SetActive(true);
22+
if (!gameObject.activeInHierarchy)
23+
{
24+
Debug.LogWarning($"Could not start animation because {name} is inactive in this hierarchy.");
25+
return;
26+
}
27+
2128
_tweenAnimation ??= GetComponent<ITween>();
2229
_tweenAnimation.AnimateIn(0.3f);
2330

@@ -32,6 +39,13 @@ public void Show(string message, bool error = false)
3239

3340
public void Hide()
3441
{
42+
if (!gameObject.activeInHierarchy)
43+
{
44+
Debug.LogWarning($"Could not start animation because {name} is inactive in this hierarchy.");
45+
gameObject.SetActive(false);
46+
return;
47+
}
48+
3549
_tweenAnimation.AnimateOut(0.3f);
3650
}
3751

Packages/Sequence-Unity/Sequence/SequenceBoilerplates/Scripts/EcosystemWallet/EcosystemWalletProfile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ private void ShowSignature(string signature)
9898
private void ShowError(string error)
9999
{
100100
Debug.LogError(error);
101-
_messagePopup.Show(error, true);
102101
SetLoading(false);
102+
_messagePopup.Show(error, true);
103103
}
104104

105105
private void SetLoading(bool value)

0 commit comments

Comments
 (0)