|
@@ -293,7 +293,7 @@ namespace GFGGame
|
|
|
}
|
|
|
TakeOffAll(false);
|
|
|
_dressUpData.suitId = id;
|
|
|
- bool hasSuitActionRes = DressUpMenuSuitDataManager.CheckSuitHasAction(_dressUpData.suitId);
|
|
|
+ bool hasSuitActionRes = DressUpMenuSuitDataManager.CheckSuitHasActionRes(_dressUpData.suitId);
|
|
|
_dressUpData.actionId = (hasSuitActionRes && tryShowAction) ? id : 0;
|
|
|
SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(_dressUpData.suitId);
|
|
|
List<int> items = new List<int>(suitCfg.partsArr);
|
|
@@ -325,6 +325,63 @@ namespace GFGGame
|
|
|
UpdateWholeBodyView();
|
|
|
}
|
|
|
|
|
|
+ //穿上一个动作
|
|
|
+ public void PutOnAction(int actionId)
|
|
|
+ {
|
|
|
+ bool hasSuitActionRes = DressUpMenuSuitDataManager.CheckSuitHasActionRes(_dressUpData.suitId);
|
|
|
+ _dressUpData.actionId = actionId;
|
|
|
+ if(hasSuitActionRes)
|
|
|
+ {
|
|
|
+ foreach (int itemId in itemList)
|
|
|
+ {
|
|
|
+ bool replaceableByAction = SuitCfgArray.Instance.CheckItemReaplaceableByAction(itemId, _dressUpData.actionId);
|
|
|
+ if (!replaceableByAction)
|
|
|
+ {
|
|
|
+ AddOrRemove(itemId, false, false, true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ CancelAction(true);
|
|
|
+ }
|
|
|
+ checkDefaultItem();
|
|
|
+ UpdateWholeBodyView();
|
|
|
+ }
|
|
|
+
|
|
|
+ //取消动作
|
|
|
+ public void CancelAction(bool changeToStand = false)
|
|
|
+ {
|
|
|
+ if (_dressUpData.actionId <= 0)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var tempActionId = _dressUpData.actionId;
|
|
|
+ _dressUpData.actionId = 0;
|
|
|
+ if (changeToStand)
|
|
|
+ {
|
|
|
+ SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(tempActionId);
|
|
|
+ List<int> items = new List<int>(suitCfg.partsArr);
|
|
|
+ if (suitCfg.partsOptionalArr != null && suitCfg.partsOptionalArr.Length > 0)
|
|
|
+ {
|
|
|
+ items.AddRange(suitCfg.partsOptionalArr);
|
|
|
+ }
|
|
|
+ foreach (int itemId in items)
|
|
|
+ {
|
|
|
+ if (DressUpMenuItemDataManager.CheckHasItem(itemId))
|
|
|
+ {
|
|
|
+ bool replaceableByAction = SuitCfgArray.Instance.CheckItemReaplaceableByAction(itemId, tempActionId);
|
|
|
+ if (!replaceableByAction)
|
|
|
+ {
|
|
|
+ AddOrRemove(itemId, false, true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ checkDefaultItem();
|
|
|
+ UpdateWholeBodyView();
|
|
|
+ }
|
|
|
+
|
|
|
//穿戴一组换装数据
|
|
|
public void PutOnDressUpData(DressUpData dressUpData)
|
|
|
{
|
|
@@ -537,57 +594,6 @@ namespace GFGGame
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //穿上一个动作
|
|
|
- public void PutOnAction(int actionId)
|
|
|
- {
|
|
|
- _dressUpData.actionId = actionId;
|
|
|
- foreach (int itemId in itemList)
|
|
|
- {
|
|
|
- bool replaceableByAction = SuitCfgArray.Instance.CheckItemReaplaceableByAction(itemId, _dressUpData.actionId);
|
|
|
- if (!replaceableByAction)
|
|
|
- {
|
|
|
- AddOrRemove(itemId, false, false, true);
|
|
|
- }
|
|
|
- }
|
|
|
- checkDefaultItem();
|
|
|
- UpdateWholeBodyView();
|
|
|
- }
|
|
|
-
|
|
|
- //取消动作
|
|
|
- public void CancelAction(bool changeToStand = false)
|
|
|
- {
|
|
|
- if (_dressUpData.actionId <= 0)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
- var tempActionId = _dressUpData.actionId;
|
|
|
- _dressUpData.actionId = 0;
|
|
|
- if(changeToStand)
|
|
|
- {
|
|
|
- SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(tempActionId);
|
|
|
- List<int> items = new List<int>(suitCfg.partsArr);
|
|
|
- if (suitCfg.partsOptionalArr != null && suitCfg.partsOptionalArr.Length > 0)
|
|
|
- {
|
|
|
- items.AddRange(suitCfg.partsOptionalArr);
|
|
|
- }
|
|
|
- int subType = 0;
|
|
|
- foreach (int itemId in items)
|
|
|
- {
|
|
|
- if (DressUpMenuItemDataManager.CheckHasItem(itemId))
|
|
|
- {
|
|
|
- subType = ItemUtilCS.GetItemSubType(itemId);
|
|
|
- bool replaceableByAction = SuitCfgArray.Instance.CheckItemReaplaceableByAction(itemId, tempActionId);
|
|
|
- if (!replaceableByAction)
|
|
|
- {
|
|
|
- AddOrRemove(itemId, false, true);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- checkDefaultItem();
|
|
|
- UpdateWholeBodyView();
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
}
|
|
|
}
|