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) { if (!isDisposed) Dispose(); isDisposed = false; string resPath = ResPathUtil.GetViewEffectPath(uiName, resName); _gameObject = DressUpUtil.CreateAnimationObj(resPath); _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(); } } } }