Selaa lähdekoodia

Merge remote-tracking branch 'remotes/origin/master' into zhaoyang

# Conflicts:
#	GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryFightTargetView.cs
#	GameClient/Assets/ResIn/Config/excelConfig.sqlite.bytes
zhaoyang 2 vuotta sitten
vanhempi
commit
5245abc6c7

+ 1 - 1
GameClient/Assets/Editor/ArtsRes/ImportArtResTool.cs

@@ -239,7 +239,7 @@ namespace GFGEditor
             }
             foreach (string dir in sourceDirs)
             {
-                files = FileUtil.CopyFilesTo(dir, targetDir, saveName, new string[] { ".png", ".jpg", ".mp3", ".meta", ".mat", ".shader" }, ragule);
+                files = FileUtil.CopyFilesTo(dir, targetDir, saveName, new string[] { ".png", ".jpg", ".mp3", ".meta", ".mat", ".shader", ".tga" }, ragule);
                 foreach (var file in files)
                 {
                     Debug.LogFormat("更新{0}", file);

+ 5 - 0
GameClient/Assets/Game/HotUpdate/Data/VO/DressUpData.cs

@@ -9,6 +9,11 @@ namespace GFGGame
         public int actionId;
         public List<int> itemList = new List<int>();
 
+        public bool IsNew
+        {
+            get { return this.suitId <= 0 && this.actionId <= 0 && this.itemList.Count <= 0 && this.bgId <= 0; }
+        }
+
         public DressUpData Clone()
         {
             var dressUpData = new DressUpData();

+ 22 - 1
GameClient/Assets/Game/HotUpdate/DressUp/DressUpObj.cs

@@ -67,13 +67,34 @@ namespace GFGGame
             }
         }
 
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="sceneObj"></param>
+        /// <param name="needSetMask"></param>
+        /// <param name="showSceneType"></param>
+        /// <param name="roleObj"></param>
+        /// <param name="showBg"></param>
+        /// <param name="resetData">是否重置装备数据</param>
         public void setSceneObj(GameObject sceneObj, bool needSetMask = false, bool showSceneType = true, GameObject roleObj = null, bool showBg = true)
         {
+            if (_sceneObj != null && _sceneObj != sceneObj)
+            {
+                GameObject.Destroy(_sceneObj);
+            }
             _sceneObj = sceneObj;
             _needSetMask = needSetMask;
             _showSceneType = showSceneType;
             _showBg = showBg;
             _roleObj = roleObj;
+            if(_dressUpData.IsNew)
+            {
+                PutOnDefaultDressUpData();
+            }
+            else
+            {
+                UpdateRoleView();
+            }
         }
 
         public DressUpData DressUpDataClone()
@@ -266,7 +287,7 @@ namespace GFGGame
         }
 
         //刷新视图,用于新设置sceneobj后的初始显示
-        public void UpdateRoleView()
+        private void UpdateRoleView()
         {
             PutOnDressUpData(DressUpDataClone());
         }

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

@@ -0,0 +1,59 @@
+using FairyGUI;
+using UnityEngine;
+
+namespace GFGGame
+{
+    public class DressUpObjUI
+    {
+
+        private GameObject _scenePrefab;
+        public GameObject sceneObject;
+        public GoWrapper wrapper;
+        public DressUpObj dressUpObj;
+
+
+        public DressUpObjUI(string prefabName)
+        {
+            _scenePrefab = GFGAsset.Load<GameObject>(ResPathUtil.GetPrefabPath(prefabName));
+            dressUpObj = new DressUpObj();
+            wrapper = new GoWrapper();
+        }
+
+        public void ResetSceneObj(int scale = 100, bool needSetMask = false, bool showSceneType = true, GameObject roleObj = null, bool showBg = true)
+        {
+            sceneObject = GameObject.Instantiate(_scenePrefab);
+            sceneObject.transform.localScale = new Vector3(scale, scale, scale);
+            dressUpObj.setSceneObj(sceneObject, needSetMask, showSceneType, roleObj, showBg);
+        }
+
+        public void UpdateWrapper(GGraph holder)
+        {
+            holder.SetNativeObject(wrapper);
+            wrapper.wrapTarget = sceneObject;
+        }
+
+        public void Dispose()
+        {
+            //预制体不能被销毁
+            _scenePrefab = null;
+
+            if (sceneObject != null)
+            {
+                GameObject.Destroy(sceneObject);
+                sceneObject = null;
+            }
+
+            if (dressUpObj != null)
+            {
+                dressUpObj.Dispose();
+                dressUpObj = null;
+            }
+
+            if(wrapper != null)
+            {
+                wrapper.Dispose();
+                wrapper = null;
+            }
+        }
+    }
+}

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

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 57d7d9c0e0383154fbcf4970b9276d19
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 18 - 6
GameClient/Assets/Game/HotUpdate/DressUp/DressUpUtil.cs

