INeighborBaseBehavior
Components to be used with neighbor behaviors must implement INeighborBaseBehavior. It requires the component to have NeighborBehaviorData member with fields which are internally used by the framework. The fields are the same with ISimpleBaseBehavior, with the addition of:
- MaxDistance - Maximum radius where neighbors can be detected.
- MaxAngle - Field of view where neighbors can be detected.
INeighborBaseBehavior.cs
public interface INeighborBaseBehavior
{
public NeighborBehaviorData BaseData { get; set; }
}
[Serializable]
public struct NeighborBaseBehavior : IActivable
{
public byte Priority;
public float DirectionStrength;
public float SpeedStrength;
public float MaxDistance;
public float MaxAngle;
public bool Debug;
public Color Color;
public float DebugScale;
public bool IsActive { get; set; }
}