- 规范 UI 设计成为:
- UIForm 负责展示
- Controller 负责控制
- UseCase 负责业务逻辑
- RawData 负责提供原始数据
- Context 负责为 UIForm 提供数据
- 添加和补充一系列 UI 功能
This commit is contained in:
@@ -21,6 +21,20 @@ namespace Entity.EntityData
|
||||
/// </summary>
|
||||
public int Attack => _drWeapon.Attack;
|
||||
|
||||
/// <summary>
|
||||
/// 武器名称。
|
||||
/// </summary>
|
||||
public string Title => _drWeapon.Title;
|
||||
|
||||
/// <summary>
|
||||
/// 图标资源名称。
|
||||
/// </summary>
|
||||
public string IconAssetName => _drWeapon.IconAssetName;
|
||||
|
||||
public ItemRarity Rarity => _drWeapon.Rarity;
|
||||
|
||||
public int Price => _drWeapon.Price;
|
||||
|
||||
/// <summary>
|
||||
/// 攻击间隔。
|
||||
/// </summary>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using Components;
|
||||
using CustomEvent;
|
||||
using DataTable;
|
||||
@@ -63,6 +64,8 @@ namespace Entity
|
||||
{
|
||||
value -= _expRequires[_currentLevel + 1];
|
||||
_currentLevel++;
|
||||
PendingLevelPoints++;
|
||||
GameEntry.Event.Fire(this, PlayerLevelUpEventArgs.Create());
|
||||
}
|
||||
|
||||
GameEntry.Event.Fire(this, PlayerExpChangeEventArgs.Create(value, _expRequires[_currentLevel + 1]));
|
||||
@@ -71,7 +74,19 @@ namespace Entity
|
||||
}
|
||||
|
||||
public int CurrentLevel => _currentLevel;
|
||||
|
||||
|
||||
public int PendingLevelPoints { get; set; }
|
||||
|
||||
public IReadOnlyList<WeaponBase> Weapons => _backpackComponent != null ? _backpackComponent.Weapons : null;
|
||||
public IReadOnlyList<PropItem> Props => _backpackComponent != null ? _backpackComponent.Props : null;
|
||||
public int WeaponCapacity => _backpackComponent != null ? _backpackComponent.WeaponCapacity : 0;
|
||||
|
||||
public bool AddProp(PropItem prop)
|
||||
{
|
||||
if (prop == null || _backpackComponent == null) return false;
|
||||
return _backpackComponent.AttachProp(prop);
|
||||
}
|
||||
|
||||
public bool Enable
|
||||
{
|
||||
get => _enable;
|
||||
|
||||
@@ -24,10 +24,15 @@ namespace Entity
|
||||
public abstract class WeaponBase : EntityBase
|
||||
{
|
||||
protected const string AttachPoint = "Weapon Point";
|
||||
|
||||
protected bool _isAttacking = false;
|
||||
|
||||
protected bool _isEnabled = false;
|
||||
|
||||
public WeaponData WeaponData;
|
||||
|
||||
public bool IsAttacking => _isAttacking;
|
||||
|
||||
protected WeaponStateBase _currentState;
|
||||
|
||||
#region FSM
|
||||
|
||||
@@ -134,6 +134,7 @@ namespace Entity
|
||||
Log.Error("WeaponKnife data is invalid.");
|
||||
return;
|
||||
}
|
||||
WeaponData = _weaponData;
|
||||
|
||||
_collider = GetComponent<Collider>();
|
||||
_rigidbody = GetComponent<Rigidbody>();
|
||||
@@ -329,4 +330,4 @@ namespace Entity
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user