2022-06-13 16:08:49 +02:00
|
|
|
using System.Text.RegularExpressions;
|
2022-06-13 09:51:59 +02:00
|
|
|
using TMPro;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
public class Notification : MonoBehaviour
|
|
|
|
|
{
|
2023-10-16 12:29:07 +03:00
|
|
|
[SerializeField] private Image _notification = default;
|
2022-11-28 02:57:32 +02:00
|
|
|
[SerializeField] private TextMeshProUGUI _notificationText = default;
|
|
|
|
|
[Header("Notification Colors")]
|
|
|
|
|
[SerializeField] private Color _punishColor = Color.red;
|
|
|
|
|
[SerializeField] private Color _knockdownColor = Color.blue;
|
|
|
|
|
[SerializeField] private Color _softKnockdownColor = Color.blue;
|
|
|
|
|
[SerializeField] private Color _crossUpColor = Color.yellow;
|
|
|
|
|
[SerializeField] private Color _guardBreakColor = Color.yellow;
|
|
|
|
|
[SerializeField] private Color _reversalColor = Color.yellow;
|
|
|
|
|
[SerializeField] private Color _wallSplatColor = Color.yellow;
|
|
|
|
|
[SerializeField] private Color _throwBreakColor = Color.white;
|
2023-09-05 11:44:57 +03:00
|
|
|
[SerializeField] private Color _lockColor = Color.white;
|
2022-06-13 09:51:59 +02:00
|
|
|
|
2022-11-28 02:57:32 +02:00
|
|
|
public void SetNotification(NotificationTypeEnum notificationType)
|
|
|
|
|
{
|
|
|
|
|
_notificationText.text = Regex.Replace(notificationType.ToString(), "([a-z])([A-Z])", "$1 $2");
|
2023-04-16 18:48:18 +03:00
|
|
|
switch (notificationType)
|
2022-11-28 02:57:32 +02:00
|
|
|
{
|
2023-04-16 18:48:18 +03:00
|
|
|
case NotificationTypeEnum.Punish:
|
2023-10-16 12:29:07 +03:00
|
|
|
_notification.color = _punishColor;
|
2023-04-16 18:48:18 +03:00
|
|
|
break;
|
|
|
|
|
case NotificationTypeEnum.Knockdown:
|
|
|
|
|
_notificationText.text = "H.Knockdown";
|
2023-10-16 12:29:07 +03:00
|
|
|
_notification.color = _knockdownColor;
|
2023-04-16 18:48:18 +03:00
|
|
|
break;
|
|
|
|
|
case NotificationTypeEnum.CrossUp:
|
2023-10-16 12:29:07 +03:00
|
|
|
_notification.color = _crossUpColor;
|
2023-04-16 18:48:18 +03:00
|
|
|
break;
|
|
|
|
|
case NotificationTypeEnum.GuardBreak:
|
2023-10-16 12:29:07 +03:00
|
|
|
_notification.color = _guardBreakColor;
|
2023-04-16 18:48:18 +03:00
|
|
|
break;
|
|
|
|
|
case NotificationTypeEnum.Reversal:
|
2023-10-16 12:29:07 +03:00
|
|
|
_notification.color = _reversalColor;
|
2023-04-16 18:48:18 +03:00
|
|
|
break;
|
|
|
|
|
case NotificationTypeEnum.WallSplat:
|
2023-10-16 12:29:07 +03:00
|
|
|
_notification.color = _wallSplatColor;
|
2023-04-16 18:48:18 +03:00
|
|
|
break;
|
|
|
|
|
case NotificationTypeEnum.ThrowBreak:
|
2023-10-16 12:29:07 +03:00
|
|
|
_notification.color = _throwBreakColor;
|
2023-04-16 18:48:18 +03:00
|
|
|
break;
|
2023-09-05 11:44:57 +03:00
|
|
|
case NotificationTypeEnum.Lock:
|
2023-10-16 12:29:07 +03:00
|
|
|
_notification.color = _lockColor;
|
2023-09-05 11:44:57 +03:00
|
|
|
break;
|
2023-04-16 18:48:18 +03:00
|
|
|
case NotificationTypeEnum.SoftKnockdown:
|
|
|
|
|
_notificationText.text = "S.Knockdown";
|
2023-10-16 12:29:07 +03:00
|
|
|
_notification.color = _softKnockdownColor;
|
2023-04-16 18:48:18 +03:00
|
|
|
break;
|
2022-11-28 02:57:32 +02:00
|
|
|
}
|
|
|
|
|
}
|
2022-06-13 09:51:59 +02:00
|
|
|
}
|