添加光学无人机发射激光逻辑

This commit is contained in:
YangHua 2024-01-20 18:04:29 +08:00
parent 3f091f7590
commit 50da5df718
4 changed files with 266 additions and 91 deletions

View File

@ -143,6 +143,99 @@ MonoBehaviour:
isEnableLerp: 0
lerpTime: 1
_distance: 10
--- !u!1 &1868832759
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1868832760}
- component: {fileID: 1868832763}
- component: {fileID: 1868832762}
- component: {fileID: 1868832761}
m_Layer: 11
m_Name: Sphere
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &1868832760
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1868832759}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0.0039, z: 0.227}
m_LocalScale: {x: 0.09868923, y: 0.09868923, z: 0.09868923}
m_Children: []
m_Father: {fileID: 5512074156260461627}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &1868832763
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1868832759}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &1868832762
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1868832759}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!135 &1868832761
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1868832759}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &34767209977200763
GameObject:
m_ObjectHideFlags: 0
@ -350,6 +443,7 @@ MonoBehaviour:
selectedSide: 0
equipmentType: "\u8702\u7FA4\u65E0\u4EBA\u673A"
deviceID:
ISPlayer: 0
explodePrefab: {fileID: 1000013462590818, guid: ecdd96beb7f93494880c052dfccf9dc1,
type: 3}
isMove: 1
@ -1442,6 +1536,12 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 088baeb890d17754287a1161c0b1dceb, type: 3}
--- !u!4 &8062921474742261735 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 87581316664468991}
m_PrefabAsset: {fileID: 0}
--- !u!114 &2044690712093867138 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 2114182605201611133, guid: 088baeb890d17754287a1161c0b1dceb,
@ -1454,12 +1554,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8d11073938bcdd54589608b4b411b889, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &8062921474742261735 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 87581316664468991}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &715777664892440568
PrefabInstance:
m_ObjectHideFlags: 0
@ -2319,6 +2413,12 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 088baeb890d17754287a1161c0b1dceb, type: 3}
--- !u!4 &7438984634337869280 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 715777664892440568}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1493477770847098501 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 2114182605201611133, guid: 088baeb890d17754287a1161c0b1dceb,
@ -2331,12 +2431,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8d11073938bcdd54589608b4b411b889, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &7438984634337869280 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 715777664892440568}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &749958366770983279
PrefabInstance:
m_ObjectHideFlags: 0
@ -3196,12 +3290,6 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 088baeb890d17754287a1161c0b1dceb, type: 3}
--- !u!4 &7258120122570228599 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 749958366770983279}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1675188196275480594 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 2114182605201611133, guid: 088baeb890d17754287a1161c0b1dceb,
@ -3214,6 +3302,12 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8d11073938bcdd54589608b4b411b889, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &7258120122570228599 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 749958366770983279}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1268904682848828821
PrefabInstance:
m_ObjectHideFlags: 0
@ -5827,12 +5921,6 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 088baeb890d17754287a1161c0b1dceb, type: 3}
--- !u!4 &8798000438643106319 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 1498185928744833047}
m_PrefabAsset: {fileID: 0}
--- !u!114 &692909800614857066 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 2114182605201611133, guid: 088baeb890d17754287a1161c0b1dceb,
@ -5845,6 +5933,12 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8d11073938bcdd54589608b4b411b889, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &8798000438643106319 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 1498185928744833047}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1752211167157593052
PrefabInstance:
m_ObjectHideFlags: 0
@ -7581,12 +7675,6 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 088baeb890d17754287a1161c0b1dceb, type: 3}
--- !u!4 &8520896806561604225 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 1770522258813735065}
m_PrefabAsset: {fileID: 0}
--- !u!114 &415806151353551332 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 2114182605201611133, guid: 088baeb890d17754287a1161c0b1dceb,
@ -7599,6 +7687,12 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8d11073938bcdd54589608b4b411b889, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &8520896806561604225 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 1770522258813735065}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1952625762317888975
PrefabInstance:
m_ObjectHideFlags: 0
@ -8458,6 +8552,12 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 088baeb890d17754287a1161c0b1dceb, type: 3}
--- !u!4 &8488010052738047959 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 1952625762317888975}
m_PrefabAsset: {fileID: 0}
--- !u!114 &454312886544757938 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 2114182605201611133, guid: 088baeb890d17754287a1161c0b1dceb,
@ -8470,12 +8570,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8d11073938bcdd54589608b4b411b889, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &8488010052738047959 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 1952625762317888975}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &2092430464794464480
PrefabInstance:
m_ObjectHideFlags: 0
@ -9335,6 +9429,12 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 088baeb890d17754287a1161c0b1dceb, type: 3}
--- !u!4 &8348451640861860600 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 2092430464794464480}
m_PrefabAsset: {fileID: 0}
--- !u!114 &26700038631426461 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 2114182605201611133, guid: 088baeb890d17754287a1161c0b1dceb,
@ -9347,12 +9447,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8d11073938bcdd54589608b4b411b889, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &8348451640861860600 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 2092430464794464480}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &2303540555920778128
PrefabInstance:
m_ObjectHideFlags: 0
@ -10447,6 +10541,11 @@ PrefabInstance:
propertyPath: tips
value:
objectReference: {fileID: 114525539}
- target: {fileID: 2114182605201611133, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
propertyPath: shell
value:
objectReference: {fileID: 1868832759}
- target: {fileID: 2254950790765467284, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
propertyPath: m_Layer
@ -10992,6 +11091,11 @@ PrefabInstance:
propertyPath: m_Layer
value: 11
objectReference: {fileID: 0}
- target: {fileID: 7985558213978141209, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
propertyPath: m_Icon
value:
objectReference: {fileID: 0}
- target: {fileID: 8061222380075069409, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
propertyPath: m_Layer
@ -11089,6 +11193,12 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 088baeb890d17754287a1161c0b1dceb, type: 3}
--- !u!4 &5512074156260461627 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 2498570764477447715}
m_PrefabAsset: {fileID: 0}
--- !u!114 &4610455937839310686 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 2114182605201611133, guid: 088baeb890d17754287a1161c0b1dceb,
@ -11101,12 +11211,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8d11073938bcdd54589608b4b411b889, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &5512074156260461627 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 2498570764477447715}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &2809197756700194186
PrefabInstance:
m_ObjectHideFlags: 0
@ -11966,12 +12070,6 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 088baeb890d17754287a1161c0b1dceb, type: 3}
--- !u!4 &5201130470601836434 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 2809197756700194186}
m_PrefabAsset: {fileID: 0}
--- !u!114 &4299622186163530999 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 2114182605201611133, guid: 088baeb890d17754287a1161c0b1dceb,
@ -11984,6 +12082,12 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8d11073938bcdd54589608b4b411b889, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &5201130470601836434 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 2809197756700194186}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &2982643334479475112
PrefabInstance:
m_ObjectHideFlags: 0
@ -16351,6 +16455,12 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 088baeb890d17754287a1161c0b1dceb, type: 3}
--- !u!4 &3273620095990738524 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 4880875880639175748}
m_PrefabAsset: {fileID: 0}
--- !u!114 &6839647458606122297 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 2114182605201611133, guid: 088baeb890d17754287a1161c0b1dceb,
@ -16363,12 +16473,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8d11073938bcdd54589608b4b411b889, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &3273620095990738524 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 4880875880639175748}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &5511666963674910243
PrefabInstance:
m_ObjectHideFlags: 0
@ -17228,12 +17332,6 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 088baeb890d17754287a1161c0b1dceb, type: 3}
--- !u!4 &2499279008215596091 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 5511666963674910243}
m_PrefabAsset: {fileID: 0}
--- !u!114 &5848568455846123358 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 2114182605201611133, guid: 088baeb890d17754287a1161c0b1dceb,
@ -17246,6 +17344,12 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8d11073938bcdd54589608b4b411b889, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &2499279008215596091 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 5511666963674910243}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &5521732607769453082
PrefabInstance:
m_ObjectHideFlags: 0
@ -23367,6 +23471,12 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 088baeb890d17754287a1161c0b1dceb, type: 3}
--- !u!4 &713047693628054390 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 7437457271094913390}
m_PrefabAsset: {fileID: 0}
--- !u!114 &8818103163389751315 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 2114182605201611133, guid: 088baeb890d17754287a1161c0b1dceb,
@ -23379,12 +23489,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8d11073938bcdd54589608b4b411b889, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &713047693628054390 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 7437457271094913390}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &8108767849280698377
PrefabInstance:
m_ObjectHideFlags: 0
@ -25216,6 +25320,12 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 088baeb890d17754287a1161c0b1dceb, type: 3}
--- !u!4 &1611324478266105742 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 8687151149057306006}
m_PrefabAsset: {fileID: 0}
--- !u!114 &7339143432620078315 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 2114182605201611133, guid: 088baeb890d17754287a1161c0b1dceb,
@ -25228,12 +25338,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8d11073938bcdd54589608b4b411b889, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &1611324478266105742 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 8687151149057306006}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &8867769748213934429
PrefabInstance:
m_ObjectHideFlags: 0
@ -26093,6 +26197,12 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 088baeb890d17754287a1161c0b1dceb, type: 3}
--- !u!4 &1568030543216483141 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 8867769748213934429}
m_PrefabAsset: {fileID: 0}
--- !u!114 &7370053355485605920 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 2114182605201611133, guid: 088baeb890d17754287a1161c0b1dceb,
@ -26105,12 +26215,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8d11073938bcdd54589608b4b411b889, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &1568030543216483141 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7985558213978141208, guid: 088baeb890d17754287a1161c0b1dceb,
type: 3}
m_PrefabInstance: {fileID: 8867769748213934429}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &8887797578038627791
PrefabInstance:
m_ObjectHideFlags: 0

