This commit is contained in:
CortexCore
2023-10-20 22:46:14 +08:00
parent a160813262
commit 325f63d6bc
42 changed files with 1602 additions and 79 deletions

View File

@@ -36,14 +36,15 @@ namespace BITKit.Entities
allowGlobalActivation = true
};
protected readonly ValidHandle AllowRendering = new();
public virtual string AddressablePath => throw new System.NotImplementedException();
public virtual string AddressablePath => item.AddressablePath;
protected virtual Vector3 meleeForce => Transform.forward;
public bool IsEntered { get; set; }
public virtual void Entry()
{
AllowRendering.AddElement(this);
inputActionGroup.allowInput.AddElement(this);
animator.animator.enabled = true;
animator.animator.Update(0);
}
public virtual UniTask EntryAsync()
{
@@ -52,7 +53,7 @@ namespace BITKit.Entities
public virtual void Exit()
{
inputActionGroup.allowInput.AddElement(this);
inputActionGroup.allowInput.RemoveElement(this);
}
public virtual UniTask ExitAsync()
{
@@ -61,8 +62,13 @@ namespace BITKit.Entities
}
public virtual void OnAwake()
{
AllowRendering.AddListener(x=>renderers.ForEach(y=>y.enabled = x));
AllowRendering.AddListener(x=>renderers.ForEach(y=>
{
y.enabled = x;
animator.animator.enabled = x;
}));
AllowRendering.Invoke();
Initialize();
}