Browse Source

换装优化

guodong 1 năm trước cách đây
mục cha
commit
33c82e6e18

+ 61 - 14
GameClient/Assets/Game/HotUpdate/Assets/PrefabManager.cs

@@ -1,14 +1,25 @@
-using System.Threading.Tasks;
+using GFGGame.Launcher;
+using System.Threading.Tasks;
 using UniFramework.Pooling;
 using UnityEngine;
 using YooAsset;
+using System.Collections.Generic;
 
 namespace GFGGame
 {
-    public class PrefabManager : SingletonBase<PrefabManager>
+    public class PrefabManager : SingletonMonoBase<PrefabManager>
     {
         private Spawner _entitySpawner;
 
+        private GameObject preDrawRoot;
+        private Dictionary<string, List<GameObject>> preDrawDic = new Dictionary<string, List<GameObject>>();
+
+        private void Awake()
+        {
+            preDrawRoot = new GameObject("PredrawToot");
+            preDrawRoot.transform.position = new Vector3(100, 0, 0);
+        }
+
         public void Init()
         {
             // 创建游戏对象发生器
@@ -17,6 +28,11 @@ namespace GFGGame
 
         public GameObject SpawnSync(string resPath)
         {
+            var t = GetPreDrawObj(resPath);
+            if(t != null)
+            {
+                return t;
+            }
             if (!YooAssets.CheckResExist(resPath))
             {
                 return null;
@@ -32,19 +48,19 @@ namespace GFGGame
             return handle.GameObj;
         }
 
-        public async Task<GameObject> SpawnAsync(string resPath)
-        {
-            if (!_entitySpawner.IsGameObjectPoolExisted(resPath))
-            {
-                // 创建游戏对象池,销毁时间单位为秒
-                _entitySpawner.CreateGameObjectPoolSync(resPath, false, 0, 1, 60);
-            }
+        //public async Task<GameObject> SpawnAsync(string resPath)
+        //{
+        //    if (!_entitySpawner.IsGameObjectPoolExisted(resPath))
+        //    {
+        //        // 创建游戏对象池,销毁时间单位为秒
+        //        _entitySpawner.CreateGameObjectPoolAsync(resPath, false, 0, 1, 60);
+        //    }
 
-            SpawnHandle handle = _entitySpawner.SpawnAsync(resPath);
-            await handle.Task;
-            AssetReleaserHelper.AddReleaserToSpawnObj(handle.GameObj, resPath, handle);
-            return handle.GameObj;
-        }
+        //    SpawnHandle handle = _entitySpawner.SpawnAsync(resPath);
+        //    await handle.Task;
+        //    AssetReleaserHelper.AddReleaserToSpawnObj(handle.GameObj, resPath, handle);
+        //    return handle.GameObj;
+        //}
 
         public GameObject InstantiateSync(string resPath)
         {
@@ -85,5 +101,36 @@ namespace GFGGame
                 }
             }
         }
+
+        public void PreDraw(string resPath)
+        {
+            preDrawDic.TryGetValue(resPath, out var list);
+            if(list == null)
+            {
+                list = new List<GameObject>();
+                preDrawDic[resPath] = list;
+            }
+            var t = PrefabManager.Instance.SpawnSync(resPath);
+            t.transform.SetParent(preDrawRoot.transform, false);
+            list.Add(t);
+        }
+
+        public GameObject GetPreDrawObj(string resPath)
+        {
+            preDrawDic.TryGetValue(resPath, out var list);
+            if (list == null)
+            {
+                return null;
+            }
+            if(list.Count > 0)
+            {
+                int index = list.Count - 1;
+                var t = list[index];
+                list.RemoveAt(index);
+                return t;
+            }
+            return null;
+        }
+
     }
 }

+ 11 - 0
GameClient/Assets/Game/HotUpdate/DressUp/DressUpBodyOffsetInfo.cs

@@ -0,0 +1,11 @@
+using UnityEngine;
+
+namespace GFGGame
+{
+    public class DressUpBodyOffsetInfo : MonoBehaviour
+    {
+        public Vector3 OffsetPosition;
+        public Quaternion Rotation;
+
+    }
+}

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Live2d/Live2dAnimationManager.cs.meta → GameClient/Assets/Game/HotUpdate/DressUp/DressUpBodyOffsetInfo.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: ca015150a731cfa4ca9db9961508d317
+guid: e32dfc8330e1d3546950e83b654b9ad9
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 2 - 19
GameClient/Assets/Game/HotUpdate/DressUp/DressUpLayerOperation.cs

