1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- using Fort23.UTool;
- using UnityEngine;
- namespace Core.UI.UTool.UITween
- {
- [System.Serializable]
- public class TweenPlayFx : TweenBasic
- {
- protected bool isPalyFx;
- protected ParticleSystem[] particleSystems;
- public GameObject GetCanvasGroup(Object CanvasGroup)
- {
- GameObject graphic = CanvasGroup as GameObject;
- if (graphic == null)
- {
- GameObject gameObject = CanvasGroup as GameObject;
- if (gameObject != null)
- {
- graphic = gameObject;
- }
- }
- return graphic;
- }
- protected override void ProPlay(Object CanvasGroup, float allTime)
- {
- GameObject graphic = GetCanvasGroup(CanvasGroup);
- if (graphic == null)
- {
- return;
- }
- if (!isPalyFx)
- {
- particleSystems = graphic.transform.GetComponentsInChildren<ParticleSystem>();
-
- isPalyFx = true;
- for (int i = 0; i < particleSystems.Length; i++)
- {
- particleSystems[i].Stop();
- particleSystems[i].Clear(true);
- particleSystems[i].Play(true);
- }
- }
- }
- protected override void ProRest(Object CanvasGroup)
- {
- isPalyFx = false;
- }
- }
- }
|