forellenforderung3/Assets/RPGTALK/Scripts/Snippets/RPGTalkCanPassWarning.cs
Luca Wey c7940aa8ea Revert "Musik Anderswelt & Effekte"
This reverts commit 574b404c2db3de8f6612460326a6881ac85c9f61
2023-06-07 11:42:40 +02:00

38 lines
848 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
namespace RPGTALK.Snippets
{
[AddComponentMenu("Seize Studios/RPGTalk/Snippets/Can Pass Warning")]
public class RPGTalkCanPassWarning : MonoBehaviour
{
public UnityEvent OnCanPass, OnPassed;
RPGTalk rpgtalk;
// Start is called before the first frame update
void Start()
{
rpgtalk = GetComponent<RPGTalk>();
rpgtalk.OnEndAnimating += CanPass;
rpgtalk.OnPlayNext += Passed;
rpgtalk.OnEndTalk += Passed;
}
void CanPass()
{
if (rpgtalk.enablePass)
{
OnCanPass.Invoke();
}
}
void Passed()
{
OnPassed.Invoke();
}
}
}