@@ -27,7 +27,7 @@ namespace GFGGame
                 // GameObject parentObj = null;
                 if (parentObj == null)
                 {
-                    if (itemCfg.subType == ConstDressUpItemType.BEI_JING)
+                    if (itemCfg.subType == ConstDressUpItemType.BEI_JING || DressUpMenuItemCfg1Array.Instance.CheckIsSceneTypeBySubType(itemCfg.subType))
                     {
                         parentObj = sceneObj;
                     }
@@ -90,7 +90,7 @@ namespace GFGGame
             {
                 if (parentObj == null)
                 {
-                    if (itemCfg.subType == ConstDressUpItemType.BEI_JING)
+                    if (itemCfg.subType == ConstDressUpItemType.BEI_JING || DressUpMenuItemCfg1Array.Instance.CheckIsSceneTypeBySubType(itemCfg.subType))
                     {
                         parentObj = sceneObj;
                     }
@@ -167,7 +167,7 @@ namespace GFGGame
 
             //清理旧的
             TryClearSpriteObj(parentObj, BODY_SPRITE_NAME);
-            TryRemoveObj(parentObj, BODY_ANIMATION_NAME);
+            var removeBodyAni = TryRemoveObj(parentObj, BODY_ANIMATION_NAME);
             TryRemoveObj(parentObj, BODY_EFFECT_OBJ_NAME);
 
             if (isAni)
@@ -176,7 +176,11 @@ namespace GFGGame
             }
             else
             {
-                AddSpriteObj(res, "png", BODY_SPRITE_NAME, parentObj, 0, needSetMask);
+                AddSpriteObj(res, "png", BODY_SPRITE_NAME, parentObj, 0, needSetMask); 
+                if(removeBodyAni)
+                {
+                    parentObj.transform.SetPositionAndRotation(new Vector3(), new Quaternion());
+                }
             }
             //特效
             if (!string.IsNullOrEmpty(effRes))
@@ -361,6 +365,12 @@ namespace GFGGame
             var prefab = GFGAsset.Load<GameObject>(resPath);
             var gameObj = GameObject.Instantiate(prefab);
             AddAssetReleaser(gameObj, resPath);
+            if(objName == BODY_ANIMATION_NAME)
+            {
+                //如果是动作动画,就根据动画位置及角度信息设置给Role对象
+                parentObj.transform.SetPositionAndRotation(gameObj.transform.localPosition, gameObj.transform.localRotation);
+                gameObj.transform.SetPositionAndRotation(new Vector3(), new Quaternion());
+            }
             gameObj.name = objName;
             gameObj.transform.SetParent(parentObj.transform, false);
             var render = gameObj.GetComponent<CubismRenderController>();
@@ -380,11 +390,11 @@ namespace GFGGame
             return gameObj;
         }
 
-        private static void TryRemoveObj(GameObject parentObj, string aniObjName)
+        private static bool TryRemoveObj(GameObject parentObj, string aniObjName)
         {
             if (parentObj == null)
             {
-                return;
+                return false;
             }
             Transform transform = parentObj.transform.Find(aniObjName);
             if (transform != null)
@@ -393,8 +403,10 @@ namespace GFGGame
                 if (gameObj != null)
                 {
                     GameObject.DestroyImmediate(gameObj);
+                    return true;
                 }
             }
+            return false;
         }
 
         public static GameObject CreateAnimationObj(string resPath)

+ 10 - 35
GameClient/Assets/Game/HotUpdate/Views/ClothingFoster/ClothingView.cs

@@ -12,13 +12,9 @@ namespace GFGGame
     {
         private UI_ClothingUI _ui;
         private ValueBarController _valueBarController;
-        private GameObject _scenePrefab;
-        private GameObject _sceneObject;
-        private GoWrapper _wrapper;
+        private DressUpObjUI _dressUpObjUI;
         private GameObject _gameobject1;
         private GoWrapper _wrapper1;
-        private DressUpObj _dressUpObj;
-        private bool _actionIsPic;
 
         private List<int> _suitIds;//已解锁套装列表
         private SortedList _propertyList = new SortedList();
@@ -36,18 +32,16 @@ namespace GFGGame
                 _ui = null;
             }
             base.Dispose();
-            if (_sceneObject != null)
-            {
-                GameObject.Destroy(_sceneObject);
-                _sceneObject = null;
-                _wrapper.Dispose();
-                _wrapper = null;
-            }
             if (_valueBarController != null)
             {
                 _valueBarController.Dispose();
                 _valueBarController = null;
             }
