|
@@ -130,10 +130,10 @@ namespace GFGGame
|
|
if (_sceneObject == null)
|
|
if (_sceneObject == null)
|
|
{
|
|
{
|
|
_sceneObject = GameObject.Instantiate(_scenePrefab);
|
|
_sceneObject = GameObject.Instantiate(_scenePrefab);
|
|
- EquipDataCache.cacher.setSceneObj(_sceneObject);
|
|
|
|
|
|
+ MyDressUpHelper.dressUpObj.setSceneObj(_sceneObject);
|
|
}
|
|
}
|
|
_ui.m_comboBox.selectedIndex = CustomSuitDataManager.currentIndex;
|
|
_ui.m_comboBox.selectedIndex = CustomSuitDataManager.currentIndex;
|
|
- EquipDataCache.cacher.PutOnSuitSavedByPos(CustomSuitDataManager.currentIndex);
|
|
|
|
|
|
+ MyDressUpHelper.PutOnSuitSavedByPos(CustomSuitDataManager.currentIndex);
|
|
// UpdateStepBtn();
|
|
// UpdateStepBtn();
|
|
// AddMemoryDressup();
|
|
// AddMemoryDressup();
|
|
Timers.inst.AddUpdate(CheckGuide);
|
|
Timers.inst.AddUpdate(CheckGuide);
|
|
@@ -144,8 +144,8 @@ namespace GFGGame
|
|
base.OnHide();
|
|
base.OnHide();
|
|
listTypeItem_FreedomDress = null;
|
|
listTypeItem_FreedomDress = null;
|
|
// MusicManager.Instance.Play(ResPathUtil.GetMusicPath(ConstMusicName.DEFAULT));
|
|
// MusicManager.Instance.Play(ResPathUtil.GetMusicPath(ConstMusicName.DEFAULT));
|
|
- EquipDataCache.cacher.setSceneObj(_sceneObject);//在拍照界面断线返回登录,需要重新设置_sceneObject
|
|
|
|
- EquipDataCache.cacher.TakeOffAll();
|
|
|
|
|
|
+ MyDressUpHelper.dressUpObj.setSceneObj(_sceneObject);//在拍照界面断线返回登录,需要重新设置_sceneObject
|
|
|
|
+ MyDressUpHelper.dressUpObj.TakeOffAll();
|
|
|
|
|
|
if (_sceneObject != null)
|
|
if (_sceneObject != null)
|
|
{
|
|
{
|
|
@@ -186,7 +186,7 @@ namespace GFGGame
|
|
{
|
|
{
|
|
if (_stepIndex - 1 < 0) return;
|
|
if (_stepIndex - 1 < 0) return;
|
|
_stepIndex--;
|
|
_stepIndex--;
|
|
- EquipDataCache.cacher.PutOnEquipData(_dressMemory[_stepIndex].EquipData);
|
|
|
|
|
|
+ MyDressUpHelper.dressUpObj.PutOnDressUpData(_dressMemory[_stepIndex].dressUpData);
|
|
_ui.m_comboBox.selectedIndex = _dressMemory[_stepIndex].pos;
|
|
_ui.m_comboBox.selectedIndex = _dressMemory[_stepIndex].pos;
|
|
UpdateStepBtn();
|
|
UpdateStepBtn();
|
|
}
|
|
}
|
|
@@ -194,14 +194,14 @@ namespace GFGGame
|
|
{
|
|
{
|
|
if (_stepIndex + 1 >= MAX_MEMORY_STEP) return;
|
|
if (_stepIndex + 1 >= MAX_MEMORY_STEP) return;
|
|
_stepIndex++;
|
|
_stepIndex++;
|
|
- EquipDataCache.cacher.PutOnEquipData(_dressMemory[_stepIndex].EquipData);
|
|
|
|
|
|
+ MyDressUpHelper.dressUpObj.PutOnDressUpData(_dressMemory[_stepIndex].dressUpData);
|
|
_ui.m_comboBox.selectedIndex = _dressMemory[_stepIndex].pos;
|
|
_ui.m_comboBox.selectedIndex = _dressMemory[_stepIndex].pos;
|
|
UpdateStepBtn();
|
|
UpdateStepBtn();
|
|
|
|
|
|
}
|
|
}
|
|
private void OnComboBoxChanged()
|
|
private void OnComboBoxChanged()
|
|
{
|
|
{
|
|
- EquipDataCache.cacher.PutOnSuitSavedByPos(_ui.m_comboBox.selectedIndex);
|
|
|
|
|
|
+ MyDressUpHelper.PutOnSuitSavedByPos(_ui.m_comboBox.selectedIndex);
|
|
}
|
|
}
|
|
|
|
|
|
private void OnClickListType1Item(EventContext context)
|
|
private void OnClickListType1Item(EventContext context)
|
|
@@ -251,18 +251,18 @@ namespace GFGGame
|
|
}
|
|
}
|
|
GObject listItem = (GObject)context.data as GObject;
|
|
GObject listItem = (GObject)context.data as GObject;
|
|
int id = (int)listItem.data;
|
|
int id = (int)listItem.data;
|
|
- bool isSuit = SuitCfgManager.Instance.GetTotalCountOfOneSuit(id) > 0;
|
|
|
|
|
|
+ bool isSuit = SuitCfgArray.Instance.GetTotalCountOfOneSuit(id) > 0;
|
|
if (isSuit)
|
|
if (isSuit)
|
|
{
|
|
{
|
|
this.showListParts2(id);
|
|
this.showListParts2(id);
|
|
this.hideListParts();
|
|
this.hideListParts();
|
|
- EquipDataCache.cacher.PutOnSuitCfg(id, true, false);
|
|
|
|
|
|
+ MyDressUpHelper.dressUpObj.PutOnSuitCfg(id, true);
|
|
UpdateBtnAction();
|
|
UpdateBtnAction();
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- EquipDataCache.cacher.TryCancelSuit(id);
|
|
|
|
- EquipDataCache.cacher.AddOrRemove(id, true);
|
|
|
|
|
|
+ MyDressUpHelper.dressUpObj.CheckCancelActionWhenPutOn(id);
|
|
|
|
+ MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
|
|
}
|
|
}
|
|
UpdateListPartsSelected();
|
|
UpdateListPartsSelected();
|
|
UpdateListSuitPartsSelected(); ;
|
|
UpdateListSuitPartsSelected(); ;
|
|
@@ -279,8 +279,8 @@ namespace GFGGame
|
|
GObject listItem = (GObject)context.data as GObject;
|
|
GObject listItem = (GObject)context.data as GObject;
|
|
int id = (int)listItem.data;
|
|
int id = (int)listItem.data;
|
|
|
|
|
|
- EquipDataCache.cacher.TryCancelSuit(id);
|
|
|
|
- EquipDataCache.cacher.AddOrRemove(id, true);
|
|
|
|
|
|
+ MyDressUpHelper.dressUpObj.CheckCancelActionWhenPutOn(id);
|
|
|
|
+ MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
|
|
|
|
|
|
UpdateListSuitPartsSelected();
|
|
UpdateListSuitPartsSelected();
|
|
UpdateBtnAction();
|
|
UpdateBtnAction();
|
|
@@ -298,7 +298,7 @@ namespace GFGGame
|
|
{
|
|
{
|
|
_dressMemory.RemoveRange(_stepIndex, _dressMemory.Count - _stepIndex);
|
|
_dressMemory.RemoveRange(_stepIndex, _dressMemory.Count - _stepIndex);
|
|
}
|
|
}
|
|
- CustomSuitData suitSavedData = EquipDataCache.GetCurSuitData(_ui.m_comboBox.selectedIndex);
|
|
|
|
|
|
+ CustomSuitData suitSavedData = MyDressUpHelper.GetCurSuitDataClone(_ui.m_comboBox.selectedIndex);
|
|
_dressMemory.Add(suitSavedData);
|
|
_dressMemory.Add(suitSavedData);
|
|
UpdateStepBtn();
|
|
UpdateStepBtn();
|
|
}
|
|
}
|
|
@@ -345,7 +345,7 @@ namespace GFGGame
|
|
|
|
|
|
private void OnClickBtnDelete()
|
|
private void OnClickBtnDelete()
|
|
{
|
|
{
|
|
- EquipDataCache.cacher.TakeOffAll();
|
|
|
|
|
|
+ MyDressUpHelper.dressUpObj.TakeOffAll();
|
|
UpdateBtnAction();
|
|
UpdateBtnAction();
|
|
_ui.m_partsList.m_list.numItems = _currentList3.Count;
|
|
_ui.m_partsList.m_list.numItems = _currentList3.Count;
|
|
_ui.m_partsList2.m_list.numItems = _currentList4.Count;
|
|
_ui.m_partsList2.m_list.numItems = _currentList4.Count;
|
|
@@ -364,10 +364,7 @@ namespace GFGGame
|
|
|
|
|
|
private void OnClickBtnAction()
|
|
private void OnClickBtnAction()
|
|
{
|
|
{
|
|
- if (!_ui.m_btnAction.grayed)
|
|
|
|
- {
|
|
|
|
- EquipDataCache.cacher.ChangeAction();
|
|
|
|
- }
|
|
|
|
|
|
+ MyDressUpHelper.dressUpObj.PutOnOrTakeOffAction(201003);
|
|
}
|
|
}
|
|
private void OnClickBtnSearch()
|
|
private void OnClickBtnSearch()
|
|
{
|
|
{
|
|
@@ -479,7 +476,7 @@ namespace GFGGame
|
|
}
|
|
}
|
|
if (selectItem)
|
|
if (selectItem)
|
|
{
|
|
{
|
|
- int itemId = EquipDataCache.cacher.GetItemIdBuyType(_currentMenuType);
|
|
|
|
|
|
+ int itemId = MyDressUpHelper.dressUpObj.GetItemIdBuyType(_currentMenuType);
|
|
if (itemId > 0)
|
|
if (itemId > 0)
|
|
{
|
|
{
|
|
int index = _currentList3.IndexOf(itemId);
|
|
int index = _currentList3.IndexOf(itemId);
|
|
@@ -603,7 +600,7 @@ namespace GFGGame
|
|
ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
|
|
ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
|
|
iconRes = itemCfg.res;
|
|
iconRes = itemCfg.res;
|
|
partName = itemCfg.name;
|
|
partName = itemCfg.name;
|
|
- listItem.m_iconSelected.visible = EquipDataCache.cacher.CheckDressUpItemIsOn(id);
|
|
|
|
|
|
+ listItem.m_iconSelected.visible = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
|
|
listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + itemCfg.rarity;
|
|
listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + itemCfg.rarity;
|
|
|
|
|
|
RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false);
|
|
RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false);
|
|
@@ -661,7 +658,7 @@ namespace GFGGame
|
|
ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
|
|
ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
|
|
iconRes = itemCfg.res;
|
|
iconRes = itemCfg.res;
|
|
partName = itemCfg.name;
|
|
partName = itemCfg.name;
|
|
- listItem.m_iconSelected.visible = !_ui.m_btnAction.grayed || EquipDataCache.cacher.CheckDressUpItemIsOn(id);
|
|
|
|
|
|
+ listItem.m_iconSelected.visible = !_ui.m_btnAction.grayed || MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
|
|
listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + itemCfg.rarity;
|
|
listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + itemCfg.rarity;
|
|
RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false);
|
|
RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false);
|
|
ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType, true);
|
|
ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType, true);
|
|
@@ -690,7 +687,7 @@ namespace GFGGame
|
|
private void UpdateListPartsSelected()
|
|
private void UpdateListPartsSelected()
|
|
{
|
|
{
|
|
int count = _ui.m_partsList.m_list.numChildren;
|
|
int count = _ui.m_partsList.m_list.numChildren;
|
|
- int suitId = EquipDataCache.cacher.CheckCurDressIsSuit();
|
|
|
|
|
|
+ int suitId = MyDressUpHelper.dressUpObj.suitId;
|
|
|
|
|
|
for (int i = 0; i < count; i++)
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
{
|
|
@@ -702,11 +699,12 @@ namespace GFGGame
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- bool isPutOn = EquipDataCache.cacher.CheckDressUpItemIsOn(id);//非套装金判断是否穿戴
|
|
|
|
- bool isSuit = !DressUpMenuItemDataManager.CheckIsSceneType(id) && suitId > 0 && SuitCfgManager.Instance.GetItemSuitId(id) == suitId;//非场景类, 若当前穿戴套装要判断item是否属于套装(更换场景类不会改变套装穿戴状态)
|
|
|
|
|
|
+ bool isPutOn = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);//非套装判断是否穿戴
|
|
|
|
+ bool isSceneType = DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(id);
|
|
|
|
+ bool isSuit = !isSceneType && suitId > 0 && SuitCfgArray.Instance.GetSuitIdOfItem(id) == suitId;//非场景类, 若当前穿戴套装要判断item是否属于套装(更换场景类不会改变套装穿戴状态)
|
|
|
|
|
|
- isSuit = !DressUpMenuItemDataManager.CheckIsSceneType(id) && suitId > 0 && suitId == id;
|
|
|
|
- bool isSceneSuit = DressUpMenuItemDataManager.CheckIsSceneType(id) && suitId > 0 && isPutOn;//场景类, 若当前穿戴套装要判断item是否属已穿戴
|
|
|
|
|
|
+ isSuit = !isSceneType && suitId > 0 && suitId == id;
|
|
|
|
+ bool isSceneSuit = isSceneType && suitId > 0 && isPutOn;//场景类, 若当前穿戴套装要判断item是否属已穿戴
|
|
listItem.m_iconSelected.visible = isPutOn || isSuit || isSceneSuit;
|
|
listItem.m_iconSelected.visible = isPutOn || isSuit || isSceneSuit;
|
|
}
|
|
}
|
|
UI_PartsListItem.ProxyEnd();
|
|
UI_PartsListItem.ProxyEnd();
|
|
@@ -715,15 +713,15 @@ namespace GFGGame
|
|
private void UpdateListSuitPartsSelected()
|
|
private void UpdateListSuitPartsSelected()
|
|
{
|
|
{
|
|
int count = _ui.m_partsList2.m_list.numChildren;
|
|
int count = _ui.m_partsList2.m_list.numChildren;
|
|
- int suitId = EquipDataCache.cacher.CheckCurDressIsSuit();
|
|
|
|
|
|
+ int suitId = MyDressUpHelper.dressUpObj.suitId;
|
|
for (int i = 0; i < count; i++)
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
{
|
|
UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsList2.m_list.GetChildAt(i));
|
|
UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsList2.m_list.GetChildAt(i));
|
|
int id = (int)listItem.target.data;
|
|
int id = (int)listItem.target.data;
|
|
|
|
|
|
- bool isPutOn = EquipDataCache.cacher.CheckDressUpItemIsOn(id);//非套装金判断是否穿戴
|
|
|
|
- bool isSuit = !DressUpMenuItemDataManager.CheckIsSceneType(id) && suitId > 0 && SuitCfgManager.Instance.GetItemSuitId(id) == suitId;//非场景类, 若当前穿戴套装要判断item是否属于套装(更换场景类不会改变套装穿戴状态)
|
|
|
|
- bool isSceneSuit = DressUpMenuItemDataManager.CheckIsSceneType(id) && suitId > 0 && isPutOn;//场景类, 若当前穿戴套装要判断item是否属已穿戴
|
|
|
|
|
|
+ bool isPutOn = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);//非套装判断是否穿戴
|
|
|
|
+ bool isSuit = !DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(id) && suitId > 0 && SuitCfgArray.Instance.GetSuitIdOfItem(id) == suitId;//非场景类, 若当前穿戴套装要判断item是否属于套装(更换场景类不会改变套装穿戴状态)
|
|
|
|
+ bool isSceneSuit = DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(id) && suitId > 0 && isPutOn;//场景类, 若当前穿戴套装要判断item是否属已穿戴
|
|
listItem.m_iconSelected.visible = isPutOn || isSuit || isSceneSuit;
|
|
listItem.m_iconSelected.visible = isPutOn || isSuit || isSceneSuit;
|
|
UI_PartsListItem.ProxyEnd();
|
|
UI_PartsListItem.ProxyEnd();
|
|
}
|
|
}
|
|
@@ -783,7 +781,7 @@ namespace GFGGame
|
|
{
|
|
{
|
|
if (_currentMenuType == 0) return;
|
|
if (_currentMenuType == 0) return;
|
|
|
|
|
|
- _currentList4 = new List<int>(SuitCfgManager.Instance.GetSuitItems(_currentSuitId));
|
|
|
|
|
|
+ _currentList4 = new List<int>(SuitCfgArray.Instance.GetSuitItems(_currentSuitId));
|
|
if (_rarityIndex == SORT_BY_HIGH_RARITY)
|
|
if (_rarityIndex == SORT_BY_HIGH_RARITY)
|
|
{
|
|
{
|
|
_currentList4 = DressUpMenuItemDataManager.SortItemListByHighRarity(_currentList4);
|
|
_currentList4 = DressUpMenuItemDataManager.SortItemListByHighRarity(_currentList4);
|
|
@@ -816,7 +814,7 @@ namespace GFGGame
|
|
_ui.m_btnAction.visible = (_currentMenuType == ConstDressUpItemType.TAO_ZHUANG) || this.currentListType == DressUpListType.List4;
|
|
_ui.m_btnAction.visible = (_currentMenuType == ConstDressUpItemType.TAO_ZHUANG) || this.currentListType == DressUpListType.List4;
|
|
if (_ui.m_btnAction.visible)
|
|
if (_ui.m_btnAction.visible)
|
|
{
|
|
{
|
|
- _ui.m_btnAction.grayed = !EquipDataCache.cacher.HasSuitPicRes;
|
|
|
|
|
|
+ //_ui.m_btnAction.grayed = !EquipDataCache.cacher.HasSuitActionRes;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -874,7 +872,7 @@ namespace GFGGame
|
|
_ui.target.visible = true;
|
|
_ui.target.visible = true;
|
|
this._sceneObject.gameObject.SetActive(true);
|
|
this._sceneObject.gameObject.SetActive(true);
|
|
|
|
|
|
- EquipDataCache.cacher.setSceneObj(_sceneObject);
|
|
|
|
|
|
+ MyDressUpHelper.dressUpObj.setSceneObj(_sceneObject);
|
|
|
|
|
|
}
|
|
}
|
|
private void SetBtnShowVisable(object param)
|
|
private void SetBtnShowVisable(object param)
|