28 lines
1.2 KiB
C#
28 lines
1.2 KiB
C#
using ProjectM.Simulation;
|
|
using Unity.Entities;
|
|
using UnityEngine;
|
|
|
|
namespace ProjectM.Authoring
|
|
{
|
|
/// <summary>
|
|
/// MC-1 — marks a Husk prefab as a CHARGER variant. Compose this WITH <see cref="EnemyAuthoring"/> on the
|
|
/// prefab root (both bakers share the primary entity): EnemyAuthoring bakes the common Husk components and
|
|
/// Charger-tuned stats; this bakes the server-only <see cref="LungeState"/> (zeroed = not lunging).
|
|
/// Component-PRESENCE is the discriminator <c>EnemyAISystem</c> branches on — no enum/brain byte (the Burst
|
|
/// cross-assembly-enum hazard) — routing the Charger to the commit→lunge→whiff-stagger pass while the Grunt
|
|
/// pass excludes it via <c>.WithNone<LungeState>()</c>. NOT a <c>[GhostField]</c>: the lunged position
|
|
/// replicates via stock LocalTransform like every Husk.
|
|
/// </summary>
|
|
public class ChargerAuthoring : MonoBehaviour
|
|
{
|
|
private class ChargerBaker : Baker<ChargerAuthoring>
|
|
{
|
|
public override void Bake(ChargerAuthoring authoring)
|
|
{
|
|
var entity = GetEntity(authoring, TransformUsageFlags.Dynamic);
|
|
AddComponent<LungeState>(entity);
|
|
}
|
|
}
|
|
}
|
|
}
|