继续调整,创建 Procedure 与 Presentation 程序集
- 创建 Procedure 与 Presentation 两个程序集 - 初步解决这两个程序集与原程序集的引用关系
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
|
||||
using StarForce;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
using UnityEngine.UI;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
@@ -79,4 +78,4 @@ namespace UI
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,5 +7,19 @@ namespace UI
|
||||
public string IconAssetName;
|
||||
public ItemRarity Rarity;
|
||||
public bool IsWeapon;
|
||||
|
||||
public DisplayItemContext()
|
||||
{
|
||||
IconAssetName = string.Empty;
|
||||
Rarity = ItemRarity.None;
|
||||
IsWeapon = false;
|
||||
}
|
||||
|
||||
public DisplayItemContext(DisplayItemRawData rawData)
|
||||
{
|
||||
this.IconAssetName = rawData.IconAssetName;
|
||||
this.Rarity = rawData.Rarity;
|
||||
this.IsWeapon = rawData.IsWeapon;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,5 +11,15 @@ namespace UI
|
||||
public Sprite Icon;
|
||||
public string Description;
|
||||
public int Price;
|
||||
|
||||
public GoodsItemContext(GoodsItemRawData rawData)
|
||||
{
|
||||
Title = rawData.Title;
|
||||
Description = rawData.Description;
|
||||
Price = rawData.Price;
|
||||
Rarity = rawData.Rarity;
|
||||
Type = rawData.Type;
|
||||
Icon = rawData.Icon;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,12 +51,18 @@ namespace UI
|
||||
|
||||
_rawData = rawData;
|
||||
|
||||
List<GoodsItemContext> goodsItems = new List<GoodsItemContext>();
|
||||
foreach (var item in rawData.GoodsItems)
|
||||
{
|
||||
goodsItems.Add(new GoodsItemContext(item));
|
||||
}
|
||||
|
||||
return new ShopFormContext
|
||||
{
|
||||
CurrentLevel = rawData.CurrentLevel,
|
||||
RefreshPrice = rawData.RefreshPrice,
|
||||
PlayerCoin = rawData.PlayerCoin,
|
||||
GoodsItems = rawData.GoodsItems,
|
||||
GoodsItems = goodsItems,
|
||||
PropListContext =
|
||||
BuildDisplayListAreaContext(DisplayListAreaType.Prop, rawData.PropItems, rawData.PropMaxCount),
|
||||
WeaponListContext = BuildDisplayListAreaContext(DisplayListAreaType.Weapon, rawData.WeaponItems,
|
||||
@@ -267,7 +273,18 @@ namespace UI
|
||||
return;
|
||||
}
|
||||
|
||||
Context.GoodsItems = result.GoodsItems;
|
||||
for (int i = 0; i < result.GoodsItems.Count; i++)
|
||||
{
|
||||
if (i < Context.GoodsItems.Count) Context.GoodsItems[i] = new GoodsItemContext(result.GoodsItems[i]);
|
||||
else Context.GoodsItems.Add(new GoodsItemContext(result.GoodsItems[i]));
|
||||
}
|
||||
|
||||
if (Context.GoodsItems.Count != result.GoodsItems.Count)
|
||||
{
|
||||
Context.GoodsItems.RemoveRange(Context.GoodsItems.Count,
|
||||
Context.GoodsItems.Count - Context.GoodsItems.Count);
|
||||
}
|
||||
|
||||
Context.RefreshPrice = result.RefreshPrice;
|
||||
|
||||
if (Form == null)
|
||||
@@ -276,8 +293,8 @@ namespace UI
|
||||
return;
|
||||
}
|
||||
|
||||
Form.RefreshGoodsItems(result.GoodsItems);
|
||||
Form.RefreshRefreshPrice(result.RefreshPrice);
|
||||
Form.RefreshGoodsItems(Context.GoodsItems);
|
||||
Form.RefreshRefreshPrice(Context.RefreshPrice);
|
||||
}
|
||||
|
||||
private void ApplyGoodsPurchased(ShopPurchaseResult result)
|
||||
@@ -299,19 +316,21 @@ namespace UI
|
||||
Context.GoodsItems[result.GoodsIndex] = null;
|
||||
}
|
||||
|
||||
DisplayItemContext context = new DisplayItemContext(result.DisplayItem);
|
||||
|
||||
if (result.DisplayItem != null)
|
||||
{
|
||||
if (result.DisplayItem.IsWeapon)
|
||||
{
|
||||
AppendDisplayItemContext(Context.WeaponListContext, result.DisplayItem);
|
||||
AppendDisplayItemContext(Context.WeaponListContext, context);
|
||||
}
|
||||
else
|
||||
{
|
||||
AppendDisplayItemContext(Context.PropListContext, result.DisplayItem);
|
||||
AppendDisplayItemContext(Context.PropListContext, context);
|
||||
}
|
||||
}
|
||||
|
||||
Form?.ApplyGoodsPurchased(result.GoodsIndex, result.DisplayItem);
|
||||
Form?.ApplyGoodsPurchased(result.GoodsIndex, context);
|
||||
}
|
||||
|
||||
private bool IsCurrentFormEventSender(object sender)
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "SepCore.Presentation",
|
||||
"rootNamespace": "SepCore.UI",
|
||||
"references": [
|
||||
"GUID:6055be8ebefd69e48b49212b09b47b2f",
|
||||
"GUID:47a82ffa13c291447ab895cd0bc251cd",
|
||||
"GUID:363c5eb08ff8e6a439b85e37b8c20d96"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0e1d182005e0ae647ab3fa40f5492dbb
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user