zhaoyang 3 жил өмнө
parent
commit
673dad7d91

+ 7 - 0
FGUIProject/assets/DressUp/PhotographUI.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="1080,1920" overflow="scroll" scroll="both">
+  <displayList>
+    <component id="n1_yd72" name="btnBack" src="9xlo8" fileName="components/ButtonBack1.xml" pkg="eg2y0ldp" xy="35,80"/>
+    <loader id="n3_yd72" name="loaBg" xy="113,369" size="50,50"/>
+  </displayList>
+</component>

+ 1 - 0
FGUIProject/assets/DressUp/package.xml

@@ -132,6 +132,7 @@
     <image id="oq7r45" name="hz_kuangxian.png" path="/images/"/>
     <image id="oq7r45" name="hz_kuangxian.png" path="/images/"/>
     <image id="oq7r46" name="hz_tzkuang.png" path="/images/"/>
     <image id="oq7r46" name="hz_tzkuang.png" path="/images/"/>
     <image id="oq7r47" name="hz_tzkuang_1.png" path="/images/"/>
     <image id="oq7r47" name="hz_tzkuang_1.png" path="/images/"/>
+    <component id="be944a" name="PhotographUI.xml" path="/" exported="true"/>
   </resources>
   </resources>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\DressUp" packageCount="2" genCode="true" extractAlpha="true"/>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\DressUp" packageCount="2" genCode="true" extractAlpha="true"/>
 </packageDescription>
 </packageDescription>

+ 2 - 0
GameClient/Assets/Game/HotUpdate/Constant/ConstMessage.cs

@@ -22,6 +22,8 @@ namespace GFGGame
 
 
         public const string PLAT_CARDFOSTER_T1 = "PLAT_CARDFOSTER_T0";
         public const string PLAT_CARDFOSTER_T1 = "PLAT_CARDFOSTER_T0";
 
 
+        public const string CLOSE_PHOTOGRAPHVIEW = "CLOSE_PHOTOGRAPHVIEW";
+
 
 
     }
     }
 }
 }

+ 5 - 5
GameClient/Assets/Game/HotUpdate/DressUp/DressUpUtil.cs

@@ -15,7 +15,7 @@ namespace GFGGame
         private const string FORMAT_EFFECT_OBJ_NAME = "T{0}_eff";
         private const string FORMAT_EFFECT_OBJ_NAME = "T{0}_eff";
         private const string FORMAT_LAYER_RES_NAME_WITH_T = "{0}_t";
         private const string FORMAT_LAYER_RES_NAME_WITH_T = "{0}_t";
 
 
-        public static void AddItem(int itemID, GameObject sceneObj, bool needSetMask = false)
+        public static void AddItem(int itemID, GameObject sceneObj, bool needSetMask = false, bool showAni = true)
         {
         {
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemID);
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemID);
             if (itemCfg != null)
             if (itemCfg != null)
@@ -34,13 +34,13 @@ namespace GFGGame
                 //普通层
                 //普通层
                 if (itemCfg.resLayer1 > 0)
                 if (itemCfg.resLayer1 > 0)
                 {
                 {
-                    updateLayerRes(itemCfg, parentObj, 1, itemCfg.resLayer1 == 2, needSetMask);
+                    updateLayerRes(itemCfg, parentObj, 1, itemCfg.resLayer1 == 2, needSetMask, showAni);
                 }
                 }
                 //特殊层
                 //特殊层
                 if (itemCfg.resLayer2 > 0)
                 if (itemCfg.resLayer2 > 0)
                 {
                 {
 
 
-                    updateLayerRes(itemCfg, parentObj, 2, itemCfg.resLayer2 == 2, needSetMask);
+                    updateLayerRes(itemCfg, parentObj, 2, itemCfg.resLayer2 == 2, needSetMask, showAni);
                 }
                 }
                 //特效
                 //特效
                 if (itemCfg.effLayer > 0)
                 if (itemCfg.effLayer > 0)
@@ -159,7 +159,7 @@ namespace GFGGame
             assetDisposer.resPath = resPath;
             assetDisposer.resPath = resPath;
         }
         }
 
 
