mirror of
https://github.com/Bragin-Stepan/project-entity.git
synced 2026-03-05 15:51:10 +00:00
feat: add auto attack state
This commit is contained in:
@@ -52,13 +52,13 @@ namespace _Project.Develop.Runtime.Entities
|
||||
.AddInDeathProcess()
|
||||
.AddDeathProcessInitialTime(new ReactiveVariable<float>(2))
|
||||
.AddDeathProcessCurrentTime()
|
||||
.AddAttackProcessInitialTime(new ReactiveVariable<float>(3))
|
||||
.AddAttackProcessInitialTime(new ReactiveVariable<float>(1))
|
||||
.AddAttackProcessCurrentTime()
|
||||
.AddInAttackProcess()
|
||||
.AddStartAttackRequest()
|
||||
.AddStartAttackEvent()
|
||||
.AddEndAttackEvent()
|
||||
.AddAttackDelayTime(new ReactiveVariable<float>(2))
|
||||
.AddAttackDelayTime(new ReactiveVariable<float>(1))
|
||||
.AddAttackDelayEndEvent()
|
||||
.AddInstantAttackDamage(new ReactiveVariable<float>(50))
|
||||
.AddAttackCanceledEvent()
|
||||
@@ -102,9 +102,6 @@ namespace _Project.Develop.Runtime.Entities
|
||||
.AddMustCancelAttack(mustCancelAttack);
|
||||
|
||||
entity
|
||||
.AddSystem(new AttackByInputSystem(_playerInput))
|
||||
.AddSystem(new MoveDirectionByInputSystem(_playerInput))
|
||||
.AddSystem(new RotateDirectionByMoveInputSystem(_playerInput))
|
||||
.AddSystem(new RigidbodyMovementSystem())
|
||||
.AddSystem(new RigidbodyRotationSystem())
|
||||
|
||||
|
||||
@@ -1682,5 +1682,29 @@ namespace _Project.Develop.Runtime.Entities
|
||||
return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.Attack.InAttackCooldown() {Value = value});
|
||||
}
|
||||
|
||||
public _Project.Develop.Runtime.Logic.Gameplay.Features.AI.CurrentTarget CurrentTargetC => GetComponent<_Project.Develop.Runtime.Logic.Gameplay.Features.AI.CurrentTarget>();
|
||||
|
||||
public _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable<_Project.Develop.Runtime.Entities.Entity> CurrentTarget => CurrentTargetC.Value;
|
||||
|
||||
public bool TryGetCurrentTarget(out _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable<_Project.Develop.Runtime.Entities.Entity> value)
|
||||
{
|
||||
bool result = TryGetComponent(out _Project.Develop.Runtime.Logic.Gameplay.Features.AI.CurrentTarget component);
|
||||
if(result)
|
||||
value = component.Value;
|
||||
else
|
||||
value = default(_Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable<_Project.Develop.Runtime.Entities.Entity>);
|
||||
return result;
|
||||
}
|
||||
|
||||
public _Project.Develop.Runtime.Entities.Entity AddCurrentTarget()
|
||||
{
|
||||
return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.AI.CurrentTarget() { Value = new _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable<_Project.Develop.Runtime.Entities.Entity>() });
|
||||
}
|
||||
|
||||
public _Project.Develop.Runtime.Entities.Entity AddCurrentTarget(_Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable<_Project.Develop.Runtime.Entities.Entity> value)
|
||||
{
|
||||
return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.AI.CurrentTarget() {Value = value});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user