导入odin

This commit is contained in:
2026-01-01 23:09:08 +08:00
parent 9ceffccd39
commit 04dd4a23b2
814 changed files with 120820 additions and 87 deletions

View File

@@ -0,0 +1,35 @@
using System.Collections;
using UnityEngine;
namespace Obvious.Soap.Example
{
[RequireComponent(typeof(CanvasGroup))]
public class FadeOut : CacheComponent<CanvasGroup>
{
[SerializeField] private float _duration = 0.5f;
private Coroutine _coroutine = null;
public void Activate()
{
if (_coroutine != null)
StopCoroutine(_coroutine);
_coroutine = StartCoroutine(Cr_FadeOut());
}
private IEnumerator Cr_FadeOut()
{
var timer = 0f;
_component.alpha = 1f;
while (timer <= _duration)
{
_component.alpha = Mathf.Lerp(1f, 0f, timer / _duration);
timer += Time.deltaTime;
yield return null;
}
_component.alpha = 0;
}
}
}