添加插件
This commit is contained in:
26
Assets/Obvious/Soap/Examples/Content/Scripts/HealVignette.cs
Normal file
26
Assets/Obvious/Soap/Examples/Content/Scripts/HealVignette.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Obvious.Soap.Example
|
||||
{
|
||||
[HelpURL("https://obvious-game.gitbook.io/soap/scene-documentation/4_scriptableevents/registering-to-events-from-code")]
|
||||
public class HealVignette : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private ScriptableEventInt _onPlayerHealedEvent = null;
|
||||
[SerializeField] private FadeOut _fadeOut = null;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_onPlayerHealedEvent.OnRaised += OnPlayerHealed;
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
_onPlayerHealedEvent.OnRaised -= OnPlayerHealed;
|
||||
}
|
||||
|
||||
private void OnPlayerHealed(int amount)
|
||||
{
|
||||
_fadeOut.Activate();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user