|
@@ -50,7 +50,7 @@ namespace FL.FGUI
|
|
|
VM.MenusBtnCtrl.onChanged.Remove(OnMenusBtnCtrlChange);
|
|
|
if (_flyingList != null)
|
|
|
{
|
|
|
- foreach(var flying in _flyingList)
|
|
|
+ foreach (var flying in _flyingList)
|
|
|
{
|
|
|
Context.Asset.Recycle(flying);
|
|
|
}
|
|
@@ -98,7 +98,7 @@ namespace FL.FGUI
|
|
|
return;
|
|
|
}
|
|
|
OpenDragonEggBoxAni(true);
|
|
|
- _autoTimer = Context.Time.AddLooperTimer(500, (int dt)=>
|
|
|
+ _autoTimer = Context.Time.AddLooperTimer(500, (int dt) =>
|
|
|
{
|
|
|
if (IsEmptyBox(false))
|
|
|
{
|
|
@@ -154,8 +154,8 @@ namespace FL.FGUI
|
|
|
|
|
|
private void Init()
|
|
|
{
|
|
|
- _startPos = VM.DragonSpineBtn.displayObject.LocalToWorld(new Vector3(VM.DragonSpineBtn.width/3, VM.DragonSpineBtn.height/2,0));
|
|
|
- _endPos = VM.BagBtn.displayObject.LocalToWorld(new Vector3(VM.BagBtn.width /10, VM.BagBtn.height/8, 0));
|
|
|
+ _startPos = VM.DragonSpineBtn.displayObject.LocalToWorld(new Vector3(VM.DragonSpineBtn.width / 3, VM.DragonSpineBtn.height / 2, 0));
|
|
|
+ _endPos = VM.BagBtn.displayObject.LocalToWorld(new Vector3(VM.BagBtn.width / 10, VM.BagBtn.height / 8, 0));
|
|
|
_scoreEndPos = VM.EggPointBar.displayObject.LocalToWorld(new Vector3(VM.EggPointBar.width / 2, VM.EggPointBar.height / 2, 0));
|
|
|
InitDrangonBoxUI();
|
|
|
InitAttributeDescMap();
|
|
@@ -176,11 +176,11 @@ namespace FL.FGUI
|
|
|
/// </summary>
|
|
|
/// <param name="addScore"></param>
|
|
|
/// <param name="bTweenValue"></param>
|
|
|
- private void ShowDragonEggScoreUI(int addScore,bool bTweenValue = false)
|
|
|
+ private void ShowDragonEggScoreUI(int addScore, bool bTweenValue = false)
|
|
|
{
|
|
|
if (addScore != 0) DragonEggData.Instance.DragonEggSocre += addScore;
|
|
|
VM.EggPointBar.max = DragonEggData.Instance.MaxDragonEggSocre;
|
|
|
- if (bTweenValue)
|
|
|
+ if (bTweenValue)
|
|
|
VM.EggPointBar.TweenValue(DragonEggData.Instance.DragonEggSocre, 0.5f);
|
|
|
else
|
|
|
VM.EggPointBar.value = DragonEggData.Instance.DragonEggSocre;
|
|
@@ -188,8 +188,8 @@ namespace FL.FGUI
|
|
|
}
|
|
|
private void InitDrangonBoxUI()
|
|
|
{
|
|
|
- if (_dragonBtnList == null) _dragonBtnList = new List<GButton>(){ VM.DragonBtn1, VM.DragonBtn2, VM.DragonBtn3, VM.DragonBtn4, VM.DragonBtn5 };
|
|
|
-
|
|
|
+ if (_dragonBtnList == null) _dragonBtnList = new List<GButton>() { VM.DragonBtn1, VM.DragonBtn2, VM.DragonBtn3, VM.DragonBtn4, VM.DragonBtn5 };
|
|
|
+
|
|
|
int index = -1;
|
|
|
for (int i = 0; i < 5; i++)
|
|
|
{
|
|
@@ -233,7 +233,7 @@ namespace FL.FGUI
|
|
|
{
|
|
|
var flyParam = new FlyingIconParam()
|
|
|
{
|
|
|
- iconName = i < 6 ? $"itemicon_{i+1}" : $"itemicon_{99}",
|
|
|
+ iconName = i < 6 ? $"itemicon_{i + 1}" : $"itemicon_{99}",
|
|
|
startPos = _startPos,
|
|
|
bScore = bScore,
|
|
|
endPos = _endPos,
|
|
@@ -242,7 +242,8 @@ namespace FL.FGUI
|
|
|
if (_flyingList == null) _flyingList = new HashSet<DragonEggFlyIconView>();
|
|
|
|
|
|
var loadAsync = Context.Asset.LoadFguiNested(UINestedKeys.DragonEggFlyIcon, VM.DragonSpineBtn);
|
|
|
- loadAsync.On(_ =>{
|
|
|
+ loadAsync.On(_ =>
|
|
|
+ {
|
|
|
var flyView = loadAsync.Result as DragonEggFlyIconView;
|
|
|
if (flyView != null)
|
|
|
{
|
|
@@ -263,14 +264,14 @@ namespace FL.FGUI
|
|
|
if (_flyingList.Count == 0) OnchangBagState(false);
|
|
|
if (bScore)
|
|
|
{
|
|
|
- ShowDragonEggScoreUI(_addSocre,true);
|
|
|
+ ShowDragonEggScoreUI(_addSocre, true);
|
|
|
}
|
|
|
}
|
|
|
private void OnchangBagState(bool bOpen)
|
|
|
{
|
|
|
VM.BagBtn.GetController("State").selectedIndex = bOpen ? 1 : 0;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 开龙蛋宝箱的掉落动画
|
|
|
/// </summary>
|
|
@@ -282,12 +283,12 @@ namespace FL.FGUI
|
|
|
DragonEggService.Instance.OnchangeDragonEgg(quality, -num);
|
|
|
ShowDragonBoxNum((int)quality, DragonEggData.Instance.GetDragonEgg(quality));
|
|
|
|
|
|
- _addSocre = (VM.MenusBtnCtrl.selectedIndex + 1)* num;
|
|
|
+ _addSocre = (VM.MenusBtnCtrl.selectedIndex + 1) * num;
|
|
|
OnchangBagState(true);
|
|
|
//ShowFlyIconView(0, true);
|
|
|
for (int i = 0; i < num; i++)
|
|
|
{
|
|
|
- ShowFlyIconView(i,i == num - 1);
|
|
|
+ ShowFlyIconView(i, i == num - 1);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -349,7 +350,7 @@ namespace FL.FGUI
|
|
|
{
|
|
|
if (_attributeDescMap == null)
|
|
|
{
|
|
|
- _attributeDescMap = new Dictionary<EAttributeType, string>()
|
|
|
+ _attributeDescMap = new Dictionary<EAttributeType, string>()
|
|
|
{
|
|
|
{EAttributeType.Atk, GetAttributeDesc(EAttributeType.Atk)},
|
|
|
{EAttributeType.Hp, GetAttributeDesc(EAttributeType.Hp)},
|
|
@@ -368,8 +369,8 @@ namespace FL.FGUI
|
|
|
private void ShowAttributeUI()
|
|
|
{
|
|
|
ShowAtrributeVal(VM.AttackLabel, EAttributeType.Atk);
|
|
|
- ShowAtrributeVal(VM.HpLabel, EAttributeType.Hp);
|
|
|
- ShowAtrributeVal(VM.DefenseLabel,EAttributeType.Def);
|
|
|
+ ShowAtrributeVal(VM.HpLabel, EAttributeType.Hp);
|
|
|
+ ShowAtrributeVal(VM.DefenseLabel, EAttributeType.Def);
|
|
|
}
|
|
|
private void ShowAtrributeVal(GTextField attrLabel, EAttributeType attrType)
|
|
|
{
|
|
@@ -388,7 +389,7 @@ namespace FL.FGUI
|
|
|
{
|
|
|
ShowAtrributeVal(VM.AttackLabel, EAttributeType.Atk);
|
|
|
}
|
|
|
- else if(attrType == EAttributeType.Hp)
|
|
|
+ else if (attrType == EAttributeType.Hp)
|
|
|
{
|
|
|
ShowAtrributeVal(VM.HpLabel, EAttributeType.Hp);
|
|
|
}
|
|
@@ -412,7 +413,7 @@ namespace FL.FGUI
|
|
|
{
|
|
|
VM.DragonSpine.Play("box_idle", true);
|
|
|
});
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|