|
|
@@ -34,6 +34,13 @@ namespace GFGGame
|
|
|
OnSuitPutOnComplete += callback;
|
|
|
}
|
|
|
|
|
|
+ public void ResetOnSuitPutOnComplete()
|
|
|
+ {
|
|
|
+ _activeLayerOperationCount = 0;
|
|
|
+ _completedLayerOperationCount = 0;
|
|
|
+ OnSuitPutOnComplete = null; ;
|
|
|
+ }
|
|
|
+
|
|
|
public int bgId
|
|
|
{
|
|
|
get { return _dressUpData.bgId; }
|
|
|
@@ -742,18 +749,22 @@ namespace GFGGame
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
CheckCurDressIsSuit();
|
|
|
+ UpdateBodyView(itemIdLianYiQun, action);
|
|
|
+
|
|
|
var handler = DressUpUtil.UpdateHeadAsync(!hasZhuangRong, _sceneObj, _needSetMask, _roleObj);
|
|
|
+ //handler.Completed += (aob) => { UpdateBodyView(itemIdLianYiQun, action); };
|
|
|
TryAddHandler(handler);
|
|
|
- if (action == null)
|
|
|
- {
|
|
|
- UpdateBodyView(itemIdLianYiQun);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- handler.Completed += (aob) => { UpdateBodyView(itemIdLianYiQun, action); };
|
|
|
- //UpdateBodyView(itemIdLianYiQun, action);
|
|
|
- }
|
|
|
+ //if (action == null)
|
|
|
+ //{
|
|
|
+ // UpdateBodyView(itemIdLianYiQun);
|
|
|
+ //}
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ // //handler.Completed += (aob) => { UpdateBodyView(itemIdLianYiQun, action); };
|
|
|
+ // UpdateBodyView(itemIdLianYiQun, action);
|
|
|
+ //}
|
|
|
}
|
|
|
|
|
|
//更新整个身体
|
|
|
@@ -768,7 +779,9 @@ namespace GFGGame
|
|
|
}
|
|
|
|
|
|
var handler = DressUpUtil.UpdateBodyAsync(actionRes, _sceneObj, _needSetMask, _roleObj, itemIdLianYiQun);
|
|
|
- handler.Completed += (aob) => { action?.Invoke(needYooAsseetDown); };
|
|
|
+ //handler.Completed += (aob) => {
|
|
|
+ // action?.Invoke(needYooAsseetDown);
|
|
|
+ //};
|
|
|
TryAddHandler(handler);
|
|
|
}
|
|
|
|
|
|
@@ -796,29 +809,82 @@ namespace GFGGame
|
|
|
if (draw)
|
|
|
{
|
|
|
var t = handlers.ToArray();
|
|
|
- handlers.Clear();
|
|
|
+ Debug.Log($"===draw:{handlers.Count}");
|
|
|
+ //_activeLayerOperationCount = handlers.Count;
|
|
|
+ int w = 0;
|
|
|
+ int q = 0;
|
|
|
foreach (var handler in t)
|
|
|
{
|
|
|
if (handler.Status == YooAsset.EOperationStatus.Succeed)
|
|
|
{
|
|
|
- handler.UpdateView();
|
|
|
- _completedLayerOperationCount++;
|
|
|
+ if (handler is DressUpLayerOperation)
|
|
|
+ {
|
|
|
+ var duo = (DressUpLayerOperation)handler;
|
|
|
+ Debug.Log($"{duo.actionType}, {duo.resPath}, {duo.effectResPath}");
|
|
|
+ handler.UpdateView(() =>
|
|
|
+ {
|
|
|
+ _completedLayerOperationCount++;
|
|
|
+ //_activeLayerOperationCount + 2 ,是因为update head和body没有_activeLayerOperationCount++???所以handlers.Count总是多两个
|
|
|
+ Debug.Log($"upLayer:{_completedLayerOperationCount}/{_activeLayerOperationCount + 2}");
|
|
|
+ if (_isPuttingOnSuit &&
|
|
|
+ _activeLayerOperationCount > 0 &&
|
|
|
+ _completedLayerOperationCount >= _activeLayerOperationCount + 2)
|
|
|
+ {
|
|
|
+ Debug.Log("进入uplayer的最终回调");
|
|
|
+ _isPuttingOnSuit = false;
|
|
|
+ OnSuitPutOnComplete?.Invoke();
|
|
|
+ ResetOnSuitPutOnComplete();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ w++;
|
|
|
+ }
|
|
|
+ else if (handler is DressUpRemoveOperation)
|
|
|
+ {
|
|
|
+ var duo = (DressUpRemoveOperation)handler;
|
|
|
+ Debug.Log(duo.itemID);
|
|
|
+ //q++;
|
|
|
+ handler.UpdateView(() =>
|
|
|
+ {
|
|
|
+ //_completedLayerOperationCount++;
|
|
|
+ //Debug.Log($"remove:{_completedLayerOperationCount}/{_activeLayerOperationCount}");
|
|
|
+ //if (_isPuttingOnSuit &&
|
|
|
+ // _activeLayerOperationCount > 0 &&
|
|
|
+ // _completedLayerOperationCount >= _activeLayerOperationCount)
|
|
|
+ //{
|
|
|
+ // Debug.Log("进入remove的最终回调");
|
|
|
+ // _isPuttingOnSuit = false;
|
|
|
+ // OnSuitPutOnComplete?.Invoke();
|
|
|
+ // ResetOnSuitPutOnComplete();
|
|
|
+ //}
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Debug.Log("漏了");
|
|
|
+ }
|
|
|
+ //handler.UpdateView();
|
|
|
+ // _completedLayerOperationCount++;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
handler.Release();
|
|
|
}
|
|
|
+ //Debug.Log($"WWWWWWW:{w}");
|
|
|
+ //Debug.Log($"WWWWWWW:{q}");
|
|
|
|
|
|
onUpdateAction?.Invoke();
|
|
|
+ handlers.Clear();
|
|
|
//LogUtil.LogEditor($"draw {TimeHelper.ClientNow()}");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (_isPuttingOnSuit && _activeLayerOperationCount > 0 &&
|
|
|
- _completedLayerOperationCount >= _activeLayerOperationCount)
|
|
|
- {
|
|
|
- _isPuttingOnSuit = false;
|
|
|
- OnSuitPutOnComplete?.Invoke();
|
|
|
- }
|
|
|
+ //if (_isPuttingOnSuit && _activeLayerOperationCount > 0 &&
|
|
|
+ // _completedLayerOperationCount >= _activeLayerOperationCount)
|
|
|
+ //{
|
|
|
+ // _isPuttingOnSuit = false;
|
|
|
+ // OnSuitPutOnComplete?.Invoke();
|
|
|
+ //}
|
|
|
}
|
|
|
|
|
|
private void TryAddHandlers(List<DressUpLayerOperation> t)
|
|
|
@@ -827,6 +893,7 @@ namespace GFGGame
|
|
|
{
|
|
|
foreach (var h in t)
|
|
|
{
|
|
|
+ Debug.Log("_activeLayerOperationCount++");
|
|
|
_activeLayerOperationCount++;
|
|
|
TryAddHandler(h);
|
|
|
}
|