@@ -27,7 +27,6 @@ namespace GFGGame
         private ResourceDownloaderOperation downloaderOperation;
         private EAction actionType;
 
-        private List<GameObject> preloadList = new List<GameObject>();
         private string[] locationsLoading;
 
         public DressUpLayerOperation(GameObject parentObj, bool needSetMask, bool showAni, string resPath, string effectResPath)
@@ -102,7 +101,6 @@ namespace GFGGame
                 return;
             }
             ViewManager.Hide<ModalStatusView>();
-            TryFinishPreDraw();
 
             switch (actionType)
             {
@@ -122,7 +120,6 @@ namespace GFGGame
 
         internal override void Release()
         {
-            TryFinishPreDraw();
             downloaderOperation = null;
             this.itemCfg = null;
             this.parentObj = null;
@@ -218,8 +215,7 @@ namespace GFGGame
                     //设置预渲染帧数
                     preRendering = PRE_RENDER_FRAME;
                     //预渲染
-                    var t = Live2dAnimationManager.Instance.PreDraw(resPath);
-                    preloadList.Add(t);
+                    PrefabManager.Instance.PreDraw(resPath);
                     //Debug.Log($"PreDraw    {resPath} {TimeHelper.ClientNow()}");
                     return;
                 }
@@ -228,19 +224,6 @@ namespace GFGGame
             Status = EOperationStatus.Succeed;
         }
 
-        private void TryFinishPreDraw()
-        {
-            if(preloadList == null)
-            {
-                return;
-            }
-            foreach (var t in preloadList)
-            {
-                Live2dAnimationManager.Instance.FinishPreDrawed(t);
-            }
-            preloadList.Clear();
-            preloadList = null;
-        }
 
         private void UpdateLayer()
         {
@@ -287,7 +270,7 @@ namespace GFGGame
                 DressUpUtil.AddSpriteObj(this.resPath, spritObjName, parentObj, sortingOrder, needSetMask);
                 if (removeBodyAni)
                 {
-                    parentObj.transform.SetPositionAndRotation(new Vector3(), new Quaternion());
+                    parentObj.transform.SetPositionAndRotation(Vector3.zero, Quaternion.identity); 
                 }
             }
             if (!string.IsNullOrEmpty(effectResPath))

+ 1 - 0
GameClient/Assets/Game/HotUpdate/DressUp/DressUpObjUI.cs

@@ -62,6 +62,7 @@ namespace GFGGame
                 return;
             }
             wrapper.wrapTarget = sceneObject;
+            //wrapper.CacheRenderers();
         }
     }
 }

+ 12 - 231
GameClient/Assets/Game/HotUpdate/DressUp/DressUpUtil.cs

@@ -20,67 +20,6 @@ namespace GFGGame
         public const string FORMAT_ANIMATION_NAME = "T{0}_a{1}";
         public const string FORMAT_EFFECT_OBJ_NAME = "T{0}_e{1}";
 
