This commit is contained in:
CortexCore
2025-08-03 02:28:22 +08:00
parent 87007c9c24
commit 519c93d651
26 changed files with 427 additions and 5 deletions

View File

@@ -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;
}
}

View 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;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 57d297b340c715346bbf1a7ac9fdec21
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -4,7 +4,7 @@
"references": [
"GUID:14fe60d984bf9f84eac55c6ea033a8f4",
"GUID:d8b63aba1907145bea998dd612889d6b",
"GUID:953d83d56b66feb4fa28a9eb2c4d78cb"
"GUID:f51ebe6a0ceec4240a699833d6309b23"
],
"includePlatforms": [],
"excludePlatforms": [],