123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using DG.Tweening;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class ListButtonEffect : MonoBehaviour
- {
- public Vector3 v3Pos;
- public int index;
- // Start is called before the first frame update
- void Start()
- {
- }
- public void showMove()
- {
- if (v3Pos == Vector3.zero)
- v3Pos = this.transform.localPosition;
- LeanTween.moveLocal(this.gameObject, v3Pos, 0.25f);
- }
- public void hideMove()
- {
- LeanTween.moveLocal(this.gameObject,Vector3.zero,0.25f);
- }
- public void showEffect()
- {
- GameEffect.setAlpha(this.gameObject, 1, 0.25f);
- }
- public void hideEffect(Action<GameObject> callback=null)
- {
- GameEffect.setAlpha(this.gameObject, 0, 0.25f, callback);
- }
- private void OnEnable()
- {
- if (v3Pos == Vector3.zero)
- v3Pos = this.transform.localPosition;
- // Invoke("showEffect", 0.1f);
- showEffect();
- }
- // Update is called once per frame
- void Update()
- {
-
- }
- }
|