This commit is contained in:
CortexCore
2023-10-30 01:25:53 +08:00
parent add6d0cab3
commit 18f664a545
125 changed files with 3529 additions and 700 deletions

View File

@@ -73,11 +73,11 @@ namespace BITFALL
{
playerService.OnPlayerInitialized -= OnStartLocalPlayer;
}
private void OnStartLocalPlayer(IEntity entity)
private void OnStartLocalPlayer(IUnityEntity unityEntity)
{
cache.Clear();
entity.Inject(this);
unityEntity.Inject(this);
_entityEquipment.OnEquip += OnEquip;
_entityEquipment.OnUnEquip += OnUnEquip;

View File

@@ -86,9 +86,9 @@ namespace BITFALL.UX
{
seleableLabel.SetActive(false);
}
private async void OnPlayerInitializedLocalPlayer(IEntity entity)
private async void OnPlayerInitializedLocalPlayer(IUnityEntity unityEntity)
{
entity.Inject(this);
unityEntity.Inject(this);
_health.OnSetAlive += OnSetAlive;
@@ -113,7 +113,7 @@ namespace BITFALL.UX
playerAvatarImage.SetTexture(avatar);
}
_equipService = entity.Get<IEquipService>();
_equipService = unityEntity.Get<IEquipService>();
armorBar.SetActive(_armor.TryGetCurrentArmor(out _));

View File

@@ -37,7 +37,7 @@ namespace BITFALL.UX
private IEntityInventory inventory;
[Inject]
private IEntityEquipmentContainer equipContainer;
private IEntity _entity;
private IUnityEntity _unityEntity;
protected override async void Awake()
{
base.Awake();
@@ -52,7 +52,7 @@ namespace BITFALL.UX
equipContainers.Add(x.Name, uxContainer);
element.RegisterCallback<MouseDownEvent>(mouseEvent =>
{
if(_entity is null) return;
if(_unityEntity is null) return;
switch (mouseEvent.button)
{
case 0:
@@ -83,13 +83,13 @@ namespace BITFALL.UX
playerService.OnPlayerDisposed -= OnPlayerDisposed;
playerService.OnPlayerInitialized -= OnPlayerInitializedLocalPlayer;
}
private void OnPlayerInitializedLocalPlayer(IEntity entity)
private void OnPlayerInitializedLocalPlayer(IUnityEntity unityEntity)
{
entity.Inject(this);
unityEntity.Inject(this);
itemContainers.Clear();
builder.Clear();
var weighted = entity.Get<IPlayerInventoryWeightable>();
var weighted = unityEntity.Get<IPlayerInventoryWeightable>();
weighted.OnWeighted += OnWeighted;
@@ -102,7 +102,7 @@ namespace BITFALL.UX
inventory.OnUsedItem += OnRemove;
inventory.OnSet += OnSet;
_entity = entity;
_unityEntity = unityEntity;
}