| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 | using FairyGUI;using UnityEngine;namespace GFGGame{    public class EffectUI    {        private GameObject _gameObject;        private GoWrapper _wrapper;        public bool isDisposed;        public void Reset(GGraph holder, string uiName, string resName, float scale = 100, EffectUIType effectUIType = EffectUIType.UI )        {            if (!isDisposed) Dispose();            isDisposed = false;            string resPath;            switch(effectUIType)            {                case EffectUIType.Card:                    resPath = ResPathUtil.GetCardAnimationPath(resName);                    break;                default:                    resPath = ResPathUtil.GetViewEffectPath(uiName, resName);                    break;            }            _gameObject = DressUpUtil.CreateAnimationObj(resPath);            if(_gameObject == null)            {                return;            }            _gameObject.transform.localScale = new Vector3(scale, scale, scale);            _wrapper = new GoWrapper(_gameObject);            holder.SetNativeObject(_wrapper);        }        public void Dispose()        {            isDisposed = true;            if (_gameObject != null)            {                GameObject.DestroyImmediate(_gameObject);                _gameObject = null;            }            if (_wrapper != null)            {                _wrapper.Dispose();            }        }    }}
 |