-        //public static void AddItem(int itemID, GameObject sceneObj, bool needSetMask = false, bool showAni = true, GameObject parentObj = null, int resLayer = 0)
-        //{
-        //    ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemID);
-        //    if (itemCfg == null) return;
-
-        //    if (parentObj == null)
-        //    {
-        //        if (itemCfg.subType == ConstDressUpItemType.BEI_JING || DressUpMenuItemCfg1Array.Instance.CheckIsSceneTypeBySubType(itemCfg.subType))
-        //        {
-        //            parentObj = sceneObj;
-        //        }
-        //        else
-        //        {
-        //            //角色
-        //            Transform role = sceneObj.transform.Find(ROLE_OBJ_NAME);
-        //            parentObj = role.gameObject;
-        //        }
-        //    }
-        //    showAni = showAni || itemCfg.subType == ConstDressUpItemType.ZHUANG_RONG;
-        //    if (resLayer > 0)
-        //    {
-        //        string layerName = "";
-        //        switch (resLayer)
-        //        {
-        //            case 1:
-        //                layerName = itemCfg.resLayer1;
-        //                break;
-        //            case 2:
-        //                layerName = itemCfg.resLayer2;
-        //                break;
-        //            case 3:
-        //                layerName = itemCfg.resLayer3;
-        //                break;
-        //        }
-        //        if (!string.IsNullOrEmpty(layerName))
-        //        {
-        //            UpdateLayerRes(itemCfg, parentObj, resLayer, needSetMask, showAni);
-        //        }
-        //    }
-        //    else
-        //    {
-        //        //普通层
-        //        if (!string.IsNullOrEmpty(itemCfg.resLayer1))
-        //        {
-        //            UpdateLayerRes(itemCfg, parentObj, 1, needSetMask, showAni);
-        //        }
-        //        //第二层
-        //        if (!string.IsNullOrEmpty(itemCfg.resLayer2))
-        //        {
-
-        //            UpdateLayerRes(itemCfg, parentObj, 2, needSetMask, showAni);
-        //        }
-        //        //第三层
-        //        if (!string.IsNullOrEmpty(itemCfg.resLayer3))
-        //        {
-
-        //            UpdateLayerRes(itemCfg, parentObj, 3, needSetMask, showAni);
-        //        }
-        //    }
-        //}
-
         public static List<DressUpLayerOperation> AddItemAsync(int itemID, GameObject sceneObj, bool needSetMask = false, bool showAni = true, GameObject parentObj = null, int resLayer = 0)
         {
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemID);
@@ -213,32 +152,6 @@ namespace GFGGame
             return operation;
         }
 
-        //public static void UpdateHead(bool show, GameObject sceneObj, bool needSetMask = false, GameObject parentObj = null)
-        //{
-        //    var roleTf = sceneObj.transform.Find(ROLE_OBJ_NAME);
-        //    parentObj = parentObj == null ? roleTf.gameObject : parentObj;
-        //    string resPath = ResPathUtil.GetDressUpPath(HEAD_DEFAULT_RES_NAME);
-
-        //    Transform transform_t = parentObj.transform.Find(HEAD_SPRITE_NAME);
-        //    if (show)
-        //    {
-        //        if (transform_t != null)
-        //        {
-        //            transform_t.gameObject.SetActive(true);
-        //            return;
-        //        }
-        //        AddSpriteObj(resPath, HEAD_SPRITE_NAME, parentObj, 1, needSetMask);
-        //    }
-        //    else
-        //    {
-        //        if (transform_t == null)
-        //        {
-        //            return;
-        //        }
-        //        transform_t.gameObject.SetActive(false);
-        //    }
-        //}
-
         public static DressUpLayerOperation UpdateHeadAsync(bool show, GameObject sceneObj, bool needSetMask = false, GameObject parentObj = null)
         {
             var roleTf = sceneObj.transform.Find(ROLE_OBJ_NAME);
@@ -256,52 +169,6 @@ namespace GFGGame
             return handler;
         }
 
-        //public static void UpdateBody(string actionRes, GameObject sceneObj, bool needSetMask = false, GameObject parentObj = null)
-        //{
-        //    //角色
-        //    var roleTf = sceneObj.transform.Find(ROLE_OBJ_NAME);
-        //    parentObj = parentObj == null ? roleTf.gameObject : parentObj;
-
-        //    var extPng = "png";
-        //    if (!string.IsNullOrEmpty(actionRes))
-        //    {
-        //        string resPath = ResPathUtil.GetDressUpAnimationPath(actionRes);
-        //        if (GetGameObjExisted(parentObj, BODY_ANIMATION_NAME, resPath) != null)
-        //        {
-        //            return;
-        //        }
-        //    }
-        //    else
-        //    {
-        //        string resPath = ResPathUtil.GetDressUpPath(BODY_DEFAULT_RES_NAME, extPng);
-        //        if (GetGameObjExisted(parentObj, BODY_SPRITE_NAME, resPath) != null)
-        //        {
-        //            return;
-        //        }
-        //    }
-
-        //    var removeBodyAni = TryRemoveObj(parentObj, BODY_ANIMATION_NAME);
-        //    TryRemoveObj(parentObj, BODY_EFFECT_OBJ_NAME);
-        //    TryRemoveObj(parentObj, BODY_SPRITE_NAME);
-        //    if (!string.IsNullOrEmpty(actionRes))
-        //    {
-
-        //        string aniResPath = ResPathUtil.GetDressUpAnimationPath(actionRes);
-        //        var addAniObj = AddAnimationObj(aniResPath, BODY_ANIMATION_NAME, parentObj, 0);
-        //        //特效
-        //        var resPath = ResPathUtil.GetDressUpEffectPath(actionRes, addAniObj != null);
-        //        TryAddEffectObj(resPath, BODY_EFFECT_OBJ_NAME, parentObj, 0);
-        //    }
-        //    else
-        //    {
-        //        AddSpriteObj(ResPathUtil.GetDressUpPath(BODY_DEFAULT_RES_NAME), BODY_SPRITE_NAME, parentObj, 0, needSetMask);
-        //        if (removeBodyAni)
-        //        {
-        //            parentObj.transform.SetPositionAndRotation(new Vector3(), new Quaternion());
-        //        }
-        //    }
-        //}
-
         public static DressUpLayerOperation UpdateBodyAsync(string actionRes, GameObject sceneObj, bool needSetMask = false, GameObject parentObj = null)
         {
             //角色
@@ -348,80 +215,6 @@ namespace GFGGame
             return handler;
         }
 
