初始化

This commit is contained in:
come
2025-07-26 16:56:42 +08:00
parent 8291dbb91c
commit fa81439a8c
2574 changed files with 328492 additions and 2170 deletions

View File

@@ -0,0 +1,40 @@
using Cysharp.Threading.Tasks;
using DG.Tweening;
using UnityEngine;
namespace YIUIFramework
{
/// <summary>
/// 简单的窗口动画
/// </summary>
public static class WindowFadeAnim
{
private static Vector3 m_AnimScale = new Vector3(0.8f, 0.8f, 0.8f);
//淡入
public static async UniTask In(UIBase uiBase, float time = 0.25f)
{
var obj = uiBase?.OwnerGameObject;
if (obj == null) return;
uiBase.SetActive(true);
obj.transform.localScale = m_AnimScale;
await obj.transform.DOScale(Vector3.one, time);
}
//淡出
public static async UniTask Out(UIBase uiBase, float time = 0.25f)
{
var obj = uiBase?.OwnerGameObject;
if (obj == null) return;
obj.transform.localScale = Vector3.one;
await obj.transform.DOScale(m_AnimScale, time);
uiBase.SetActive(false);
obj.transform.localScale = Vector3.one;
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 0cb517a7f20e40aa9f4803d50395e1c0
timeCreated: 1684120651