|
@@ -5,6 +5,7 @@ using System.Collections.Generic;
|
|
|
using System;
|
|
|
using ET;
|
|
|
using System.Collections;
|
|
|
+using System.Threading.Tasks;
|
|
|
|
|
|
namespace GFGGame
|
|
|
{
|
|
@@ -44,6 +45,7 @@ namespace GFGGame
|
|
|
private List<ItemData> _materiarsOfSelectedItem;
|
|
|
|
|
|
private UI_MateriasListItem listTypeItem_CloSynthetic;
|
|
|
+ private UI_Component2 _compMover;
|
|
|
|
|
|
|
|
|
public override void Dispose()
|
|
@@ -85,6 +87,7 @@ namespace GFGGame
|
|
|
isReturnView = true;
|
|
|
//this.clickBlankToClose = false;
|
|
|
|
|
|
+ _compMover = _ui.m_compHolder.m_compHolder.m_compMover;
|
|
|
_valueBarController = new ValueBarController(_ui.m_valueBar);
|
|
|
|
|
|
_dressUpObjUI = new DressUpObjUI("SceneDressUpSynthetic");
|
|
@@ -101,6 +104,7 @@ namespace GFGGame
|
|
|
_ui.m_btnBack.onClick.Add(OnClickBtnBack);
|
|
|
_ui.m_btnProduction.onClick.Add(OnClickBtnProcuction);
|
|
|
_ui.m_btnHome.onClick.Add(OnClickBtnHome);
|
|
|
+ UpdateMaskHeight();
|
|
|
|
|
|
}
|
|
|
protected override void AddEventListener()
|
|
@@ -208,10 +212,15 @@ namespace GFGGame
|
|
|
private EaseType ease = EaseType.CubicOut;
|
|
|
private void UpdateRole(bool tween)
|
|
|
{
|
|
|
+ // 根据高度比例放大(越高越大)
|
|
|
+ float rate = Screen.height * 1080f / 1920f / Screen.width;
|
|
|
+ // 平板会比宽手机更宽,设定最小值防止缩小
|
|
|
+ rate = Mathf.Max(rate, 1);
|
|
|
+
|
|
|
_dressUpObjUI.ResetSceneObj(45, true, true, null, false);
|
|
|
_dressUpObjUI.dressUpObj.AddOrRemove(_selectedItemId, true);
|
|
|
_imgSelected.visible = _dressUpObjUI.dressUpObj.CheckDressUpItemIsOn(_selectedItemId);
|
|
|
- _dressUpObjUI.UpdateWrapper(_ui.m_compHolder.m_compMover.m_holder);
|
|
|
+ _dressUpObjUI.UpdateWrapper(_compMover.m_holder);
|
|
|
int type = ItemUtilCS.GetItemSubType(_selectedItemId);
|
|
|
float duration = DURATION;
|
|
|
if (!tween)
|
|
@@ -222,33 +231,33 @@ namespace GFGGame
|
|
|
var dy = _ui.m_compHolder.target.height - 642;
|
|
|
if (Array.IndexOf(HEAD_Y_ARR, type) >= 0)
|
|
|
{
|
|
|
- _ui.m_compHolder.m_compMover.target.TweenMoveY(HEAD_Y + dy, duration).SetEase(ease);
|
|
|
- _ui.m_compHolder.m_compMover.target.TweenScale(new Vector2(HEAD_SCALE, HEAD_SCALE), duration).SetEase(ease);
|
|
|
+ _compMover.target.TweenMoveY(HEAD_Y + dy, duration).SetEase(ease);
|
|
|
+ _compMover.target.TweenScale(new Vector2(HEAD_SCALE * rate, HEAD_SCALE * rate), duration).SetEase(ease);
|
|
|
}
|
|
|
else if (Array.IndexOf(FA_XING_Y_ARR, type) >= 0)
|
|
|
{
|
|
|
- _ui.m_compHolder.m_compMover.target.TweenMoveY(FA_XING_Y + dy, duration).SetEase(ease);
|
|
|
- _ui.m_compHolder.m_compMover.target.TweenScale(new Vector2(FA_XING_SCALE, FA_XING_SCALE), duration).SetEase(ease);
|
|
|
+ _compMover.target.TweenMoveY(FA_XING_Y + dy, duration).SetEase(ease);
|
|
|
+ _compMover.target.TweenScale(new Vector2(FA_XING_SCALE * rate, FA_XING_SCALE * rate), duration).SetEase(ease);
|
|
|
}
|
|
|
else if (Array.IndexOf(UPPER_BODY_Y_ARR, type) >= 0)
|
|
|
{
|
|
|
- _ui.m_compHolder.m_compMover.target.TweenMoveY(UPPER_BODY_Y + dy, duration).SetEase(ease);
|
|
|
- _ui.m_compHolder.m_compMover.target.TweenScale(new Vector2(UPPER_BODY_SCALE, UPPER_BODY_SCALE), duration).SetEase(ease);
|
|
|
+ _ui.m_compHolder.m_compHolder.m_compMover.target.TweenMoveY(UPPER_BODY_Y + dy, duration).SetEase(ease);
|
|
|
+ _compMover.target.TweenScale(new Vector2(UPPER_BODY_SCALE* rate, UPPER_BODY_SCALE * rate), duration).SetEase(ease);
|
|
|
}
|
|
|
else if (Array.IndexOf(LOWER_BODY_Y_ARR, type) >= 0)
|
|
|
{
|
|
|
- _ui.m_compHolder.m_compMover.target.TweenMoveY(LOWER_BODY_Y + dy, duration).SetEase(ease);
|
|
|
- _ui.m_compHolder.m_compMover.target.TweenScale(new Vector2(LOWER_BODY_SCALE, LOWER_BODY_SCALE), duration).SetEase(ease);
|
|
|
+ _compMover.target.TweenMoveY(LOWER_BODY_Y + dy, duration).SetEase(ease);
|
|
|
+ _compMover.target.TweenScale(new Vector2(LOWER_BODY_SCALE * rate, LOWER_BODY_SCALE* rate), duration).SetEase(ease);
|
|
|
}
|
|
|
else if (Array.IndexOf(SHOES_Y_ARR, type) >= 0)
|
|
|
{
|
|
|
- _ui.m_compHolder.m_compMover.target.TweenMoveY(SHOES_Y + dy, duration).SetEase(ease);
|
|
|
- _ui.m_compHolder.m_compMover.target.TweenScale(new Vector2(SHOES_SCALE, SHOES_SCALE), duration).SetEase(ease);
|
|
|
+ _compMover.target.TweenMoveY(SHOES_Y + dy, duration).SetEase(ease);
|
|
|
+ _compMover.target.TweenScale(new Vector2(SHOES_SCALE * rate, SHOES_SCALE * rate), duration).SetEase(ease);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- _ui.m_compHolder.m_compMover.target.TweenMoveY(BODY_Y + dy, duration).SetEase(ease);
|
|
|
- _ui.m_compHolder.m_compMover.target.TweenScale(new Vector2(BODY_SCALE, BODY_SCALE), duration).SetEase(ease);
|
|
|
+ _compMover.target.TweenMoveY(BODY_Y + dy, duration).SetEase(ease);
|
|
|
+ _compMover.target.TweenScale(new Vector2(BODY_SCALE * rate, BODY_SCALE * rate), duration).SetEase(ease);
|
|
|
}
|
|
|
|
|
|
if (!tween)
|
|
@@ -457,5 +466,15 @@ namespace GFGGame
|
|
|
GuideController.TryGuide(_ui.m_btnProduction, ConstGuideId.CLOTHING_SYNTHETIC, 5, "点击获得新的服饰。");
|
|
|
GuideController.TryGuide(_ui.m_btnBack, ConstGuideId.CLOTHING_SYNTHETIC, 6, "获得新衣服啦,继续通关主线剧情吧。");
|
|
|
}
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 按照屏幕尺寸 更新遮罩的高度
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ private async Task UpdateMaskHeight()
|
|
|
+ {
|
|
|
+ await Task.Delay(5);
|
|
|
+ _ui.m_compHolder.m_mask.height = _ui.m_posHelper.height;
|
|
|
+ }
|
|
|
}
|
|
|
}
|