导入odin
This commit is contained in:
21
Assets/Obvious/Soap/Examples/Content/Scripts/AutoDisabler.cs
Normal file
21
Assets/Obvious/Soap/Examples/Content/Scripts/AutoDisabler.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Obvious.Soap.Example
|
||||
{
|
||||
|
||||
|
||||
public class AutoDisabler : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private float _duration = 0.5f;
|
||||
|
||||
public void OnEnable()
|
||||
{
|
||||
Invoke(nameof(Disable),_duration);
|
||||
}
|
||||
|
||||
private void Disable()
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user