-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathNotificationBar.cs
46 lines (38 loc) · 963 Bytes
/
NotificationBar.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class NotificationBar : MonoBehaviour
{
public Animator anim;
public TMP_Text NotificationText;
[HideInInspector]
public string NotificationBody;
public void startSequenceNotification()
{
StartCoroutine(NotificationRoutine());
}
public void dataParse()
{
NotificationText.text = NotificationBody;
}
public void OpenNotificationBar()
{
anim.Play("SlideIn");
}
public void CloseNotificationBar()
{
anim.Play("SlideOut");
}
IEnumerator NotificationRoutine()
{
dataParse();
yield return new WaitForSeconds(0.1f);
OpenNotificationBar();
yield return new WaitForSeconds(2);
CloseNotificationBar();
yield return new WaitForSeconds(1);
NotificationBody = "";
NotificationText.text = "";
}
}