mirror of
https://github.com/Bragin-Stepan/project-entity.git
synced 2026-04-19 21:19:41 +00:00
feat: add team touch system
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using _Project.Develop.Runtime.Logic.Gameplay.Features.Teams;
|
||||
using _Project.Develop.Runtime.Utils.ReactiveManagement;
|
||||
|
||||
namespace _Project.Develop.Runtime.Entities
|
||||
{
|
||||
public static class EntitiesHelper
|
||||
{
|
||||
public static bool AreOnSameTeam(Entity first, Entity second)
|
||||
{
|
||||
if (first.TryGetTeam(out ReactiveVariable<Teams> firstTeam) &&
|
||||
second.TryGetTeam(out ReactiveVariable<Teams> secondTeam))
|
||||
{
|
||||
return firstTeam.Value == secondTeam.Value;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user