-        //private static void UpdateLayerRes(ItemCfg itemCfg, GameObject parentObj, int layerId, bool needSetMask, bool showAni = true)
-        //{
-        //    string res = ResPathUtil.GetDressUpItemLayerRes(itemCfg, layerId);
-        //    string resPath = ResPathUtil.GetDressUpPath(itemCfg, layerId);
-        //    int sortingOrder = ItemTypeCfgArray.Instance.GetSortingOrder(itemCfg.subType, layerId);
-
-        //    //清理旧的
-        //    var spritObjName = string.Format(FORMAT_SPRITE_NAME, itemCfg.subType, layerId);
-        //    TryRemoveObj(parentObj, spritObjName);
-        //    var objName = string.Format(FORMAT_ANIMATION_NAME, itemCfg.subType, layerId);
-        //    TryRemoveObj(parentObj, objName);
-        //    string ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType);
-        //    GameObject spriteObj = null;
-        //    if (DressUpMenuItemCfg1Array.Instance.CheckIsDefaultType(itemCfg.subType))
-        //    {
-        //        //默认类型的部件需要先添加静态图,防止加载动画有延迟,出现光头
-        //        spriteObj = AddSpriteObj(resPath, spritObjName, parentObj, sortingOrder, needSetMask);
-        //    }
-
-        //    GameObject addAniObj = null;
-        //    if (showAni)
-        //    {
-        //        string aniResPath = ResPathUtil.GetDressUpAnimationPath(res);
-        //        addAniObj = AddAnimationObj(aniResPath, objName, parentObj, sortingOrder);
-        //        if (addAniObj != null && spriteObj != null)
-        //        {
-        //            var dressUpPart = addAniObj.GetComponent<DressUpPart>();
-        //            if (dressUpPart == null)
-        //            {
-        //                dressUpPart = addAniObj.AddComponent<DressUpPart>();
-        //            }
-        //            dressUpPart.OnTimer = (obj) =>
-        //            {
-        //                if (parentObj != null && parentObj.transform != null)
-        //                {
-        //                    string resPath = ResPathUtil.GetDressUpPath(itemCfg, layerId);
-        //                    spriteObj = GetGameObjExisted(parentObj, spritObjName, resPath);
-        //                    if (spriteObj != null)
-        //                    {
-        //                        PrefabManager.Instance.Restore(spriteObj);
-        //                    }
-
-        //                    //Transform tf = parentObj.transform.Find(spritObjName);
-        //                    //if (tf != null && tf.gameObject != null && tf.gameObject.activeInHierarchy)
-        //                    //{
-        //                    //    var assetDisposer = tf.gameObject.GetComponent<AssetReleaser>();
-        //                    //    if (assetDisposer != null)
-        //                    //    {
-        //                    //        if (!string.IsNullOrEmpty(assetDisposer.resPath))
-        //                    //        {
-        //                    //            string resPath = ResPathUtil.GetDressUpPath(itemCfg, layerId);
-        //                    //            if (assetDisposer.resPath == resPath)
-        //                    //            {
-        //                    //                TryRemoveObj(parentObj, spritObjName);
-        //                    //            }
-        //                    //        }
-        //                    //    }
-        //                    //}
-        //                }
-        //            };
-        //            Timers.inst.Add(0.03f, 1, dressUpPart.OnTimer);
-        //        }
-        //    }
-        //    if (spriteObj == null && addAniObj == null)
-        //    {
-        //        //如果两个都没有,就添加静态图
-        //        spriteObj = AddSpriteObj(resPath, spritObjName, parentObj, sortingOrder, needSetMask);
-        //    }
-        //    objName = string.Format(FORMAT_EFFECT_OBJ_NAME, itemCfg.subType, layerId);
-        //    TryRemoveObj(parentObj, objName);
-        //    resPath = ResPathUtil.GetDressUpEffectPath(res, addAniObj != null);
-        //    TryAddEffectObj(resPath, objName, parentObj, sortingOrder);
-        //}
-
         private static DressUpLayerOperation UpdateLayerResAsync(ItemCfg itemCfg, GameObject parentObj, int layerId, bool needSetMask, bool showAni = true)
         {
             string res = ResPathUtil.GetDressUpItemLayerRes(itemCfg, layerId);
@@ -524,15 +317,24 @@ namespace GFGGame
                 return gameObj;
             }
             gameObj = PrefabManager.Instance.SpawnSync(resPath);
