| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 | 
							- using FairyGUI;
 
- using System;
 
- using UnityEngine;
 
- namespace GFGGame
 
- {
 
-     public class DressUpObjUI
 
-     {
 
-         public GameObject sceneObject;
 
-         public GoWrapper wrapper;
 
-         public DressUpObj dressUpObj;
 
-         string prefabName;
 
-         private Action onShowAction;
 
-         public DressUpObjUI(string prefabName = "SceneDressUp", Action onShowAction = null)
 
-         {
 
-             this.prefabName = prefabName;
 
-             this.onShowAction = onShowAction;
 
-             dressUpObj = new DressUpObj();
 
-             wrapper = new GoWrapper();
 
-         }
 
-         /// <summary>
 
-         /// 
 
-         /// </summary>
 
-         /// <param name="scale"></param>
 
-         /// <param name="needSetMask">如果UI界面的组件有遮罩,那么这里也需要设置为true才能生效</param>
 
-         /// <param name="showSceneType">是否显示场景道具类型</param>
 
-         /// <param name="roleObj"></param>
 
-         /// <param name="showBg">是否显示背景</param>
 
-         public void ResetSceneObj(int scale = 100, bool needSetMask = false, bool showSceneType = true, GameObject roleObj = null, bool showBg = true)
 
-         {
 
-             //这里每次都要实例化新的,复用会有bug
 
-             sceneObject = PrefabManager.Instance.InstantiateSync(ResPathUtil.GetPrefabPath(this.prefabName));
 
-             sceneObject.transform.localScale = new Vector3(scale, scale, scale);
 
-             dressUpObj.setSceneObj(sceneObject, needSetMask, showSceneType, roleObj, showBg, OnShow);
 
-         }
 
-         public void UpdateWrapper(GGraph holder)
 
-         {
 
-             holder.SetNativeObject(wrapper);
 
-             wrapper.wrapTarget = sceneObject;
 
-         }
 
-         
 
-         public void Dispose()
 
-         {
 
-             onShowAction = null;
 
-             if (sceneObject != null)
 
-             {
 
-                 PrefabManager.Instance.Restore(sceneObject);
 
-                 sceneObject = null;
 
-             }
 
-             if (dressUpObj != null)
 
-             {
 
-                 dressUpObj.Dispose();
 
-                 dressUpObj = null;
 
-             }
 
-             if (wrapper != null)
 
-             {
 
-                 if (wrapper.wrapTarget != null)
 
-                 {
 
-                     wrapper.wrapTarget = null;
 
-                 }
 
-                 wrapper.Dispose();
 
-                 wrapper = null;
 
-             }
 
-         }
 
-         private void OnShow()
 
-         {
 
-             onShowAction?.Invoke();
 
-             if (sceneObject == null)
 
-             {
 
-                 return;
 
-             }
 
-             if(wrapper != null)
 
-             {
 
-                 wrapper.wrapTarget = sceneObject;
 
-                 //wrapper.CacheRenderers();
 
-             }
 
-         }
 
-     }
 
- }
 
 
  |