|
@@ -7,6 +7,7 @@ using UnityEngine;
|
|
|
using System.Collections;
|
|
|
using Live2D.Cubism.Rendering;
|
|
|
using DG.Tweening;
|
|
|
+using System.Threading.Tasks;
|
|
|
|
|
|
namespace GFGGame
|
|
|
{
|
|
@@ -122,11 +123,21 @@ namespace GFGGame
|
|
|
int scale = _luckyBoxCfg.scaleArr.Length > 0 ? Math.Abs(_luckyBoxCfg.scaleArr[_modelIndex]) / 10000 : 100;
|
|
|
_comModel.m_loaMask.alpha = 1;
|
|
|
comRes.m_loaRes.url = "";
|
|
|
- _dressUpObjUIs[_index].UpdateWrapper(comRes.m_holder);
|
|
|
- comRes.m_holder.SetPosition(_luckyBoxCfg.posArr[_modelIndex][0], _luckyBoxCfg.posArr[_modelIndex][1], 1);
|
|
|
- _dressUpObjUIs[_index].ResetSceneObj(scale, false, false, null, false);
|
|
|
- _dressUpObjUIs[_index].dressUpObj.PutOnSuitCfg(_luckyBoxCfg.suitIdArr[_modelIndex], true, new int[] { ConstDressUpItemType.BEI_JING }, false, false);
|
|
|
- Timers.inst.StartCoroutine(DelayShowModel(direction));
|
|
|
+
|
|
|
+ if(modelInfos[_index] == null)
|
|
|
+ {
|
|
|
+ modelInfos[_index] = new ModelInfo();
|
|
|
+ _dressUpObjUIs[_index].UpdateWrapper(comRes.m_holder);
|
|
|
+ comRes.m_holder.SetPosition(_luckyBoxCfg.posArr[_modelIndex][0], _luckyBoxCfg.posArr[_modelIndex][1], 1);
|
|
|
+ _dressUpObjUIs[_index].ResetSceneObj(scale, false, false, null, false);
|
|
|
+ _dressUpObjUIs[_index].dressUpObj.PutOnSuitCfg(_luckyBoxCfg.suitIdArr[_modelIndex], true, new int[] { ConstDressUpItemType.BEI_JING }, false, false);
|
|
|
+ Timers.inst.StartCoroutine(DelayShowModel(direction));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ShowModel();
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -159,11 +170,10 @@ namespace GFGGame
|
|
|
_modelIndex = 0;
|
|
|
_dressUpObjUI.dressUpObj.TakeOffAll();
|
|
|
|
|
|
- InitModel(0);
|
|
|
ChangeModelAlpha(0, 1);
|
|
|
-
|
|
|
- InitModel(1);
|
|
|
ChangeModelAlpha(1, 1);
|
|
|
+
|
|
|
+
|
|
|
// 隐藏另一个模型
|
|
|
if (_dressUpObjUIs[0].sceneObject != null)
|
|
|
{
|
|
@@ -264,6 +274,7 @@ namespace GFGGame
|
|
|
}
|
|
|
|
|
|
private void ChangeModelAlphaAnim(int index, float start, float end, Action action = null)
|
|
|
+
|
|
|
{
|
|
|
Ease ease = Ease.Linear;
|
|
|
DOTween.To(() => start, (value) =>
|
|
@@ -277,8 +288,8 @@ namespace GFGGame
|
|
|
|
|
|
private void InitDressUpObj()
|
|
|
{
|
|
|
- modelInfos[0] = new ModelInfo();
|
|
|
- modelInfos[1] = new ModelInfo();
|
|
|
+ modelInfos[0] = null;
|
|
|
+ modelInfos[1] = null;
|
|
|
|
|
|
UI_ComModel _comModel = UI_ComModel.Proxy(_com);
|
|
|
_dressUpObjUI.UpdateWrapper(_comModel.m_comModelRes.m_holder);
|