-            if(gameObj == null)
+            if (gameObj == null)
             {
                 return null;
             }
             if (objName == BODY_ANIMATION_NAME)
             {
+                DressUpBodyOffsetInfo dressUpBodyOffsetInfo = gameObj.GetComponent<DressUpBodyOffsetInfo>();
+                if(dressUpBodyOffsetInfo == null)
+                {
+                    dressUpBodyOffsetInfo = gameObj.AddComponent<DressUpBodyOffsetInfo>();
+                    dressUpBodyOffsetInfo.OffsetPosition = gameObj.transform.localPosition;
+                    dressUpBodyOffsetInfo.Rotation = gameObj.transform.localRotation;
+                }
                 //如果是动作动画,就根据动画位置及角度信息设置给Role对象
-                parentObj.transform.SetPositionAndRotation(gameObj.transform.localPosition, gameObj.transform.localRotation);
-                gameObj.transform.SetPositionAndRotation(new Vector3(), new Quaternion());
+                parentObj.transform.SetPositionAndRotation(dressUpBodyOffsetInfo.OffsetPosition, dressUpBodyOffsetInfo.Rotation);
+                gameObj.transform.localPosition = Vector3.zero;
+                gameObj.transform.rotation = Quaternion.identity;
+                //.SetPositionAndRotation(Vector3.zero, Quaternion.identity); 
             }
             gameObj.name = objName;
             gameObj.transform.SetParent(parentObj.transform, false);
@@ -649,18 +451,14 @@ namespace GFGGame
         {
             int index = resPath.LastIndexOf('.');
             resPath = resPath.Substring(0, index) + ".bytes";
-            //resPath = resPath.Replace(".png", ".bytes");
-            //resPath = resPath.Replace(".jpg", ".bytes");
             if (YooAssets.CheckResExist(resPath))
             {
-                //var asset = GFGAsset.Load<TextAsset>(resPath);
                 var handle = YooAssets.LoadAssetSync<TextAsset>(resPath);
                 TextAsset asset = handle.AssetObject as TextAsset;
                 var st = new MemoryStream(asset.bytes);
                 var br = new BinaryReader(st);
                 tx = br.ReadInt32() / 100f;
                 ty = -br.ReadInt32() / 100f;
-                //GFGAsset.Release(resPath);
                 handle.Release();
             }
             else
@@ -706,23 +504,6 @@ namespace GFGGame
                 }
             }
         }
-        //public static void SetSpriteRenderSortingOrder(GameObject gameObj, int sortingOrder, bool isAdd = false)
-        //{
-        //    SpriteRenderer[] spriteRenders = gameObj.transform.GetComponentsInChildren<SpriteRenderer>();
-        //    for (int i = 0; i < spriteRenders.Length; i++)
-        //    {
-
-        //        if (isAdd)
-        //        {
-        //            spriteRenders[i].sortingOrder = spriteRenders[i].sortingOrder + sortingOrder;
-        //        }
-        //        else
-        //        {
-
-        //            spriteRenders[i].sortingOrder = sortingOrder;
-        //        }
-        //    }
-        //}
     }
 
 }

+ 0 - 8
GameClient/Assets/Game/HotUpdate/Live2d.meta

