Files
Continentis/Assets/Scripts/MainGame/Card/CardView/CardViewFunctions.cs
SoulliesOfficial 61a397dd4c MOD!
2025-10-23 00:49:44 -04:00

66 lines
2.0 KiB
C#

using DG.Tweening;
using UnityEngine;
namespace Continentis.MainGame.Card
{
public abstract partial class CardViewBase
{
Tweener hintShadowTweener;
Tweener selectShadowTweener;
public void ClearShadows()
{
hintShadowTweener?.Kill(true);
selectShadowTweener?.Kill(true);
hintShadow.gameObject.SetActive(false);
selectShadow.gameObject.SetActive(false);
}
public void TryDisableAllShadows(bool immediately = false)
{
DisableHintShadow(immediately);
DisableSelectShadow(immediately);
}
public void EnableHintShadow(Color shadowColor)
{
hintShadow.gameObject.SetActive(true);
hintShadow.color = Color.clear;
hintShadowTweener = hintShadow.DOColor(shadowColor, 0.2f).Play();
}
public void DisableHintShadow(bool immediately = false)
{
if (immediately)
{
hintShadowTweener?.Kill(true);
hintShadow.gameObject.SetActive(false);
}
else
{
hintShadowTweener = hintShadow.DOColor(Color.clear, 0.2f).OnComplete(() => { hintShadow.gameObject.SetActive(false); }).Play();
}
}
public void EnableSelectShadow()
{
selectShadow.gameObject.SetActive(true);
selectShadow.color = Color.clear;
selectShadowTweener = selectShadow.DOColor(new Color(0.33f, 0.66f, 1f), 0.2f).Play();
}
public void DisableSelectShadow(bool immediately = false)
{
if (immediately)
{
selectShadowTweener?.Kill(true);
selectShadow.gameObject.SetActive(false);
}
else
{
selectShadowTweener = selectShadow.DOColor(Color.clear, 0.2f).OnComplete(() => { selectShadow.gameObject.SetActive(false); }).Play();
}
}
}
}