Initial Combat Implementation

This commit is contained in:
Luis Gonzalez
2026-05-31 21:35:12 -07:00
parent 7fa77ce821
commit 1f647dd5e1
166 changed files with 93337 additions and 91 deletions
@@ -0,0 +1,34 @@
using ProjectM.Simulation;
using Unity.Entities;
using UnityEngine;
namespace ProjectM.Authoring
{
/// <summary>
/// Authoring placed once in the gameplay subscene. Bakes a <see cref="ProjectileSpawner"/>
/// singleton holding the projectile ghost prefab entity, which the predicted AbilityFireSystem
/// instantiates whenever a player fires. The spawner itself carries no transform (it is a pure
/// data singleton) so it is baked with <c>TransformUsageFlags.None</c>, while the referenced
/// prefab is baked with <c>TransformUsageFlags.Dynamic</c> so the spawned projectile has a
/// runtime-mutable LocalTransform.
/// </summary>
public class ProjectileSpawnerAuthoring : MonoBehaviour
{
[Tooltip("The projectile ghost prefab spawned when a player fires.")]
public GameObject ProjectilePrefab;
private class ProjectileSpawnerBaker : Baker<ProjectileSpawnerAuthoring>
{
public override void Bake(ProjectileSpawnerAuthoring authoring)
{
// The spawner itself needs no transform; it is a data singleton.
var entity = GetEntity(authoring, TransformUsageFlags.None);
AddComponent(entity, new ProjectileSpawner
{
Prefab = GetEntity(authoring.ProjectilePrefab, TransformUsageFlags.Dynamic)
});
}
}
}
}