|
@@ -6,6 +6,7 @@ using System;
|
|
using ET;
|
|
using ET;
|
|
using System.Collections;
|
|
using System.Collections;
|
|
using System.Threading.Tasks;
|
|
using System.Threading.Tasks;
|
|
|
|
+using YooAsset;
|
|
|
|
|
|
namespace GFGGame
|
|
namespace GFGGame
|
|
{
|
|
{
|
|
@@ -50,6 +51,7 @@ namespace GFGGame
|
|
|
|
|
|
public override void Dispose()
|
|
public override void Dispose()
|
|
{
|
|
{
|
|
|
|
+ RemoveSoftMask();
|
|
if (_valueBarController != null)
|
|
if (_valueBarController != null)
|
|
{
|
|
{
|
|
_valueBarController.Dispose();
|
|
_valueBarController.Dispose();
|
|
@@ -104,6 +106,8 @@ namespace GFGGame
|
|
_ui.m_btnBack.onClick.Add(OnClickBtnBack);
|
|
_ui.m_btnBack.onClick.Add(OnClickBtnBack);
|
|
_ui.m_btnProduction.onClick.Add(OnClickBtnProcuction);
|
|
_ui.m_btnProduction.onClick.Add(OnClickBtnProcuction);
|
|
_ui.m_btnHome.onClick.Add(OnClickBtnHome);
|
|
_ui.m_btnHome.onClick.Add(OnClickBtnHome);
|
|
|
|
+ _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("hc_bj_1");
|
|
|
|
+
|
|
UpdateMaskHeight();
|
|
UpdateMaskHeight();
|
|
|
|
|
|
}
|
|
}
|
|
@@ -123,8 +127,7 @@ namespace GFGGame
|
|
_selectedItemId = (this.viewData as object[]).Length > 1 ? (int)(this.viewData as object[])[1] : 0;
|
|
_selectedItemId = (this.viewData as object[]).Length > 1 ? (int)(this.viewData as object[])[1] : 0;
|
|
}
|
|
}
|
|
_valueBarController.OnShown();
|
|
_valueBarController.OnShown();
|
|
- _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("hc_bj_1");
|
|
|
|
-
|
|
|
|
|
|
+ _ui.m_loaBg2.url = ResPathUtil.GetBgImgPath("hc_bj_1");
|
|
UpdateClothingList(false);
|
|
UpdateClothingList(false);
|
|
|
|
|
|
Timers.inst.AddUpdate(CheckGuide);
|
|
Timers.inst.AddUpdate(CheckGuide);
|
|
@@ -137,6 +140,7 @@ namespace GFGGame
|
|
_ui.m_listMaterias.selectedIndex = 0;
|
|
_ui.m_listMaterias.selectedIndex = 0;
|
|
Timers.inst.Remove(CheckGuide);
|
|
Timers.inst.Remove(CheckGuide);
|
|
_dressUpObjUI.dressUpObj.TakeOffAll();
|
|
_dressUpObjUI.dressUpObj.TakeOffAll();
|
|
|
|
+
|
|
}
|
|
}
|
|
protected override void RemoveEventListener()
|
|
protected override void RemoveEventListener()
|
|
{
|
|
{
|
|
@@ -212,6 +216,8 @@ namespace GFGGame
|
|
private EaseType ease = EaseType.CubicOut;
|
|
private EaseType ease = EaseType.CubicOut;
|
|
private void UpdateRole(bool tween)
|
|
private void UpdateRole(bool tween)
|
|
{
|
|
{
|
|
|
|
+ // 隐藏遮罩
|
|
|
|
+ _ui.m_loaBg2.visible = false;
|
|
// 根据高度比例放大(越高越大)
|
|
// 根据高度比例放大(越高越大)
|
|
float rate = Screen.height * 1080f / 1920f / Screen.width;
|
|
float rate = Screen.height * 1080f / 1920f / Screen.width;
|
|
// 平板会比宽手机更宽,设定最小值防止缩小
|
|
// 平板会比宽手机更宽,设定最小值防止缩小
|
|
@@ -246,11 +252,13 @@ namespace GFGGame
|
|
}
|
|
}
|
|
else if (Array.IndexOf(LOWER_BODY_Y_ARR, type) >= 0)
|
|
else if (Array.IndexOf(LOWER_BODY_Y_ARR, type) >= 0)
|
|
{
|
|
{
|
|
|
|
+ _ui.m_loaBg2.visible = true;
|
|
_compMover.target.TweenMoveY(LOWER_BODY_Y + dy, 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);
|
|
_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)
|
|
else if (Array.IndexOf(SHOES_Y_ARR, type) >= 0)
|
|
{
|
|
{
|
|
|
|
+ _ui.m_loaBg2.visible = true;
|
|
_compMover.target.TweenMoveY(SHOES_Y + dy, 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);
|
|
_compMover.target.TweenScale(new Vector2(SHOES_SCALE * rate, SHOES_SCALE * rate), duration).SetEase(ease);
|
|
}
|
|
}
|
|
@@ -475,6 +483,33 @@ namespace GFGGame
|
|
{
|
|
{
|
|
await Task.Delay(5);
|
|
await Task.Delay(5);
|
|
_ui.m_compHolder.m_mask.height = _ui.m_posHelper.height;
|
|
_ui.m_compHolder.m_mask.height = _ui.m_posHelper.height;
|
|
|
|
+ SetSoftMask();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 创建二层渐变背景遮罩
|
|
|
|
+ /// </summary>
|
|
|
|
+ private void SetSoftMask()
|
|
|
|
+ {
|
|
|
|
+ var handle = YooAssets.LoadAssetSync<Material>(ResPathUtil.GetPrefabPath("ImageGradient", "mat"));
|
|
|
|
+ Material m = handle.AssetObject as Material;
|
|
|
|
+ _ui.m_loaBg2.material = m;
|
|
|
|
+ _ui.m_loaBg2.position = _ui.m_loaBg.position;
|
|
|
|
+ float startY = _ui.m_loaBg2Pos.position.y;
|
|
|
|
+ float endY = _ui.m_posHelper.position.y;
|
|
|
|
+ float rate = 1 - ((Mathf.Abs(startY - endY)) / _ui.m_loaBg2.height);
|
|
|
|
+ _ui.m_loaBg2.material.SetFloat("_MinHeight", rate - 0.01f);
|
|
|
|
+ _ui.m_loaBg2.material.SetFloat("_MaxHeight", rate - 0.03f);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void RemoveSoftMask()
|
|
|
|
+ {
|
|
|
|
+ AssetReleaser assetReleaser = _ui.m_loaBg2.displayObject.gameObject.GetComponent<AssetReleaser>();
|
|
|
|
+ if (assetReleaser != null)
|
|
|
|
+ {
|
|
|
|
+ //必须立即销毁,不能改为Destroy代替
|
|
|
|
+ GameObject.DestroyImmediate(assetReleaser);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|