+            if(_dressUpObjUI != null)
+            {
+                _dressUpObjUI.Dispose();
+                _dressUpObjUI = null;
+            }
             SceneController.DestroyObjectFromView(_gameobject1, _wrapper1);
             _propertyList.Clear();
             _addPropertyList.Clear();
@@ -65,8 +59,7 @@ namespace GFGGame
             isfullScreen = true;
             // this.clickBlankToClose = false;
             _valueBarController = new ValueBarController(_ui.m_valueBar);
-            _scenePrefab = GFGAsset.Load<GameObject>(ResPathUtil.GetPrefabPath("SceneSuitFoster"));
-            _dressUpObj = new DressUpObj();
+            _dressUpObjUI = new DressUpObjUI("SceneSuitFoster");
 
             _ui.m_btnBack.onClick.Add(OnClickBtnBack);
             _ui.m_btnLeft.onClick.Add(() => { OnClickBtnDirection(-1); });
@@ -172,29 +165,11 @@ namespace GFGGame
 
         private void UpdateSuitView(bool isPic = true)
         {
-            _actionIsPic = isPic;
             SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(_suitId);
             _ui.m_txtName.text = suitCfg.name;
-            if (_sceneObject != null)
-            {
-                GameObject.Destroy(_sceneObject);
-                _sceneObject = null;
-            }
-            _sceneObject = GameObject.Instantiate(_scenePrefab);
-            int scale = 100;
-            _sceneObject.transform.localScale = new Vector3(scale, scale, scale);
-            _dressUpObj.setSceneObj(_sceneObject, false, true, null, false);
-            _dressUpObj.PutOnDefaultDressUpData();
-            _dressUpObj.PutOnSuitCfg(_suitId, isPic, new int[] { ConstDressUpItemType.BEI_JING });
-            if (_wrapper == null)
-            {
-                _wrapper = new GoWrapper(_sceneObject);
-                _ui.m_holder.SetNativeObject(_wrapper);
-            }
-            else
-            {
-                _wrapper.wrapTarget = _sceneObject;
-            }
+            _dressUpObjUI.ResetSceneObj(100, false, true, null, false);
+            _dressUpObjUI.dressUpObj.PutOnSuitCfg(_suitId, isPic, new int[] { ConstDressUpItemType.BEI_JING });
+            _dressUpObjUI.UpdateWrapper(_ui.m_holder);
         }
         private void OnClickBtnDirection(int direction)
         {

+ 8 - 49
GameClient/Assets/Game/HotUpdate/Views/ClothingShop/ClothingShopView.cs

@@ -17,10 +17,7 @@ namespace GFGGame
         private readonly int[] HEAD_Y_ARR = new int[] { ConstDressUpItemType.FA_XING, ConstDressUpItemType.NEI_DA, ConstDressUpItemType.SHANG_YI, ConstDressUpItemType.TOU_SHI, ConstDressUpItemType.ER_SHI, ConstDressUpItemType.JING_SHI };
         private readonly int[] SHOES_Y_ARR = new int[] { ConstDressUpItemType.XIA_ZHUANG, ConstDressUpItemType.WA_ZI, ConstDressUpItemType.XIE_ZI, ConstDressUpItemType.SHOU_SHI, ConstDressUpItemType.YAO_SHI };
         private UI_ClothingShopUI _ui;
-        private GameObject _scenePrefab;
-        private GameObject _sceneObject;
-        private GoWrapper _wrapper;
-        private DressUpObj _dressUpObj;
+        private DressUpObjUI _dressUpObjUI;
         private ValueBarController _valueBarController;
         private List<ShopCfg> _dataList;
         private GImage _comSelected;
@@ -44,26 +41,15 @@ namespace GFGGame
                 _valueBarController = null;
             }
 
-            if (_sceneObject != null)
-            {
-                GameObject.Destroy(_sceneObject);
-                _sceneObject = null;
-            }
-
-            if (_wrapper != null)
-            {
-                _wrapper.Dispose();
-                _wrapper = null;
-            }
             if (_comSelected != null)
             {
                 _comSelected.RemoveFromParent();
                 _comSelected.Dispose();
             }
-            if (_dressUpObj != null)
+            if (_dressUpObjUI != null)
             {
-                _dressUpObj.Dispose();
-                _dressUpObj = null;
+                _dressUpObjUI.Dispose();
+                _dressUpObjUI = null;
             }
             _cfgSelected = null;
 
@@ -85,8 +71,7 @@ namespace GFGGame
             isfullScreen = true;
 
             _valueBarController = new ValueBarController(_ui.m_valueBar);
-            _scenePrefab = GFGAsset.Load<GameObject>(ResPathUtil.GetPrefabPath("SceneDressUp"));
-            _dressUpObj = new DressUpObj();
+            _dressUpObjUI = new DressUpObjUI("SceneDressUp");
 
             _comSelected = new GImage();
             _comSelected.x = -5;
