第一批重构,主要是物理迁移脚本和部分命名空间的调整
- 结构上迁移文件,将脚本分成 Base/Runtime/Presentation/Procedure/Editor 五大文件夹 - 调整 DataTable 和 Definition 下脚本的命名空间 - 依据 UI-5层架构设计规范 拆分原先的 UI 到 Runtime 和 Presentation 下
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using SepCore.Definition;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UI
|
||||
{
|
||||
public class DisplayItemInfoFormRawData
|
||||
{
|
||||
public int Index;
|
||||
public string IconAssetName;
|
||||
public string Title;
|
||||
public string TypeText;
|
||||
public ItemRarity Rarity;
|
||||
public string Description;
|
||||
public int Price;
|
||||
public bool IsWeapon;
|
||||
public Vector3 TargetPos;
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 012ded06be40bcf48b3e79ce89df4e2b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
using SepCore.Definition;
|
||||
using Entity;
|
||||
using CustomUtility;
|
||||
using Entity.Weapon;
|
||||
using Procedure;
|
||||
|
||||
namespace UI
|
||||
{
|
||||
public class DisplayItemInfoFormUseCase : IUIUseCase
|
||||
{
|
||||
private readonly ProcedureGame _procedureGame;
|
||||
|
||||
private Player Player => _procedureGame != null ? _procedureGame.Player : null;
|
||||
|
||||
public DisplayItemInfoFormUseCase(ProcedureGame procedureGame)
|
||||
{
|
||||
_procedureGame = procedureGame;
|
||||
}
|
||||
|
||||
public DisplayItemInfoFormRawData CreateModel(int index, bool isWeapon)
|
||||
{
|
||||
if (index < 0 || Player == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (isWeapon)
|
||||
{
|
||||
var weapons = Player.Weapons;
|
||||
if (weapons == null || index >= weapons.Count)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
WeaponBase weapon = weapons[index];
|
||||
if (weapon == null || weapon.WeaponData == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new DisplayItemInfoFormRawData
|
||||
{
|
||||
IconAssetName = weapon.WeaponData.IconAssetName,
|
||||
Title = weapon.WeaponData.Title,
|
||||
TypeText = "Weapon",
|
||||
Description = ItemDescUtility.CreateWeaponDescription(weapon),
|
||||
Price = 0,
|
||||
IsWeapon = true
|
||||
};
|
||||
}
|
||||
|
||||
var props = Player.Props;
|
||||
if (props == null || index >= props.Count)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
PropItem prop = props[index];
|
||||
if (prop == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new DisplayItemInfoFormRawData
|
||||
{
|
||||
IconAssetName = prop.IconAssetName,
|
||||
Title = prop.Title,
|
||||
TypeText = "Prop",
|
||||
Description = ItemDescUtility.CreatePropDescription(prop),
|
||||
Price = 0,
|
||||
IsWeapon = false
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 48c1f32fe95e20c43b8015ac1438d54e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user