26 lines
590 B
C#
26 lines
590 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using DG.Tweening;
|
|
|
|
public class ScaleAniChild : MonoBehaviour
|
|
{
|
|
Vector3 _defaultScale = Vector3.one;
|
|
private void Awake()
|
|
{
|
|
_defaultScale = transform.localScale;
|
|
}
|
|
|
|
public void Hide()
|
|
{
|
|
transform.localScale = Vector3.zero;
|
|
}
|
|
|
|
public void Show(float delay, float aniLength, AnimationCurve cur)
|
|
{
|
|
transform.DOKill();
|
|
transform.localScale = Vector3.zero;
|
|
transform.DOScale(_defaultScale, aniLength).SetEase(cur).SetDelay(delay);
|
|
}
|
|
}
|