|
@@ -17,10 +17,7 @@ namespace GFGGame
|
|
|
private readonly int[] HEAD_Y_ARR = new int[] { ConstDressUpItemType.FA_XING, ConstDressUpItemType.NEI_DA, ConstDressUpItemType.SHANG_YI, ConstDressUpItemType.TOU_SHI, ConstDressUpItemType.ER_SHI, ConstDressUpItemType.JING_SHI };
|
|
|
private readonly int[] SHOES_Y_ARR = new int[] { ConstDressUpItemType.XIA_ZHUANG, ConstDressUpItemType.WA_ZI, ConstDressUpItemType.XIE_ZI, ConstDressUpItemType.SHOU_SHI, ConstDressUpItemType.YAO_SHI };
|
|
|
private UI_ClothingShopUI _ui;
|
|
|
- private GameObject _scenePrefab;
|
|
|
- private GameObject _sceneObject;
|
|
|
- private GoWrapper _wrapper;
|
|
|
- private DressUpObj _dressUpObj;
|
|
|
+ private DressUpObjUI _dressUpObjUI;
|
|
|
private ValueBarController _valueBarController;
|
|
|
private List<ShopCfg> _dataList;
|
|
|
private GImage _comSelected;
|
|
@@ -44,26 +41,20 @@ namespace GFGGame
|
|
|
_valueBarController = null;
|
|
|
}
|
|
|
|
|
|
- if (_sceneObject != null)
|
|
|
+ if (_dressUpObjUI != null)
|
|
|
{
|
|
|
- GameObject.Destroy(_sceneObject);
|
|
|
- _sceneObject = null;
|
|
|
- }
|
|
|
-
|
|
|
- if (_wrapper != null)
|
|
|
- {
|
|
|
- _wrapper.Dispose();
|
|
|
- _wrapper = null;
|
|
|
+ _dressUpObjUI.Dispose();
|
|
|
+ _dressUpObjUI = null;
|
|
|
}
|
|
|
if (_comSelected != null)
|
|
|
{
|
|
|
_comSelected.RemoveFromParent();
|
|
|
_comSelected.Dispose();
|
|
|
}
|
|
|
- if (_dressUpObj != null)
|
|
|
+ if (_dressUpObjUI != null)
|
|
|
{
|
|
|
- _dressUpObj.Dispose();
|
|
|
- _dressUpObj = null;
|
|
|
+ _dressUpObjUI.Dispose();
|
|
|
+ _dressUpObjUI = null;
|
|
|
}
|
|
|
_cfgSelected = null;
|
|
|
|
|
@@ -85,8 +76,7 @@ namespace GFGGame
|
|
|
isfullScreen = true;
|
|
|
|
|
|
_valueBarController = new ValueBarController(_ui.m_valueBar);
|
|
|
- _scenePrefab = GFGAsset.Load<GameObject>(ResPathUtil.GetPrefabPath("SceneDressUp"));
|
|
|
- _dressUpObj = new DressUpObj();
|
|
|
+ _dressUpObjUI = new DressUpObjUI("SceneDressUp");
|
|
|
|
|
|
_comSelected = new GImage();
|
|
|
_comSelected.x = -5;
|
|
@@ -199,15 +189,6 @@ namespace GFGGame
|
|
|
{
|
|
|
base.OnHide();
|
|
|
_valueBarController.OnHide();
|
|
|
- if (_sceneObject != null)
|
|
|
- {
|
|
|
- GameObject.Destroy(_sceneObject);
|
|
|
- _sceneObject = null;
|
|
|
- }
|
|
|
- if (_wrapper != null)
|
|
|
- {
|
|
|
- _wrapper.wrapTarget = null;
|
|
|
- }
|
|
|
_selectedItemId = 0;
|
|
|
Timers.inst.Remove(CheckGuide);
|
|
|
|
|
@@ -254,26 +235,9 @@ namespace GFGGame
|
|
|
}
|
|
|
private void UpdateRole(bool tween)
|
|
|
{
|
|
|
- if (_sceneObject != null)
|
|
|
- {
|
|
|
- GameObject.Destroy(_sceneObject);
|
|
|
- _sceneObject = null;
|
|
|
- }
|
|
|
- _sceneObject = GameObject.Instantiate(_scenePrefab);
|
|
|
- int scale = 70;
|
|
|
- _sceneObject.transform.localScale = new Vector3(scale, scale, scale);
|
|
|
- _dressUpObj.setSceneObj(_sceneObject, false, true, null, false);
|
|
|
- _dressUpObj.PutOnDefaultDressUpData();
|
|
|
- _dressUpObj.AddOrRemove(_cfgSelected.itemID, true);
|
|
|
- if (_wrapper == null)
|
|
|
- {
|
|
|
- _wrapper = new GoWrapper(_sceneObject);
|
|
|
- _ui.m_compHolder.m_compMover.m_holder.SetNativeObject(_wrapper);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- _wrapper.wrapTarget = _sceneObject;
|
|
|
- }
|
|
|
+ _dressUpObjUI.ResetSceneObj(70, false, true, null, false);
|
|
|
+ _dressUpObjUI.dressUpObj.AddOrRemove(_cfgSelected.itemID, true);
|
|
|
+ _dressUpObjUI.UpdateWrapper(_ui.m_compHolder.m_compMover.m_holder);
|
|
|
int type = ItemUtilCS.GetItemSubType(_cfgSelected.itemID);
|
|
|
float duration = DURATION;
|
|
|
if (!tween)
|