22 lines
594 B
C#
22 lines
594 B
C#
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
namespace BITKit.Entities
|
||
|
{
|
||
|
public class EntityOverride : EntityComponent
|
||
|
{
|
||
|
ValidHandle isOverriding = new();
|
||
|
IEntityComponent[] components;
|
||
|
public override void OnAwake()
|
||
|
{
|
||
|
components = GetComponentsInChildren<IEntityComponent>();
|
||
|
isOverriding.AddListener(_isOverriding =>
|
||
|
{
|
||
|
components.ForEach(x =>
|
||
|
{
|
||
|
x.OnSetOverride(_isOverriding);
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
}
|