|
@@ -4,6 +4,7 @@ using System.Threading.Tasks;
|
|
|
using ET;
|
|
|
using FairyGUI;
|
|
|
using UI.MatchingCompetition;
|
|
|
+using UI.DressUp;
|
|
|
using UnityEngine;
|
|
|
|
|
|
namespace GFGGame
|
|
@@ -15,6 +16,7 @@ namespace GFGGame
|
|
|
private int nameIndex = 0;
|
|
|
private List<string> nameList = new List<string>() { "饰品","外套","鞋子","袜子","内搭","上衣","下装","手持物","妆容","道具","背景","拍照" };
|
|
|
private List<int> IdList = new List<int>();
|
|
|
+ private List<int> AllIdList = new List<int>();
|
|
|
public override void Dispose()
|
|
|
{
|
|
|
if (_sceneObject != null)
|
|
@@ -39,23 +41,21 @@ namespace GFGGame
|
|
|
isReturnView = true;
|
|
|
isfullScreen = true;
|
|
|
|
|
|
- _ui.m_nameList.itemRenderer = ListItemType1Renderer;
|
|
|
+ _ui.m_nameList.itemRenderer = ListType1Item;
|
|
|
_ui.m_dressList.itemRenderer = ListItemType2Render;
|
|
|
_ui.m_BtnBack.onClick.Add(OnClickBtnBack);
|
|
|
_ui.m_btn.onClick.Add(OnClickBtn);
|
|
|
}
|
|
|
- protected override void AddEventListener()
|
|
|
- {
|
|
|
- base.AddEventListener();
|
|
|
- }
|
|
|
protected override void OnShown()
|
|
|
{
|
|
|
base.OnShown();
|
|
|
- if (_sceneObject == null)
|
|
|
- {
|
|
|
- _sceneObject = PrefabManager.Instance.InstantiateSync(ResPathUtil.GetPrefabPath("ScenePhotograph"));
|
|
|
- MyDressUpHelper.dressUpObj.setSceneObj(_sceneObject, false, false);
|
|
|
- }
|
|
|
+ //if (_sceneObject == null)
|
|
|
+ //{
|
|
|
+ // _sceneObject = PrefabManager.Instance.InstantiateSync(ResPathUtil.GetPrefabPath("ScenePhotograph"));
|
|
|
+ // MyDressUpHelper.dressUpObj.setSceneObj(_sceneObject, false, false);
|
|
|
+ //}
|
|
|
+ AllIdList = this.viewData as List<int>;
|
|
|
+ _ui.m_dressList.visible = false;
|
|
|
UpdateDress();
|
|
|
UpdateView();
|
|
|
}
|
|
@@ -70,71 +70,107 @@ namespace GFGGame
|
|
|
base.OnHide();
|
|
|
}
|
|
|
|
|
|
+ protected override void AddEventListener()
|
|
|
+ {
|
|
|
+ base.AddEventListener();
|
|
|
+ EventAgent.AddEventListener(ConstMessage.DOWNLOAD_FINISH, UpdateDress);
|
|
|
+ }
|
|
|
protected override void RemoveEventListener()
|
|
|
{
|
|
|
base.RemoveEventListener();
|
|
|
+ EventAgent.RemoveEventListener(ConstMessage.DOWNLOAD_FINISH, UpdateDress);
|
|
|
}
|
|
|
private void UpdateView()
|
|
|
{
|
|
|
+ _ui.m_nameList.numItems = DressUpMenuItemCfg1Array.Instance.dataArray.Length - 1;
|
|
|
}
|
|
|
- private async void UpdateDress()
|
|
|
+ private void UpdateDress()
|
|
|
{
|
|
|
- //这里要换成获取其他玩家数据
|
|
|
- MatchingCompetitionDataManager.Instance.itemGameObjs.Clear();
|
|
|
- PhotographDataManager.Instance.itemGameObjs.Clear();
|
|
|
- if (_sceneObject == null)
|
|
|
- {
|
|
|
- _sceneObject = PrefabManager.Instance.InstantiateSync(ResPathUtil.GetPrefabPath("ScenePhotograph"));
|
|
|
- }
|
|
|
- PhotographSceneManager.Instance.sceneObject = _sceneObject;
|
|
|
- if (MatchingCompetitionDataManager.Instance.DressUpBgID == 0)
|
|
|
- {
|
|
|
- PhotographSceneManager.Instance.AddBgItem(ItemCfgArray.Instance.GetCfg(180001));
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- PhotographSceneManager.Instance.AddBgItem(ItemCfgArray.Instance.GetCfg(MatchingCompetitionDataManager.Instance.DressUpBgID));
|
|
|
- }
|
|
|
- PhotographSceneManager.Instance.AddBodyItem();
|
|
|
- GameObject bodyParent = _sceneObject.transform.Find("Scene/Role").gameObject;
|
|
|
- PhotographDataManager.Instance.dressUpObj.setSceneObj(_sceneObject, false, true, bodyParent, false, null);
|
|
|
- PhotographDataManager.Instance.dressUpObj.PutOnDressUpData(MatchingCompetitionDataManager.Instance.MathingDressDate);
|
|
|
+ _ui.m_playerImage.texture = MatchingCompetitionDataManager.Instance.DetailNtexture;
|
|
|
+ ////这里要换成获取其他玩家数据,改成用图片
|
|
|
+ // MatchingCompetitionDataManager.Instance.itemGameObjs.Clear();
|
|
|
+ // PhotographDataManager.Instance.itemGameObjs.Clear();
|
|
|
+ // if (_sceneObject == null)
|
|
|
+ // {
|
|
|
+ // _sceneObject = PrefabManager.Instance.InstantiateSync(ResPathUtil.GetPrefabPath("ScenePhotograph"));
|
|
|
+ // }
|
|
|
+ // PhotographSceneManager.Instance.sceneObject = _sceneObject;
|
|
|
+ // if (MatchingCompetitionDataManager.Instance.DressUpBgID == 0)
|
|
|
+ // {
|
|
|
+ // PhotographSceneManager.Instance.AddBgItem(ItemCfgArray.Instance.GetCfg(180001));
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // PhotographSceneManager.Instance.AddBgItem(ItemCfgArray.Instance.GetCfg(MatchingCompetitionDataManager.Instance.DressUpBgID));
|
|
|
+ // }
|
|
|
+ // PhotographSceneManager.Instance.AddBodyItem();
|
|
|
+ // GameObject bodyParent = _sceneObject.transform.Find("Scene/Role").gameObject;
|
|
|
+ // PhotographDataManager.Instance.dressUpObj.setSceneObj(_sceneObject, false, true, bodyParent, false, null);
|
|
|
+ // PhotographDataManager.Instance.dressUpObj.PutOnDressUpData(MatchingCompetitionDataManager.Instance.MathingDressDate);
|
|
|
|
|
|
- //对搭配赛特殊处理
|
|
|
- for (int i = 0; i < MatchingCompetitionDataManager.Instance.DressPropIdList.Count; i++)
|
|
|
- {
|
|
|
- if (MatchingCompetitionDataManager.Instance.DressPropIdList[i] == MatchingCompetitionDataManager.Instance.roleID)
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(MatchingCompetitionDataManager.Instance.DressPropIdList[i]);
|
|
|
- MatchingCompetitionDataManager.Instance.AddSceneItem(itemCfg, true);
|
|
|
- }
|
|
|
- }
|
|
|
- await Task.Delay(100);
|
|
|
- MatchingCompetitionDataManager.Instance.InsertGameObjectList();
|
|
|
- for (int i = 0; i < MatchingCompetitionDataManager.Instance.TransformDataList.Count; i++)
|
|
|
- {
|
|
|
- TransformData itemdata = MatchingCompetitionDataManager.Instance.TransformDataList[i];
|
|
|
- GameObject itemGObj = MatchingCompetitionDataManager.Instance.itemGameObjs[i];
|
|
|
- MatchingCompetitionDataManager.Instance.itemGameObjs[i].transform.position = itemdata.position;
|
|
|
- MatchingCompetitionDataManager.Instance.itemGameObjs[i].transform.Rotate(itemGObj.transform.eulerAngles.x, itemGObj.transform.eulerAngles.y, itemdata.rotationZ);
|
|
|
- MatchingCompetitionDataManager.Instance.itemGameObjs[i].transform.localScale = itemdata.scale;
|
|
|
- PhotographUtil.Instance.ChangeLayer(MatchingCompetitionDataManager.Instance.itemGameObjs[i], i * PhotographDataManager.layerCount, "up");
|
|
|
- }
|
|
|
+ // //对搭配赛特殊处理
|
|
|
+ // for (int i = 0; i < MatchingCompetitionDataManager.Instance.DressPropIdList.Count; i++)
|
|
|
+ // {
|
|
|
+ // if (MatchingCompetitionDataManager.Instance.DressPropIdList[i] == MatchingCompetitionDataManager.Instance.roleID)
|
|
|
+ // {
|
|
|
+ // continue;
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(MatchingCompetitionDataManager.Instance.DressPropIdList[i]);
|
|
|
+ // MatchingCompetitionDataManager.Instance.AddSceneItem(itemCfg, true);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // await Task.Delay(100);
|
|
|
+ // MatchingCompetitionDataManager.Instance.InsertGameObjectList();
|
|
|
+ // for (int i = 0; i < MatchingCompetitionDataManager.Instance.TransformDataList.Count; i++)
|
|
|
+ // {
|
|
|
+ // TransformData itemdata = MatchingCompetitionDataManager.Instance.TransformDataList[i];
|
|
|
+ // GameObject itemGObj = MatchingCompetitionDataManager.Instance.itemGameObjs[i];
|
|
|
+ // MatchingCompetitionDataManager.Instance.itemGameObjs[i].transform.position = itemdata.position;
|
|
|
+ // MatchingCompetitionDataManager.Instance.itemGameObjs[i].transform.Rotate(itemGObj.transform.eulerAngles.x, itemGObj.transform.eulerAngles.y, itemdata.rotationZ);
|
|
|
+ // MatchingCompetitionDataManager.Instance.itemGameObjs[i].transform.localScale = itemdata.scale;
|
|
|
+ // PhotographUtil.Instance.ChangeLayer(MatchingCompetitionDataManager.Instance.itemGameObjs[i], i * PhotographDataManager.layerCount, "up");
|
|
|
+ // }
|
|
|
}
|
|
|
- private void ListItemType1Renderer(int index, GObject obj)
|
|
|
+ //private void ListItemType1Renderer(int index, GObject obj)
|
|
|
+ //{
|
|
|
+ // UI_ComponentName item = UI_ComponentName.Proxy(obj);
|
|
|
+ // if(index == DressUpMenuItemCfg1Array.Instance.dataArray.Length - 1)
|
|
|
+ // {
|
|
|
+ // item.m_name.text = "拍照";
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // item.m_name.text = DressUpMenuItemCfg1Array.Instance.dataArray[index].name;
|
|
|
+ // }
|
|
|
+
|
|
|
+ // if (item.target.data == null)
|
|
|
+ // {
|
|
|
+ // item.target.onClick.Add(OnClickListType1Item);
|
|
|
+ // }
|
|
|
+ // item.target.data = index;
|
|
|
+ // UI_ComponentName.ProxyEnd();
|
|
|
+ //}
|
|
|
+ private void ListType1Item(int index, GObject item)
|
|
|
{
|
|
|
- UI_ComponentName item = UI_ComponentName.Proxy(obj);
|
|
|
- item.m_name.text = nameList[index];
|
|
|
- if (item.target.data == null)
|
|
|
+ UI_MatchingTypeItem typeItem = UI_MatchingTypeItem.Proxy(item);
|
|
|
+ DressUpMenuItemCfg1 item1 = DressUpMenuItemCfg1Array.Instance.dataArray[index];
|
|
|
+ if(item1.id >= 12)
|
|
|
{
|
|
|
- item.target.onClick.Add(OnClickListType1Item);
|
|
|
+ item1 = DressUpMenuItemCfg1Array.Instance.dataArray[index + 1];
|
|
|
}
|
|
|
- item.target.data = index;
|
|
|
- UI_ComponentName.ProxyEnd();
|
|
|
+ typeItem.m_icon.url = "ui://MatchingCompetition/hz_fenleitu_" + item1.id;
|
|
|
+ typeItem.m_txtname.text = item1.name;
|
|
|
+ //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconzi_" + item1.id;
|
|
|
+ typeItem.m_imgNeed.visible = false;
|
|
|
+ typeItem.m_imgNew.visible = false;
|
|
|
+ if (item.data == null)
|
|
|
+ {
|
|
|
+ item.onClick.Add(OnClickListType1Item);
|
|
|
+ }
|
|
|
+ item.data = item1;
|
|
|
+ UI_MatchingTypeItem.ProxyEnd();
|
|
|
}
|
|
|
private void ListItemType2Render(int index, GObject obj)
|
|
|
{
|
|
@@ -147,8 +183,29 @@ namespace GFGGame
|
|
|
private void OnClickListType1Item(EventContext context)
|
|
|
{
|
|
|
GObject item = context.sender as GObject;
|
|
|
- int index = (int)item.data;
|
|
|
- nameIndex = index;
|
|
|
+ DressUpMenuItemCfg1 index = (DressUpMenuItemCfg1)item.data;
|
|
|
+ IdList.Clear();
|
|
|
+ foreach (var idItem in AllIdList)
|
|
|
+ {
|
|
|
+ ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(idItem);
|
|
|
+ if (index.type != 0)
|
|
|
+ {
|
|
|
+ if (itemCfg.subType == index.type)
|
|
|
+ {
|
|
|
+ IdList.Add(idItem);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ foreach(var itemSubMenus in index.subMenusArr)
|
|
|
+ {
|
|
|
+ if(DressUpMenuItemCfg2Array.Instance.dataArray[(itemSubMenus -1)].type == itemCfg.subType)
|
|
|
+ {
|
|
|
+ IdList.Add(idItem);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
_ui.m_dressList.numItems = IdList.Count;
|
|
|
_ui.m_dressList.visible = true;
|
|
|
_ui.m_nameList.visible = false;
|