1
This commit is contained in:
126
Src/Bullet/IProjectileService.cs
Normal file
126
Src/Bullet/IProjectileService.cs
Normal file
@@ -0,0 +1,126 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user