1
This commit is contained in:
@@ -7,5 +7,6 @@ namespace BITFALL.Bullet
|
||||
int LayerMask { get; set; }
|
||||
void Spawn(BulletData bulletData);
|
||||
Func<int,int,bool> OnHit { get; set; }
|
||||
public event Action<BulletData, object> OnBulletHit;
|
||||
}
|
||||
}
|
||||
|
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;
|
||||
}
|
||||
}
|
||||
}
|
11
Src/Bullet/IProjectileService.cs.meta
Normal file
11
Src/Bullet/IProjectileService.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 57d297b340c715346bbf1a7ac9fdec21
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -4,7 +4,7 @@
|
||||
"references": [
|
||||
"GUID:14fe60d984bf9f84eac55c6ea033a8f4",
|
||||
"GUID:d8b63aba1907145bea998dd612889d6b",
|
||||
"GUID:953d83d56b66feb4fa28a9eb2c4d78cb"
|
||||
"GUID:f51ebe6a0ceec4240a699833d6309b23"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
|
Reference in New Issue
Block a user