View File

@ -0,0 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
public class ShellBoom : MonoBehaviour
{
public UnityEvent onShellAttack;
public bool isPlayer = false;
private void OnTriggerEnter(Collider other)
{
if (isPlayer && other.tag == "AttackTarget")
{
onShellAttack?.Invoke();
}
}
}

View File

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

View File

@ -74,6 +74,12 @@ public class UnmannedAerialVehicle : MonoBehaviour
public TextMesh tips;
public Transform attackTarget;
/// <summary>
/// 炮弹
/// </summary>
public GameObject shell;
private void OnTriggerEnter(Collider other)
{
if (unmannedAerialVehicleManage.equipmentCommon.isPlayer && other.tag == "AttackTarget")
@ -181,6 +187,8 @@ public class UnmannedAerialVehicle : MonoBehaviour
void OnDestroy()
{
attackTarget = null;
StopCoroutine(RangedAttack());
transform.DOKill();
}
@ -197,18 +205,52 @@ public class UnmannedAerialVehicle : MonoBehaviour
Vector3 _v3 = attackTarget.position;
transform.DOLookAt(_v3, 0.1f).OnComplete(() =>
{
float distance = Vector3.Distance(transform.position, attackTarget.position);
transform.DOMove(attackTarget.position, distance / FireSpeed).SetEase(Ease.Linear).OnComplete(() =>
if (wrjModel == WRJModel.)
{
//if (!attackTarget)
//{
// //BeAssaulted("没有攻击到目标");
//}
});
StopCoroutine(RangedAttack());
StartCoroutine(RangedAttack());
}
else
{
float distance = Vector3.Distance(transform.position, attackTarget.position);
transform.DOMove(attackTarget.position, distance / FireSpeed).SetEase(Ease.Linear).OnComplete(() =>
{
//if (!attackTarget)
//{
// //BeAssaulted("没有攻击到目标");
//}
});
}
});
}
}
/// <summary>
/// 远程攻击
/// </summary>
public IEnumerator RangedAttack()
{
while (attackTarget)
{
yield return new WaitForSeconds(1f);
GameObject obj = Instantiate(shell);
obj.SetActive(true);
ShellBoom sb = obj.AddComponent<ShellBoom>();
sb.isPlayer = unmannedAerialVehicleManage.equipmentCommon.isPlayer;
sb.onShellAttack.AddListener(() =>
{
AddBao(attackTarget.transform);
// 销毁objectToDestroy对象
BeAssaulted("攻击到目标");
});
Vector3 direction = obj.transform.position - attackTarget.position;
float step = 1 * Time.deltaTime;
obj.transform.rotation = Quaternion.LookRotation(direction);
obj.transform.position = Vector3.MoveTowards(obj.transform.position, attackTarget.position, step);
}
}
/// <summary>
/// 发起攻击
/// </summary>