1
This commit is contained in:
@@ -13,19 +13,16 @@ namespace BITKit.Scene
|
||||
[SerializeField] private IEntitiesService _entitiesService;
|
||||
[SerializeField] private CinemachineTargetGroup targetGroup;
|
||||
[SerializeField] private Optional<Entity[]> initialEntities;
|
||||
[SerializeField] private bool removeOnEliminate;
|
||||
private void Update()
|
||||
{
|
||||
// foreach (var x in initialEntities.IfNotAllow(()=>_entitiesService.Query<IHealth>().Cast<Entity>().ToArray()))
|
||||
// {
|
||||
//
|
||||
// }
|
||||
targetGroup.m_Targets =
|
||||
initialEntities.IfNotAllow(() => _entitiesService.Query<IHealth>().Cast<Entity>().ToArray())
|
||||
.Select(x => new CinemachineTargetGroup.Target()
|
||||
{
|
||||
target = x.transform,
|
||||
radius = 1,
|
||||
weight = x.TryGetComponent<IHealth>(out var heal) ? heal.IsAlive ? 1 : 0 : 0
|
||||
weight =removeOnEliminate ? x.TryGetComponent<IHealth>(out var heal) ? heal.IsAlive ? 1 : 0 : 0 : 1
|
||||
})
|
||||
.ToArray();
|
||||
if (targetGroup.m_Targets.Length is 0)
|
||||
|
Reference in New Issue
Block a user