-        private static void updateLayerRes(ItemCfg itemCfg, GameObject parentObj, int layerId, bool isT, bool needSetMask)
+        private static void updateLayerRes(ItemCfg itemCfg, GameObject parentObj, int layerId, bool isT, bool needSetMask, bool showAni = true)
         {
         {
 
 
             ItemTypeCfg typeCfg = ItemTypeCfgArray.Instance.GetCfg(itemCfg.subType);
             ItemTypeCfg typeCfg = ItemTypeCfgArray.Instance.GetCfg(itemCfg.subType);
@@ -180,7 +180,7 @@ namespace GFGGame
                 GameObject.DestroyImmediate(tf.gameObject);
                 GameObject.DestroyImmediate(tf.gameObject);
                 tf = null;
                 tf = null;
             }
             }
-            if (itemCfg.isAni > 0)
+            if (itemCfg.isAni > 0 && showAni)
             {
             {
                 AddAnimationObj(res, objName, parentObj, sortingOrder);
                 AddAnimationObj(res, objName, parentObj, sortingOrder);
             }
             }

+ 11 - 11
GameClient/Assets/Game/HotUpdate/DressUp/SceneController.cs

@@ -31,7 +31,7 @@ namespace GFGGame
             CustomSuitData suitSavedData = CustomSuitDataManager.GetCurrentSuitList();
             CustomSuitData suitSavedData = CustomSuitDataManager.GetCurrentSuitList();
             int[] equipDatas = suitSavedData.equipDatas;
             int[] equipDatas = suitSavedData.equipDatas;
             UpdateRole(equipDatas, sceneObj, false);
             UpdateRole(equipDatas, sceneObj, false);
-            if(suitSavedData.pic > 0 && suitSavedData.suitId > 0)
+            if (suitSavedData.pic > 0 && suitSavedData.suitId > 0)
             {
             {
                 SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(suitSavedData.suitId);
                 SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(suitSavedData.suitId);
                 DressUpUtil.UpdateBody(suitCfg.picRes, sceneObj, !string.IsNullOrEmpty(suitCfg.aniRes), suitCfg.effRes);
                 DressUpUtil.UpdateBody(suitCfg.picRes, sceneObj, !string.IsNullOrEmpty(suitCfg.aniRes), suitCfg.effRes);
@@ -42,31 +42,31 @@ namespace GFGGame
             }
             }
         }
         }
 
 
-        public static void UpdateRole(int[] equipDatas, GameObject sceneObj, bool needSetMask = false, int[] exceptTypes = null)
+        public static void UpdateRole(int[] equipDatas, GameObject sceneObj, bool needSetMask = false, int[] exceptTypes = null, bool showAni = true)
         {
         {
             Reset(sceneObj);
             Reset(sceneObj);
             int count = equipDatas.Length;
             int count = equipDatas.Length;
-            for(int i = 0; i < count; i++)
+            for (int i = 0; i < count; i++)
             {
             {
                 int id = (int)equipDatas[i];
                 int id = (int)equipDatas[i];
-                if(exceptTypes != null)
+                if (exceptTypes != null)
                 {
                 {
                     int subType = ItemUtil.GetItemSubType(id);
                     int subType = ItemUtil.GetItemSubType(id);
-                    if(Array.IndexOf(exceptTypes, subType) >= 0)
+                    if (Array.IndexOf(exceptTypes, subType) >= 0)
                     {
                     {
                         continue;
                         continue;
                     }
                     }
                 }
                 }
-                DressUpUtil.AddItem(id, sceneObj, needSetMask);
+                DressUpUtil.AddItem(id, sceneObj, needSetMask, showAni);
             }
             }
             DressUpUtil.UpdateBody(null, sceneObj, false, null, needSetMask);
             DressUpUtil.UpdateBody(null, sceneObj, false, null, needSetMask);
         }
         }
