继续重构调整(UI)
- 引入 UniTask 和异步版本的 UIModule - 调整 Runtime/UIBase 和 Presentation 下的脚本命名空间到 SepCore.UI - 将原来的 5 层 UI 迁移到异步实现 - 规范各层的 UI 脚本命名
This commit is contained in:
+3
-5
@@ -1,11 +1,9 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using SepCore.Definition;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UI
|
||||
namespace SepCore.UI
|
||||
{
|
||||
public class DisplayItemInfoFormRawData
|
||||
public class DisplayItemInfoRawData
|
||||
{
|
||||
public int Index;
|
||||
public string IconAssetName;
|
||||
@@ -17,4 +15,4 @@ namespace UI
|
||||
public bool IsWeapon;
|
||||
public Vector3 TargetPos;
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-6
@@ -3,20 +3,20 @@ using Entity;
|
||||
using CustomUtility;
|
||||
using Entity.Weapon;
|
||||
|
||||
namespace UI
|
||||
namespace SepCore.UI
|
||||
{
|
||||
public class DisplayItemInfoFormUseCase : IUIUseCase
|
||||
public class DisplayItemInfoUseCase : IUIUseCase
|
||||
{
|
||||
private readonly Player _player;
|
||||
|
||||
private Player Player => _player;
|
||||
|
||||
public DisplayItemInfoFormUseCase(Player player)
|
||||
public DisplayItemInfoUseCase(Player player)
|
||||
{
|
||||
_player = player;
|
||||
}
|
||||
|
||||
public DisplayItemInfoFormRawData CreateModel(int index, bool isWeapon)
|
||||
public DisplayItemInfoRawData CreateModel(int index, bool isWeapon)
|
||||
{
|
||||
if (index < 0 || Player == null)
|
||||
{
|
||||
@@ -37,7 +37,7 @@ namespace UI
|
||||
return null;
|
||||
}
|
||||
|
||||
return new DisplayItemInfoFormRawData
|
||||
return new DisplayItemInfoRawData
|
||||
{
|
||||
IconAssetName = weapon.WeaponData.IconAssetName,
|
||||
Title = weapon.WeaponData.Title,
|
||||
@@ -60,7 +60,7 @@ namespace UI
|
||||
return null;
|
||||
}
|
||||
|
||||
return new DisplayItemInfoFormRawData
|
||||
return new DisplayItemInfoRawData
|
||||
{
|
||||
IconAssetName = prop.IconAssetName,
|
||||
Title = prop.Title,
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
using SepCore.DataTable;
|
||||
|
||||
namespace UI
|
||||
namespace SepCore.UI
|
||||
{
|
||||
public class LevelUpFormRawData
|
||||
public class LevelUpRawData
|
||||
{
|
||||
public List<DRLevelUpReward> Rewards;
|
||||
public int RefreshPrice;
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
-9
@@ -9,9 +9,9 @@ using UnityGameFramework.Runtime;
|
||||
using CustomUtility;
|
||||
using GameFramework.DataTable;
|
||||
|
||||
namespace UI
|
||||
namespace SepCore.UI
|
||||
{
|
||||
public class LevelUpFormUseCase : IUIUseCase
|
||||
public class LevelUpUseCase : IUIUseCase
|
||||
{
|
||||
private const int BaseRefreshPrice = 2;
|
||||
private readonly Action _onCompleted;
|
||||
@@ -21,11 +21,11 @@ namespace UI
|
||||
private readonly List<DRLevelUpReward> _validRewards = new();
|
||||
|
||||
private int _refreshCount;
|
||||
private LevelUpFormRawData _currentModel;
|
||||
private LevelUpRawData _currentModel;
|
||||
|
||||
private readonly Player _player;
|
||||
|
||||
public LevelUpFormUseCase(Player player, Action onCompleted)
|
||||
public LevelUpUseCase(Player player, Action onCompleted)
|
||||
{
|
||||
_player = player;
|
||||
_onCompleted = onCompleted;
|
||||
@@ -35,7 +35,7 @@ namespace UI
|
||||
BuildRewardRarityPools();
|
||||
}
|
||||
|
||||
public LevelUpFormRawData CreateInitialModel(int count = 4)
|
||||
public LevelUpRawData CreateInitialModel(int count = 4)
|
||||
{
|
||||
_refreshCount = 0;
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace UI
|
||||
return _currentModel;
|
||||
}
|
||||
|
||||
public LevelUpFormRawData TryRefresh(int refreshCost, int count = 4)
|
||||
public LevelUpRawData TryRefresh(int refreshCost, int count = 4)
|
||||
{
|
||||
if (_currentModel == null)
|
||||
{
|
||||
@@ -68,7 +68,7 @@ namespace UI
|
||||
return _currentModel;
|
||||
}
|
||||
|
||||
public LevelUpFormRawData SelectReward(int selectedIndex, int count = 4)
|
||||
public LevelUpRawData SelectReward(int selectedIndex, int count = 4)
|
||||
{
|
||||
if (_currentModel?.Rewards == null)
|
||||
{
|
||||
@@ -95,7 +95,7 @@ namespace UI
|
||||
return null;
|
||||
}
|
||||
|
||||
private LevelUpFormRawData BuildModel(int refreshPrice, int count)
|
||||
private LevelUpRawData BuildModel(int refreshPrice, int count)
|
||||
{
|
||||
if (_allRewards == null || _allRewards.Length == 0)
|
||||
{
|
||||
@@ -120,7 +120,7 @@ namespace UI
|
||||
selections.Add(reward);
|
||||
}
|
||||
|
||||
return new LevelUpFormRawData
|
||||
return new LevelUpRawData
|
||||
{
|
||||
Rewards = selections,
|
||||
RefreshPrice = refreshPrice
|
||||
@@ -1,6 +1,6 @@
|
||||
using SepCore.Definition;
|
||||
|
||||
namespace UI
|
||||
namespace SepCore.UI
|
||||
{
|
||||
public class DisplayItemRawData
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UI
|
||||
namespace SepCore.UI
|
||||
{
|
||||
public class DisplayListAreaRawData
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using SepCore.Definition;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UI
|
||||
namespace SepCore.UI
|
||||
{
|
||||
public class GoodsItemRawData
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using SepCore.Definition;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UI
|
||||
namespace SepCore.UI
|
||||
{
|
||||
public class LevelUpRewardItemRawData
|
||||
{
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@ using System.Collections.Generic;
|
||||
using SepCore.Definition;
|
||||
using Entity.Weapon;
|
||||
|
||||
namespace UI
|
||||
namespace SepCore.UI
|
||||
{
|
||||
public class ShopFormRawData
|
||||
public class ShopRawData
|
||||
{
|
||||
public int CurrentLevel;
|
||||
public int RefreshPrice;
|
||||
+5
-5
@@ -11,7 +11,7 @@ using UnityEngine;
|
||||
using UnityGameFramework.Runtime;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
namespace UI
|
||||
namespace SepCore.UI
|
||||
{
|
||||
public sealed class ShopRefreshResult
|
||||
{
|
||||
@@ -25,7 +25,7 @@ namespace UI
|
||||
public DisplayItemRawData DisplayItem;
|
||||
}
|
||||
|
||||
public class ShopFormUseCase : IUIUseCase
|
||||
public class ShopUseCase : IUIUseCase
|
||||
{
|
||||
private readonly Player _player;
|
||||
private readonly int _currentLevel;
|
||||
@@ -51,7 +51,7 @@ namespace UI
|
||||
public int Price;
|
||||
}
|
||||
|
||||
public ShopFormUseCase(Player player, int currentLevel, Action onShopFinish)
|
||||
public ShopUseCase(Player player, int currentLevel, Action onShopFinish)
|
||||
{
|
||||
_player = player;
|
||||
_currentLevel = currentLevel;
|
||||
@@ -64,7 +64,7 @@ namespace UI
|
||||
BuildGoodsRarityPools();
|
||||
}
|
||||
|
||||
public ShopFormRawData CreateInitialModel()
|
||||
public ShopRawData CreateInitialModel()
|
||||
{
|
||||
_refreshTime = 0;
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace UI
|
||||
}
|
||||
|
||||
int currentLevel = _currentLevel;
|
||||
return new ShopFormRawData
|
||||
return new ShopRawData
|
||||
{
|
||||
CurrentLevel = currentLevel,
|
||||
RefreshPrice = currentLevel,
|
||||
Reference in New Issue
Block a user