Files
Net.Project.B/Src/Bullet/IProjectileService.cs
CortexCore 519c93d651 1
2025-08-03 02:28:22 +08:00

127 lines
3.8 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using Cysharp.Threading.Tasks;
using Unity.Mathematics;
namespace Net.Project.B.Projectile
{
public interface IProjectileItem
{
public int Initiator { get; set; }
public float3 StartPosition { get; set; }
public quaternion StartRotation { get; set; }
public float3 EndPosition { get; set; }
public float3 StartVelocity { get; set; }
public float FuseTime { get; set; }
public float MaxLifetime { get; set; }
public object Model { get; set; }
}
public interface IProjectileService
{
UniTask Project(IProjectileItem item);
public event Action<IProjectileItem> OnProjected;
}
public interface IProjectileService<out T>:IProjectileService where T : IProjectileItem
{
public new event Action<T> OnProjected;
}
[Serializable]
public struct FlashbangProjectileItem:IProjectileItem
{
public float maxLifeTime;
public int Initiator { get; set; }
public float3 StartPosition { get; set; }
public quaternion StartRotation { get; set; }
public float3 EndPosition { get; set; }
public float3 StartVelocity { get; set; }
public float FuseTime { get; set; }
public float MaxLifetime
{
get => maxLifeTime;
set => maxLifeTime = value;
}
public object Model { get; set; }
}
[Serializable]
public struct GrenadeProjectileItem:IProjectileItem
{
public float maxLifeTime;
public float fuseTime;
public int Initiator { get; set; }
public float3 StartPosition { get; set; }
public quaternion StartRotation { get; set; }
public float3 EndPosition { get; set; }
public float3 StartVelocity { get; set; }
public float FuseTime
{
get => fuseTime;
set => fuseTime = value;
}
public float MaxLifetime
{
get => maxLifeTime;
set => maxLifeTime = value;
}
public object Model { get; set; }
}
[Serializable]
public struct IncendiaryGrenadeProjectileItem:IProjectileItem
{
public float fuseTime;
public int Initiator { get; set; }
public float3 StartPosition { get; set; }
public quaternion StartRotation { get; set; }
public float3 EndPosition { get; set; }
public float3 StartVelocity { get; set; }
public float FuseTime
{
get => fuseTime;
set => fuseTime = value;
}
public float MaxLifetime { get; set; }
public object Model { get; set; }
}
[Serializable]
public struct SmokeProjectileItem : IProjectileItem
{
public int Initiator { get; set; }
public float3 StartPosition { get; set; }
public quaternion StartRotation { get; set; }
public float3 EndPosition { get; set; }
public float3 StartVelocity { get; set; }
public float FuseTime { get; set; }
public float MaxLifetime { get; set; }
public object Model { get; set; }
}
[Serializable]
public struct WeaponProjectileItem : IProjectileItem
{
public int scriptableItemId;
public int Initiator { get; set; }
public float3 StartPosition { get; set; }
public quaternion StartRotation { get; set; }
public float3 EndPosition { get; set; }
public float3 StartVelocity { get; set; }
public float FuseTime { get; set; }
public float MaxLifetime { get; set; }
public object Model { get; set; }
public int ScriptableItemId
{
get => scriptableItemId;
set => scriptableItemId = value;
}
}
}