-        
+
         public static void UpdateDialogBg(string value, GameObject sceneObj)
         public static void UpdateDialogBg(string value, GameObject sceneObj)
         {
         {
             Transform tf = sceneObj.transform.Find("Bg");
             Transform tf = sceneObj.transform.Find("Bg");
             SpriteRenderer spr = tf.GetComponent<SpriteRenderer>();
             SpriteRenderer spr = tf.GetComponent<SpriteRenderer>();
-            if(value == "0")
+            if (value == "0")
             {
             {
                 spr.sprite = null;
                 spr.sprite = null;
             }
             }
@@ -83,7 +83,7 @@ namespace GFGGame
         {
         {
             Transform tf = sceneObj.transform.Find("Pic");
             Transform tf = sceneObj.transform.Find("Pic");
             SpriteRenderer spr = tf.GetComponent<SpriteRenderer>();
             SpriteRenderer spr = tf.GetComponent<SpriteRenderer>();
-            if(value == "0")
+            if (value == "0")
             {
             {
                 spr.sprite = null;
                 spr.sprite = null;
             }
             }
@@ -127,7 +127,7 @@ namespace GFGGame
         {
         {
             //背景层次
             //背景层次
             Transform bg = sceneObj.transform.Find("Bg");
             Transform bg = sceneObj.transform.Find("Bg");
-            if(bg != null)
+            if (bg != null)
             {
             {
                 SpriteRenderer spr = bg.GetComponent<SpriteRenderer>();
                 SpriteRenderer spr = bg.GetComponent<SpriteRenderer>();
                 if (spr != null)
                 if (spr != null)
@@ -138,7 +138,7 @@ namespace GFGGame
             }
             }
             //角色清理
             //角色清理
             Transform role = sceneObj.transform.Find("Role");
             Transform role = sceneObj.transform.Find("Role");
-            if(role != null)
+            if (role != null)
             {
             {
                 int childCount = role.childCount;
                 int childCount = role.childCount;
                 for (int i = childCount - 1; i >= 0; --i)
                 for (int i = childCount - 1; i >= 0; --i)

+ 74 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/DressUp/UI_PhotographUI.cs

@@ -0,0 +1,74 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.DressUp
+{
+    public partial class UI_PhotographUI
+    {
+        public GComponent target;
+        public GButton m_btnBack;
+        public GLoader m_loaBg;
+        public const string URL = "ui://mbo439wbbe944a";
+        public const string PACKAGE_NAME = "DressUp";
+        public const string RES_NAME = "PhotographUI";
+        private static UI_PhotographUI _proxy;
+
+        public static UI_PhotographUI Create(GObject gObject = null)
+        {
+            var ui = new UI_PhotographUI();
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static UI_PhotographUI Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_PhotographUI();
+            }
+            var ui = _proxy;
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static void ProxyEnd()
+        {
+            if (_proxy != null)
+            {
+                _proxy.Dispose();
+            }
+        }
+
+        public static void ClearProxy()
+        {
+            ProxyEnd();
+            _proxy = null;
+        }
+
+        private void Init(GComponent comp)
+        {
+            m_btnBack = (GButton)comp.GetChild("btnBack");
+            m_loaBg = (GLoader)comp.GetChild("loaBg");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_btnBack = null;
+            m_loaBg = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/DressUp/UI_PhotographUI.cs.meta

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

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

@@ -51,7 +51,7 @@ namespace GFGGame
             _ui.m_btnLastStep.visible = false;
             _ui.m_btnLastStep.visible = false;
             _ui.m_btnNextStep.visible = false;
             _ui.m_btnNextStep.visible = false;
             _ui.m_btnSearch.visible = true;
             _ui.m_btnSearch.visible = true;
-            _ui.m_btnPhoto.visible = false;
+            _ui.m_btnPhoto.visible = true;
             _ui.m_btnAction.visible = false;
             _ui.m_btnAction.visible = false;
             _ui.m_comboBox.items = new string[] { "我的套装一", "我的套装二", "我的套装三", "我的套装四", "我的套装五", "我的套装六" };
             _ui.m_comboBox.items = new string[] { "我的套装一", "我的套装二", "我的套装三", "我的套装四", "我的套装五", "我的套装六" };
             _ui.m_partsList.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
             _ui.m_partsList.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
@@ -72,9 +72,11 @@ namespace GFGGame
             _ui.m_btnShow.onClick.Add(OnClickBtnShow);
             _ui.m_btnShow.onClick.Add(OnClickBtnShow);
             _ui.m_btnHide.onClick.Add(OnClickBtnHide);
             _ui.m_btnHide.onClick.Add(OnClickBtnHide);
             _ui.m_loaShow.onClick.Add(OnClickLoaShow);
             _ui.m_loaShow.onClick.Add(OnClickLoaShow);
+            _ui.m_btnPhoto.onClick.Add(OnClickBtnPhoto);
 
 
             EventAgent.AddEventListener(ConstMessage.DRESS_FILTER, UpdatePartsListSort);
             EventAgent.AddEventListener(ConstMessage.DRESS_FILTER, UpdatePartsListSort);
             EventAgent.AddEventListener(ConstMessage.DRESS_SEARCH, UpdatePartsListSort);
             EventAgent.AddEventListener(ConstMessage.DRESS_SEARCH, UpdatePartsListSort);
+            EventAgent.AddEventListener(ConstMessage.CLOSE_PHOTOGRAPHVIEW, UpdateScene);
 
 
         }
         }
 
 
@@ -517,6 +519,21 @@ namespace GFGGame
             _ui.m_btnShow.enabled = true;
             _ui.m_btnShow.enabled = true;
 
 
         }
         }
+        private void OnClickBtnPhoto()
+        {
+            // this.Hide();
+            _ui.target.visible = false;
+            this._sceneObject.gameObject.SetActive(false);
+            ViewManager.Show<PhotographView>();
+        }
+        private void UpdateScene()
+        {
+            _ui.target.visible = true;
+            this._sceneObject.gameObject.SetActive(true);
+
+            EquipDataCache.cacher.setSceneObj(_sceneObject);
+
+        }
         private void SetBtnShowVisable(object param)
         private void SetBtnShowVisable(object param)
         {
         {
             _ui.m_btnShow.enabled = false;
             _ui.m_btnShow.enabled = false;

+ 114 - 0
GameClient/Assets/Game/HotUpdate/Views/DressUp/PhotographView.cs

@@ -0,0 +1,114 @@
+using FairyGUI;
+using System;
+using UI.DressUp;
+using UnityEngine;
+
+namespace GFGGame
+{
+    public class PhotographView : BaseView
+    {
+        private UI_PhotographUI _ui;
+        private GameObject _scenePrefab;
+        private GameObject _sceneObject;
+        private DressUpObjDataCache equipDataCache;
+
+        protected override void OnInit()
+        {
+            base.OnInit();
+            packageName = UI_PhotographUI.PACKAGE_NAME;
+            _ui = UI_PhotographUI.Create();
+            viewCom = _ui.target;
+            isfullScreen = true;
+
+            _ui.m_btnBack.onClick.Add(OnClickBtnBack);
+            _scenePrefab = GFGAsset.Load<GameObject>(ResPathUtil.GetPrefabPath("ScenePhotograph"));
+
+        }
+
+        protected override void OnShown()
+        {
+            base.OnShown();
+            // Debug.Log("Length:" + EquipDataCache.cacher.equipDatas.Length);
+            // Debug.Log("bgId:" + EquipDataCache.cacher.bgId);
+            // Debug.Log("suitId:" + EquipDataCache.cacher.suitId);
+
+            if (_sceneObject == null)
+            {
+                _sceneObject = GameObject.Instantiate(_scenePrefab);
+                // _sceneObject.sortingOrder = 1000;
+                EquipDataCache.cacher.setSceneObj(_sceneObject);
+            }
+
+            equipDataCache = EquipDataCache.cacher;
+            UpdateBg();
+            UpdateBody();
+        }
+        //背景
+        private void UpdateBg()
+        {
+            int[] bgId = { equipDataCache.bgId };
+            SceneController.UpdateRole(bgId, _sceneObject, false, null, false);
+        }
+        //主角
+        private void UpdateBody()
+        {
+
+            // CustomSuitData suitSavedData = CustomSuitDataManager.GetCurrentSuitList();
+            int[] equipDatas = equipDataCache.equipDatas;
+            SceneController.UpdateRole(equipDatas, _sceneObject, false, null, false);
+            if (equipDataCache.IsSuitPic && equipDataCache.suitId > 0)
+            {
+                SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(equipDataCache.suitId);
+                DressUpUtil.UpdateBody(suitCfg.picRes, _sceneObject);
+            }
+        }
+
+        //合照NPC
+        private void UpdateNpc()
+        {
+
+        }
+        //场景道具
+        private void UpdateScene()
+        {
+
+        }
+        //边框
+        private void UpdateBorder()
+        {
+
+        }
+        //滤镜效果
+        private void UpdateEffect()
+        {
+
+        }
+        private void OnClickBtnBack()
+        {
+            this.Hide();
+            // ViewManager.Show(ViewName.DRESS_UP_VIEW);
+            EventAgent.DispatchEvent(ConstMessage.CLOSE_PHOTOGRAPHVIEW);
+        }
+        protected override void OnHide()
+        {
+            base.OnHide();
+            if (_sceneObject != null)
+            {
+                GameObject.Destroy(_sceneObject);
+                _sceneObject = null;
+            }
+            equipDataCache = null;
+        }
+        public override void Dispose()
+        {
+            if (_scenePrefab != null)
+            {
+                GameObject.Destroy(_scenePrefab);
+                _scenePrefab = null;
+            }
+            base.Dispose();
+        }
+
+    }
+}
+

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

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

BIN
GameClient/Assets/ResIn/UI/DressUp/DressUp_fui.bytes