This commit is contained in:
CortexCore
2024-03-29 00:58:24 +08:00
parent 967ad8eacf
commit 05315ef4a8
232 changed files with 53368 additions and 8539 deletions

View File

@@ -65,6 +65,7 @@ namespace BITKit.Entities
OnItemApplied(value);
}
}
public AssetableItem ScriptableItem => item;
private IBasicItem _item;
//public IDictionary<string, float> AnimationProperties = null;
@@ -82,6 +83,8 @@ namespace BITKit.Entities
[Inject(true)] protected IEntityInventory _inventory;
[Inject(true)] protected IUXPopup _uxPopup;
public IEntityInventory Inventory=>_inventory;
public IUXPopup UXPopup=>_uxPopup;
public override void Initialize()
{
SearchKey = new []{C_Weapon,item.Name};
@@ -123,19 +126,25 @@ namespace BITKit.Entities
vfxPlayer.enabled = false;
}
public virtual UniTask ExitAsync()
public virtual async UniTask ExitAsync()
{
AllowRendering.RemoveElement(this);
return UniTask.CompletedTask;
while (AnimancerComponent.IsPlaying())
{
await UniTask.NextFrame();
if (destroyCancellationToken.IsCancellationRequested) return;
}
}
public virtual async void Exited()
{
if (!cameraTransform) return;
AllowRendering.RemoveElement(this);
if (cameraTransform)
{
cameraTransform.localPosition = default;
cameraTransform.localRotation = _initialCameraRotation;
}
await UniTask.NextFrame(destroyCancellationToken);
cameraTransform.localPosition = default;
cameraTransform.localRotation = _initialCameraRotation;
if (animancerComponent)
{
@@ -171,7 +180,11 @@ namespace BITKit.Entities
_modify.AllowModify.SetDisableElements(this, !x);
});
if (animancerComponent)
{
animancerComponent.Animator.enabled = false;
animancerComponent.enabled = false;
}
AllowRendering.Invoke();
if (cameraTransform)
_initialCameraRotation = cameraTransform.localRotation;
@@ -229,6 +242,7 @@ namespace BITKit.Entities
{
if (IsEntered is false) return;
if (item is not AssetableEquip equip) return;
UnityEntity.Invoke(Constant.Animation.OnEvent, eventName);
switch (eventName)
{
case "Melee":
@@ -368,7 +382,7 @@ namespace BITKit.Entities
equips.Entry(_prioritySelector.Current);
if (equips.index is not -1)
{
equips.list[equips.index].Item = CurrentItem;
//equips.list[equips.index].Item = CurrentItem;
}
if (equips.TryGetEntried(out entryComplete))
{