@@ -199,15 +184,6 @@ namespace GFGGame
         {
             base.OnHide();
             _valueBarController.OnHide();
-            if (_sceneObject != null)
-            {
-                GameObject.Destroy(_sceneObject);
-                _sceneObject = null;
-            }
-            if (_wrapper != null)
-            {
-                _wrapper.wrapTarget = null;
-            }
             _selectedItemId = 0;
             Timers.inst.Remove(CheckGuide);
 
@@ -254,26 +230,9 @@ namespace GFGGame
         }
         private void UpdateRole(bool tween)
         {
-            if (_sceneObject != null)
-            {
-                GameObject.Destroy(_sceneObject);
-                _sceneObject = null;
-            }
-            _sceneObject = GameObject.Instantiate(_scenePrefab);
-            int scale = 70;
-            _sceneObject.transform.localScale = new Vector3(scale, scale, scale);
-            _dressUpObj.setSceneObj(_sceneObject, false, true, null, false);
-            _dressUpObj.PutOnDefaultDressUpData();
-            _dressUpObj.AddOrRemove(_cfgSelected.itemID, true);
-            if (_wrapper == null)
-            {
-                _wrapper = new GoWrapper(_sceneObject);
-                _ui.m_compHolder.m_compMover.m_holder.SetNativeObject(_wrapper);
-            }
-            else
-            {
-                _wrapper.wrapTarget = _sceneObject;
-            }
+            _dressUpObjUI.ResetSceneObj(70, false, true, null, false);
+            _dressUpObjUI.dressUpObj.AddOrRemove(_cfgSelected.itemID, true);
+            _dressUpObjUI.UpdateWrapper(_ui.m_compHolder.m_compMover.m_holder);
             int type = ItemUtilCS.GetItemSubType(_cfgSelected.itemID);
             float duration = DURATION;
             if (!tween)

+ 13 - 48
GameClient/Assets/Game/HotUpdate/Views/ClothingSynthetic/ClothingSyntheticView.cs

@@ -34,10 +34,7 @@ namespace GFGGame
         private readonly int[] SHOES_Y_ARR = new int[] { ConstDressUpItemType.WA_ZI, ConstDressUpItemType.XIE_ZI };
 
         private UI_ClothingSyntheticUI _ui;
-        private GameObject _scenePrefab;
-        private GameObject _sceneObject;
-        private GoWrapper _wrapper;
-        private DressUpObj _dressUpObj;
+        private DressUpObjUI _dressUpObjUI;
         private ValueBarController _valueBarController;
         private GImage _imgSelected;
         private int _suitId;
@@ -57,26 +54,16 @@ namespace GFGGame
                 _valueBarController.Dispose();
                 _valueBarController = null;
             }
-            if (_sceneObject != null)
-            {
-                GameObject.Destroy(_sceneObject);
-                _sceneObject = null;
-            }
 
             if (_imgSelected != null)
             {
                 _imgSelected.RemoveFromParent();
                 _imgSelected.Dispose();
             }
-            if (_dressUpObj != null)
+            if (_dressUpObjUI != null)
             {
-                _dressUpObj.Dispose();
-                _dressUpObj = null;
-            }
-            if (_wrapper != null)
-            {
-                _wrapper.Dispose();
-                _wrapper = null;
+                _dressUpObjUI.Dispose();
+                _dressUpObjUI = null;
             }
 
             if (_ui != null)
@@ -99,8 +86,7 @@ namespace GFGGame
 
             _valueBarController = new ValueBarController(_ui.m_valueBar);
 
-            _scenePrefab = GFGAsset.Load<GameObject>(ResPathUtil.GetPrefabPath("SceneDressUpSynthetic"));
-            _dressUpObj = new DressUpObj();
+            _dressUpObjUI = new DressUpObjUI("SceneDressUpSynthetic");
 
             _imgSelected = new GImage();
             _imgSelected = UIPackage.CreateObject(UI_ClothingSyntheticUI.PACKAGE_NAME, "hc_kuang_4").asImage;