@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: 63f511c35f3f81548b6e91cb2890def0
-folderAsset: yes
-DefaultImporter:
-  externalObjects: {}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 27
GameClient/Assets/Game/HotUpdate/Live2d/Live2dAnimationManager.cs

@@ -1,27 +0,0 @@
-using GFGGame.Launcher;
-using UnityEngine;
-
-namespace GFGGame
-{
-    public class Live2dAnimationManager : SingletonMonoBase<Live2dAnimationManager>
-    {
-        private GameObject preDrawRoot;
-        private void Awake()
-        {
-            preDrawRoot = new GameObject("Live2dAnimationManager");
-            preDrawRoot.transform.position = new Vector3(100, 0, 0);
-        }
-
-        public GameObject PreDraw(string resPath)
-        {
-            var t = PrefabManager.Instance.SpawnSync(resPath);
-            t.transform.SetParent(preDrawRoot.transform, false);
-            return t;
-        }
-
-        public void FinishPreDrawed(GameObject t)
-        {
-            PrefabManager.Instance.Restore(t);
-        }
-    }
-}

+ 4 - 3
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryDialogView.cs

@@ -173,6 +173,7 @@ namespace GFGGame
                 PrefabManager.Instance.Restore(_sceneObject);
                 _sceneObject = null;
             }
+            _dressUpObjUI.dressUpObj.TakeOffAll();
             MusicManager.Instance.PlayCroutine(ResPathUtil.GetMusicPath(ConstMusicName.DEFAULT));
             _onCompleteStoryDialogCall = null;
             _onCompleteStoryDialogCallParam = null;
@@ -463,17 +464,17 @@ namespace GFGGame
                     }
                     else
                     {
-                        _dressUpObjUI.dressUpObj.PutOnDressUpData(CustomSuitDataManager.GetCurrentSuitData().dressUpData);
+                        _dressUpObjUI.dressUpObj.PutOnDressUpData(CustomSuitDataManager.GetCurrentSuitData().dressUpData, new int[] { ConstDressUpItemType.SHOU_CHI_WU });
                         if (_dressUpObjUI.dressUpObj.actionId > 0)
                         {
                             _dressUpObjUI.dressUpObj.CancelAction(true);
                         }
-                        _dressUpObjUI.dressUpObj.PutOnDressUpData(_dressUpObjUI.dressUpObj.DressUpDataClone(), new int[] { ConstDressUpItemType.SHOU_CHI_WU });
+                        //_dressUpObjUI.dressUpObj.PutOnDressUpData(_dressUpObjUI.dressUpObj.DressUpDataClone(), new int[] { ConstDressUpItemType.SHOU_CHI_WU });
                     }
                     if (headAniCfg != null && headAniCfg.faceId > 0)
                     {
                         //表情
-                        _dressUpObjUI.dressUpObj.AddOrRemove(headAniCfg.faceId, false);
+                        _dressUpObjUI.dressUpObj.AddOrRemove(headAniCfg.faceId, true);
                         _dressUpObjUI.UpdateWrapper(_ui.m_dialogHead.m_compDressUp.m_holder);
                     }
                 }

+ 3 - 3
GameClient/Assets/UniFramework/UniPooling/Runtime/GameObjectPool.cs

@@ -217,10 +217,10 @@ namespace UniFramework.Pooling
 		{
 			if (gameObj != null)
 			{
+                gameObj.transform.SetParent(_root.transform, false);
+                //gameObj.transform.SetPositionAndRotation(Vector3.zero, Quaternion.identity);
 				gameObj.SetActive(false);
-				gameObj.transform.SetParent(_root.transform);
-				gameObj.transform.SetPositionAndRotation(Vector3.zero, Quaternion.identity);
-			}
+            }
 		}
 	}
 }

+ 1 - 1
GameClient/Assets/UniFramework/UniPooling/Runtime/SpawnHandle.cs

@@ -85,7 +85,7 @@ namespace UniFramework.Pooling
 
 				// 设置参数	
 				_operation.Result.transform.SetParent(_parent);
-				_operation.Result.transform.SetPositionAndRotation(_position, _rotation);
+				//_operation.Result.transform.SetPositionAndRotation(_position, _rotation);
 				_operation.Result.SetActive(true);
 
 				_steps = ESteps.Done;