@@ -139,15 +125,6 @@ namespace GFGGame
         {
             base.OnHide();
             _valueBarController.OnHide();
-            if (_sceneObject != null)
-            {
-                GameObject.Destroy(_sceneObject);
-                _sceneObject = null;
-            }
-            if (_wrapper != null)
-            {
-                _wrapper.wrapTarget = null;
-            }
             _ui.m_listMaterias.selectedIndex = 0;
             Timers.inst.Remove(CheckGuide);
 
@@ -224,26 +201,9 @@ namespace GFGGame
 
         private void UpdateRole(bool tween)
         {
-            if (_sceneObject != null)
-            {
-                GameObject.Destroy(_sceneObject);
-                _sceneObject = null;
-            }
-            _sceneObject = GameObject.Instantiate(_scenePrefab);
-            int scale = 45;
-            _sceneObject.transform.localScale = new Vector3(scale, scale, scale);
-            _dressUpObj.setSceneObj(_sceneObject, true, true, null, false);
-            _dressUpObj.PutOnDefaultDressUpData();
-            _dressUpObj.AddOrRemove(_selectedItemId, true);
-            if (_wrapper == null)
-            {
-                _wrapper = new GoWrapper(_sceneObject);
-                _ui.m_compHolder.m_compMover.m_holder.SetNativeObject(_wrapper);
-            }
-            else
-            {
-                _wrapper.wrapTarget = _sceneObject;
-            }
+            _dressUpObjUI.ResetSceneObj(45, true, true, null, false);
+            _dressUpObjUI.dressUpObj.AddOrRemove(_selectedItemId, true);
+            _dressUpObjUI.UpdateWrapper(_ui.m_compHolder.m_compMover.m_holder);
             int type = ItemUtilCS.GetItemSubType(_selectedItemId);
             float duration = DURATION;
             if (!tween)
@@ -344,6 +304,11 @@ namespace GFGGame
             ItemCfg clothingSyntheticCfg = ItemCfgArray.Instance.GetCfg(_selectedItemId);
             // string costName = ItemUtil.GetItemName(clothingSyntheticCfg.syntheticCostID);
             // _ui.m_txtCost.SetVar("v1", "" + clothingSyntheticCfg.syntheticCostNum).SetVar("v2", costName).FlushVars();
+            if(clothingSyntheticCfg.syntheticCostID <= 0)
+            {
+                Log.Error($"请为物品 {clothingSyntheticCfg.id} 增加合成相关配置!");
+                return;
+            }
             ItemUtil.SetItemNeedNum(_ui.m_comCostCurrency, clothingSyntheticCfg.syntheticCostID, clothingSyntheticCfg.syntheticCostNum);
             _materiarsOfSelectedItem = ItemUtil.CreateItemDataList(clothingSyntheticCfg.syntheticMateriarsArr);
             _ui.m_listMaterias.numItems = _materiarsOfSelectedItem.Count;

+ 12 - 59
GameClient/Assets/Game/HotUpdate/Views/CommonGame/GetSuitItemVIew.cs

@@ -8,33 +8,23 @@ namespace GFGGame
     public class GetSuitItemVIew : BaseWindow
     {
         private UI_GetSuitItemUI _ui;
-        private GameObject _scenePrefab;
-        private GameObject _sceneObject;
-        private GoWrapper _wrapper;
         private GameObject _gameObject1;
         private GoWrapper _wrapper1;
-        private DressUpObj _dressUpObj;
+        private DressUpObjUI _dressUpObjUI;
 
-        private int guideId = 0;//0:没有引导 1:首次获得套装2:首次获得套装部件
         public override void Dispose()
         {
-            if (_sceneObject != null)
-            {
-                GameObject.Destroy(_sceneObject);
-                _sceneObject = null;
-            }
-
             SceneController.DestroyObjectFromView(_gameObject1, _wrapper1);
-            if (_wrapper != null)
+            if (_dressUpObjUI != null)
             {
-                _wrapper.Dispose();
-                _wrapper = null;
+                _dressUpObjUI.Dispose();
+                _dressUpObjUI = null;
             }
 
-            if (_dressUpObj != null)
+            if (_dressUpObjUI != null)
             {
-                _dressUpObj.Dispose();
-                _dressUpObj = null;
+                _dressUpObjUI.Dispose();
+                _dressUpObjUI = null;
             }
             if (_ui != null)
             {
@@ -51,8 +41,7 @@ namespace GFGGame
             this.viewCom = _ui.target;
             isfullScreen = true;
 
-            _scenePrefab = GFGAsset.Load<GameObject>(ResPathUtil.GetPrefabPath("SceneDressUp"));
-            _dressUpObj = new DressUpObj();
+            _dressUpObjUI = new DressUpObjUI("SceneDressUp");
             _ui.m_bg.onClick.Add(OnClickBg);
 
             string resPath = ResPathUtil.GetViewEffectPath("ui_ck", "ui_ck_tz");
@@ -65,22 +54,12 @@ namespace GFGGame
             base.OnShown();
             GRoot.inst.touchable = true;
             int suitId = (int)viewData;
-            guideId = 0;
             UpdateView(suitId);
         }
 
         protected override void OnHide()
         {
             base.OnHide();
-            if (_sceneObject != null)
-            {
-                GameObject.Destroy(_sceneObject);
-                _sceneObject = null;
-            }
-            if (_wrapper != null)
-            {
-                _wrapper.wrapTarget = null;
-            }
             if (this.viewCom == null || this.viewCom.root == null)
             {
 
@@ -142,40 +121,14 @@ namespace GFGGame
                 SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(suitId);
                 _ui.m_txtName.text = "套装·" + suitCfg.name;
                 int targetY = (int)(_ui.m_item.y + _ui.m_item.height + 50);
-                if (count == totalCount)
-                {
-                    guideId = 1;
-                }
-                else
-                {
-                    guideId = 2;
-                }
             }
             _ui.m_probar.max = totalCount;
             _ui.m_probar.value = count;
             // UpdateItem(itemId);
-            if (_sceneObject != null)
-            {
-                GameObject.Destroy(_sceneObject);
-                _sceneObject = null;
-            }
-            _sceneObject = GameObject.Instantiate(_scenePrefab);
-            int scale = 70;
-            _sceneObject.transform.localScale = new Vector3(scale, scale, scale);
-
-            _dressUpObj.setSceneObj(_sceneObject, false, true, null,  false);
-            _dressUpObj.PutOnDefaultDressUpData();
-            _dressUpObj.PutOnSuitCfg(suitId, false, new int[] { ConstDressUpItemType.BEI_JING }, false, false);
-            if (_wrapper == null)
-            {
-                _wrapper = new GoWrapper(_sceneObject);
-                _ui.m_holder.SetNativeObject(_wrapper);
-            }
-            else
-            {
-                _wrapper.wrapTarget = _sceneObject;
-            }
-
+            
+            _dressUpObjUI.ResetSceneObj(70, false, true, null,  false);
+            _dressUpObjUI.dressUpObj.PutOnSuitCfg(suitId, false, new int[] { ConstDressUpItemType.BEI_JING }, false, false);
+            _dressUpObjUI.UpdateWrapper(_ui.m_holder);
         }
     }
 }

+ 1 - 5
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpView.cs

@@ -131,8 +131,8 @@ namespace GFGGame
             if (_sceneObject == null)
             {
                 _sceneObject = GameObject.Instantiate(_scenePrefab);
-                MyDressUpHelper.dressUpObj.setSceneObj(_sceneObject);
             }
+            MyDressUpHelper.dressUpObj.setSceneObj(_sceneObject);
             _ui.m_comboBox.selectedIndex = CustomSuitDataManager.currentIndex;
             MyDressUpHelper.PutOnSuitSavedByPos(CustomSuitDataManager.currentIndex);
             // UpdateStepBtn();
@@ -145,7 +145,6 @@ namespace GFGGame
             base.OnHide();
             listTypeItem_FreedomDress = null;
             // MusicManager.Instance.Play(ResPathUtil.GetMusicPath(ConstMusicName.DEFAULT));
-            MyDressUpHelper.dressUpObj.setSceneObj(_sceneObject);//在拍照界面断线返回登录,需要重新设置_sceneObject
             MyDressUpHelper.dressUpObj.TakeOffAll();
 
             if (_sceneObject != null)
@@ -985,9 +984,6 @@ namespace GFGGame
         {
             _ui.target.visible = true;
             this._sceneObject.gameObject.SetActive(true);
-
-            MyDressUpHelper.dressUpObj.setSceneObj(_sceneObject);
-
         }
         private void SetBtnShowVisable(object param)
         {

+ 1 - 2
GameClient/Assets/Game/HotUpdate/Views/DressUp/PhotographView.cs

@@ -125,9 +125,8 @@ namespace GFGGame
             if (_sceneObject == null)
             {
                 _sceneObject = GameObject.Instantiate(_scenePrefab);
-                MyDressUpHelper.dressUpObj.setSceneObj(_sceneObject);
-                PhotographSceneManager.Instance.sceneObject = _sceneObject;
             }
+            PhotographSceneManager.Instance.sceneObject = _sceneObject;
             pinchGesture = new PinchGesture(_ui.target);
             pinchGesture.onAction.Add(OnPinch);
             rotationGesture = new RotationGesture(_ui.target);

+ 11 - 43
GameClient/Assets/Game/HotUpdate/Views/FieldGuide/SuitShowView.cs

@@ -10,30 +10,21 @@ namespace GFGGame
         private UI_SuitShowUI _ui;
         private int _suitTypeId;
         private int _suitId;
-        private GameObject _scenePrefab;
-        private GameObject _sceneObject;
-        private GoWrapper _wrapper;
-        private DressUpObj _dressUpObj;
+        private DressUpObjUI _dressUpObjUI;
         private bool _actionIsPic;
         private List<int> _suitIds;
 
         public override void Dispose()
         {
-            if (_sceneObject != null)
+            if (_dressUpObjUI != null)
             {
-                GameObject.Destroy(_sceneObject);
-                _sceneObject = null;
+                _dressUpObjUI.Dispose();
+                _dressUpObjUI = null;
             }
-
-            if (_wrapper != null)
-            {
-                _wrapper.Dispose();
-                _wrapper = null;
-            }
-            if (_dressUpObj != null)
+            if (_dressUpObjUI != null)
             {
-                _dressUpObj.Dispose();
-                _dressUpObj = null;
+                _dressUpObjUI.Dispose();
+                _dressUpObjUI = null;
             }
             if (_ui != null)
             {
@@ -52,8 +43,7 @@ namespace GFGGame
             isfullScreen = true;
             this.clickBlankToClose = false;
 
-            _scenePrefab = GFGAsset.Load<GameObject>(ResPathUtil.GetPrefabPath("SceneDressUp"));
-            _dressUpObj = new DressUpObj();
+            _dressUpObjUI = new DressUpObjUI("SceneDressUp");
 
             _ui.m_btnBack.onClick.Add(OnClickBtnBack);
 
@@ -100,11 +90,6 @@ namespace GFGGame
         protected override void OnHide()
         {
             base.OnHide();
-            if (_sceneObject != null)
-            {
-                GameObject.Destroy(_sceneObject);
-                _sceneObject = null;
-            }
         }
         protected override void RemoveEventListener()
         {
@@ -127,26 +112,9 @@ namespace GFGGame
             _actionIsPic = isPic;
             SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(_suitId);
             _ui.m_txtSuitName.text = suitCfg.name;
-            if (_sceneObject != null)
-            {
-                GameObject.Destroy(_sceneObject);
-                _sceneObject = null;
-            }
-            _sceneObject = GameObject.Instantiate(_scenePrefab);
-            int scale = 100;
-            _sceneObject.transform.localScale = new Vector3(scale, scale, scale);
-            _dressUpObj.setSceneObj(_sceneObject, false,true,null,false);
-            _dressUpObj.PutOnDefaultDressUpData();
-            _dressUpObj.PutOnSuitCfg(_suitId, isPic, new int[] { ConstDressUpItemType.BEI_JING });
-            if (_wrapper == null)
-            {
-                _wrapper = new GoWrapper(_sceneObject);
-                _ui.m_holder.SetNativeObject(_wrapper);
-            }
-            else
-            {
-                _wrapper.wrapTarget = _sceneObject;
-            }
+            _dressUpObjUI.ResetSceneObj(100, false,true,null,false);
+            _dressUpObjUI.dressUpObj.PutOnSuitCfg(_suitId, isPic, new int[] { ConstDressUpItemType.BEI_JING });
+            _dressUpObjUI.UpdateWrapper(_ui.m_holder);
             UpdateSuitBoxStatus();
         }
 

+ 44 - 24
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxView.cs

@@ -13,19 +13,22 @@ namespace GFGGame
         private UI_LuckyBoxUI _ui;
         private ValueBarController _valueBarController;
 
-        private GameObject _gameObject;
-        private GoWrapper _wrapper;
-        private GameObject _gameObject1;
-        private GoWrapper _wrapper1;
-        private GameObject _gameObject2;
-        private GoWrapper _wrapper2;
-        private GameObject _gameObject3;
-        private GoWrapper _wrapper3;
-
-        private GameObject _gameObject4;
-        private GoWrapper _wrapper4;
-        private GameObject _gameObject5;
-        private GoWrapper _wrapper5;
+        //private GameObject _gameObject;
+        //private GoWrapper _wrapper;
+        //private GameObject _gameObject1;
+        //private GoWrapper _wrapper1;
+        //private GameObject _gameObject2;
+        //private GoWrapper _wrapper2;
+        //private GameObject _gameObject3;
+        //private GoWrapper _wrapper3;
+
+        private DressUpObjUI _dressUpObjUIXiHe;
+
+        //private GameObject _scenePrefab;
+        //private GameObject _sceneObject;
+        //private GoWrapper _wrapper4;
+        //private DressUpObj _dressUpObj;
+        private DressUpObjUI _dressUpObjUIChangXi;
 
         private bool isActiveBoxOpen = false;
         private int _bgIndex = 0;
@@ -38,10 +41,20 @@ namespace GFGGame
                 _valueBarController.Dispose();
                 _valueBarController = null;
             }
-            SceneController.DestroyObjectFromView(_gameObject, _wrapper);
-            SceneController.DestroyObjectFromView(_gameObject1, _wrapper1);
-            SceneController.DestroyObjectFromView(_gameObject2, _wrapper2);
-            SceneController.DestroyObjectFromView(_gameObject3, _wrapper3);
+            if (_dressUpObjUIXiHe != null)
+            {
+                _dressUpObjUIXiHe.Dispose();
+                _dressUpObjUIXiHe = null;
+            }
+            if (_dressUpObjUIChangXi != null)
+            {
+                _dressUpObjUIChangXi.Dispose();
+                _dressUpObjUIChangXi = null;
+            }
+            //SceneController.DestroyObjectFromView(_gameObject, _wrapper);
+            //SceneController.DestroyObjectFromView(_gameObject1, _wrapper1);
+            //SceneController.DestroyObjectFromView(_gameObject2, _wrapper2);
+            //SceneController.DestroyObjectFromView(_gameObject3, _wrapper3);
 
             if (_ui != null)
             {
@@ -59,6 +72,8 @@ namespace GFGGame
             this.viewCom = _ui.target;
             isfullScreen = true;
 
+            _dressUpObjUIXiHe = new DressUpObjUI("SceneDressUp");
+            _dressUpObjUIChangXi = new DressUpObjUI("SceneDressUp");
             // _ui.m_txtRemainTimes.visible = false;
             _valueBarController = new ValueBarController(_ui.m_valueBar);
             _ui.m_btnBack.onClick.Add(OnClickBtnBack);
@@ -72,6 +87,7 @@ namespace GFGGame
             _ui.m_listBg.itemProvider = GetListItemResource;
             _ui.m_listBg.scrollPane.onScrollEnd.Add(OnListBgScroll);
 
+
         }
         protected override void AddEventListener()
         {
@@ -187,13 +203,16 @@ namespace GFGGame
                 (obj as GComponent).GetChild("txtTime").asTextField.text = string.Format("剩余{0}{1}", num, str);
                 GGraph holder = (obj as GComponent).GetChild("holder").asGraph;
                 GGraph holder1 = (obj as GComponent).GetChild("holder1").asGraph;
-                SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(201013);//羲和
-                string resPath1 = ResPathUtil.GetDressUpAnimationPath(suitCfg.aniRes);
-                SceneController.AddObjectToView(_gameObject4, _wrapper4, holder, resPath1, out _gameObject4, out _wrapper4);
 
-                SuitCfg suitCfg1 = SuitCfgArray.Instance.GetCfg(201006);//常曦
-                string resPath2 = ResPathUtil.GetDressUpAnimationPath(suitCfg1.aniRes);
-                SceneController.AddObjectToView(_gameObject5, _wrapper5, holder1, resPath2, out _gameObject5, out _wrapper5);
+                //羲和
+                _dressUpObjUIXiHe.ResetSceneObj(100, false, false, null, false);
+                _dressUpObjUIXiHe.dressUpObj.PutOnSuitCfg(201013, true, null, false, false);
+                _dressUpObjUIXiHe.UpdateWrapper(holder);
+
+                //常曦
+                _dressUpObjUIChangXi.ResetSceneObj(100, false, false, null, false);
+                _dressUpObjUIChangXi.dressUpObj.PutOnSuitCfg(201006, true, null, false, false);
+                _dressUpObjUIChangXi.UpdateWrapper(holder1);
             }
         }
 
@@ -352,7 +371,6 @@ namespace GFGGame
             });
         }
 
-
         protected override void OnHide()
         {
             base.OnHide();
@@ -363,12 +381,14 @@ namespace GFGGame
             Timers.inst.Remove(CheckGuide);
             // Timers.inst.Remove(UpdateTime);
         }
+
         protected override void RemoveEventListener()
         {
             base.RemoveEventListener();
             EventAgent.RemoveEventListener(ConstMessage.ITEM_CHANGED, OnListBgScroll);
             EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, OnListBgScroll);
         }
+
         private void OnClickBtnBack()
         {
             Reset();

+ 0 - 1
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryFightSingleView.cs

@@ -48,7 +48,6 @@ namespace GFGGame
                 _sceneObject = GameObject.Instantiate(_scenePrefab);
             }
             MyDressUpHelper.dressUpObj.setSceneObj(_sceneObject);
-            MyDressUpHelper.dressUpObj.UpdateRoleView();
             StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(InstanceZonesDataManager.currentLevelCfgId);
             StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
             if (!string.IsNullOrEmpty(fightCfg.music))

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryFightTargetView.cs

@@ -103,7 +103,7 @@ namespace GFGGame
             else
             {
                 roleFightData = InstanceZonesDataManager.roleData;
-                MyDressUpHelper.dressUpObj.UpdateRoleView();
+                // MyDressUpHelper.dressUpObj.UpdateRoleView();
 
                 _sceneTargetObj.SetActive(false);
                 _sceneNpcObj.SetActive(true);