feat: changed FORGE3D Sci-Fi Effects to fit my needs better

This commit is contained in:
Jakob Feldmann 2024-06-12 13:31:29 +02:00
parent 7a3e0e0a69
commit aff9e88a93
41 changed files with 2175 additions and 48970 deletions

View File

@ -25,12 +25,13 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100002}
serializedVersion: 2
m_LocalRotation: {x: 0.5, y: 0.5, z: -0.5, w: 0.5}
m_LocalPosition: {x: 0, y: 0.000000019868, z: -0.32}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 400004}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 90, y: 90, z: 0}
--- !u!33 &3300002
MeshFilter:
@ -51,10 +52,12 @@ MeshRenderer:
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
@ -79,6 +82,7 @@ MeshRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &100004
GameObject:
m_ObjectHideFlags: 0
@ -104,14 +108,15 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100004}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 3, y: 3, z: 3}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4000010027762468}
- {fileID: 400002}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &11400000
MonoBehaviour:
@ -128,8 +133,11 @@ MonoBehaviour:
fxType: 11
layerMask:
serializedVersion: 2
m_Bits: 4294967295
lifeTime: 1
m_Bits: 136
Damage: 150
BlastMagnitude: 100
OwnerId: 0
LifeTime: 5
despawnDelay: 0
velocity: 300
RaycastAdvance: 2
@ -178,12 +186,13 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000010589384354}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0.000000019868, z: -0.32}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 400004}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
--- !u!33 &33000011791246272
MeshFilter:
@ -204,10 +213,12 @@ MeshRenderer:
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
@ -232,3 +243,4 @@ MeshRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}

View File

@ -26,15 +26,17 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100000}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!120 &12000000
LineRenderer:
serializedVersion: 2
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
@ -44,10 +46,12 @@ LineRenderer:
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 0
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
@ -129,16 +133,20 @@ LineRenderer:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 2
m_NumAlphaKeys: 2
numCornerVertices: 0
numCapVertices: 0
alignment: 0
textureMode: 0
textureScale: {x: 1, y: 1}
shadowBias: 0
generateLightingData: 0
m_MaskInteraction: 0
m_UseWorldSpace: 0
m_Loop: 0
m_ApplyActiveColorSpace: 0
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
@ -153,9 +161,12 @@ MonoBehaviour:
m_EditorClassIdentifier:
layerMask:
serializedVersion: 2
m_Bits: 4294967295
m_Bits: 136
Damage: 350
BlastMagnitude: 350
OwnerId: 0
fxType: 5
OneShot: 1
OneShot: 0
BeamFrames:
- {fileID: 2800000, guid: 93d10af4c9d98aa48abb06818e0ab192, type: 3}
- {fileID: 2800000, guid: ebe4a3a4b5a73e549b0a5fd41d68055b, type: 3}

View File

@ -5143,10 +5143,13 @@ MonoBehaviour:
fxType: 4
layerMask:
serializedVersion: 2
m_Bits: 9
lifeTime: 5
m_Bits: 136
Damage: 200
BlastMagnitude: 200
OwnerId: 0
LifeTime: 5
despawnDelay: 1
velocity: 75
velocity: 130
RaycastAdvance: 2
DelayDespawn: 1
delayedParticles:

View File

@ -25,12 +25,13 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100000}
serializedVersion: 2
m_LocalRotation: {x: 0, y: -0.7071068, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: 0.7987106}
m_LocalScale: {x: 2.2, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 400004}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: -90, z: 0}
--- !u!33 &3300000
MeshFilter:
@ -51,10 +52,12 @@ MeshRenderer:
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
@ -79,6 +82,7 @@ MeshRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &100002
GameObject:
m_ObjectHideFlags: 0
@ -104,12 +108,13 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100002}
serializedVersion: 2
m_LocalRotation: {x: 0.5, y: -0.5, z: 0.5, w: 0.5}
m_LocalPosition: {x: 0, y: 0, z: 0.7987106}
m_LocalScale: {x: 2.2, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 400004}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 90}
--- !u!33 &3300002
MeshFilter:
@ -130,10 +135,12 @@ MeshRenderer:
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
@ -158,6 +165,7 @@ MeshRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &100004
GameObject:
m_ObjectHideFlags: 0
@ -183,15 +191,16 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100004}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 400002}
- {fileID: 400000}
- {fileID: 400006}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &11400000
MonoBehaviour:
@ -235,6 +244,7 @@ GameObject:
m_Component:
- component: {fileID: 400006}
- component: {fileID: 10800000}
- component: {fileID: 8317281421139234932}
m_Layer: 0
m_Name: Point light
m_TagString: Untagged
@ -249,12 +259,13 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100006}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0.6052952}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 400004}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!108 &10800000
Light:
@ -315,5 +326,29 @@ Light:
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!114 &8317281421139234932
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100006}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Version: 3
m_UsePipelineSettings: 1
m_AdditionalLightsShadowResolutionTier: 2
m_LightLayerMask: 1
m_RenderingLayers: 1
m_CustomShadowLayers: 0
m_ShadowLayerMask: 1
m_ShadowRenderingLayers: 1
m_LightCookieSize: {x: 1, y: 1}
m_LightCookieOffset: {x: 0, y: 0}
m_SoftShadowQuality: 0

View File

@ -1,5 +1,181 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &6391351660618341151
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 100008, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 100010, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 100012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_Name
value: solo_gun_flare_trail Variant
objectReference: {fileID: 0}
- target: {fileID: 400012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 400012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: InitialModule.startSize.minScalar
value: 0.94
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.gradient.maxGradient.atime1
value: 2120
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.gradient.maxGradient.atime2
value: 62837
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.gradient.maxGradient.atime3
value: 65535
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.gradient.maxGradient.atime4
value: 65535
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.gradient.maxGradient.atime5
value: 65535
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.gradient.maxGradient.atime6
value: 65535
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.gradient.maxGradient.key2.a
value: 1
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.gradient.maxGradient.key3.a
value: 0
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.gradient.maxGradient.key4.a
value: 0
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.gradient.maxGradient.key5.a
value: 0
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.gradient.maxGradient.key6.a
value: 1
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.gradient.maxGradient.m_NumAlphaKeys
value: 4
objectReference: {fileID: 0}
- target: {fileID: 19800004, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ShapeModule.enabled
value: 0
objectReference: {fileID: 0}
- target: {fileID: 19800004, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ShapeModule.radius.value
value: 0.09
objectReference: {fileID: 0}
- target: {fileID: 19800004, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: InitialModule.startSize.scalar
value: 5
objectReference: {fileID: 0}
- target: {fileID: 19800004, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: InitialModule.startSize.minScalar
value: 0.94
objectReference: {fileID: 0}
- target: {fileID: 19800004, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: InitialModule.startColor.maxColor.a
value: 1
objectReference: {fileID: 0}
- target: {fileID: 19800004, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: InitialModule.startColor.maxColor.b
value: 1
objectReference: {fileID: 0}
- target: {fileID: 19800004, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: InitialModule.startColor.maxColor.g
value: 1
objectReference: {fileID: 0}
- target: {fileID: 19800004, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: InitialModule.startColor.maxColor.r
value: 1
objectReference: {fileID: 0}
- target: {fileID: 19800004, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: InitialModule.gravityModifier.scalar
value: 0
objectReference: {fileID: 0}
- target: {fileID: 19800006, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: InitialModule.startSize.minScalar
value: 8.07
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 100012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
insertIndex: -1
addedObject: {fileID: -8093627500212825932}
- targetCorrespondingSourceObject: {fileID: 100012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
insertIndex: -1
addedObject: {fileID: 8214279908182662867}
m_SourcePrefab: {fileID: 100100000, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
--- !u!1 &6391351660618440115 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 100012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
m_PrefabInstance: {fileID: 6391351660618341151}
m_PrefabAsset: {fileID: 0}
--- !u!114 &-8093627500212825932
MonoBehaviour:
m_ObjectHideFlags: 0
@ -15,8 +191,11 @@ MonoBehaviour:
fxType: 1
layerMask:
serializedVersion: 2
m_Bits: 4294967295
lifeTime: 2
m_Bits: 136
Damage: 200
BlastMagnitude: 200
OwnerId: 0
LifeTime: 5
despawnDelay: 0
velocity: 200
RaycastAdvance: 2
@ -40,170 +219,3 @@ MonoBehaviour:
MaxScale: 1.2
MinRotation: -360
MaxRotaion: 360
--- !u!1001 &6391351660618341151
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 100008, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 100010, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 100012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_Name
value: solo_gun_flare_trail Variant
objectReference: {fileID: 0}
- target: {fileID: 400012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 400012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400012, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: InitialModule.startSize.minScalar
value: 0.94
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.gradient.maxGradient.atime2
value: 62837
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.gradient.maxGradient.key2.a
value: 1
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.gradient.maxGradient.key3.a
value: 0
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.gradient.maxGradient.key4.a
value: 0
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.gradient.maxGradient.key5.a
value: 0
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.gradient.maxGradient.key6.a
value: 1
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.gradient.maxGradient.atime3
value: 65535
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.gradient.maxGradient.atime4
value: 65535
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.gradient.maxGradient.atime5
value: 65535
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.gradient.maxGradient.atime6
value: 65535
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.gradient.maxGradient.m_NumAlphaKeys
value: 4
objectReference: {fileID: 0}
- target: {fileID: 19800002, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ColorModule.gradient.maxGradient.atime1
value: 2120
objectReference: {fileID: 0}
- target: {fileID: 19800004, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: InitialModule.startSize.minScalar
value: 0.94
objectReference: {fileID: 0}
- target: {fileID: 19800004, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ShapeModule.enabled
value: 0
objectReference: {fileID: 0}
- target: {fileID: 19800004, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: ShapeModule.radius.value
value: 0.09
objectReference: {fileID: 0}
- target: {fileID: 19800004, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: InitialModule.gravityModifier.scalar
value: 0
objectReference: {fileID: 0}
- target: {fileID: 19800004, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: InitialModule.startColor.maxColor.r
value: 1
objectReference: {fileID: 0}
- target: {fileID: 19800004, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: InitialModule.startColor.maxColor.g
value: 1
objectReference: {fileID: 0}
- target: {fileID: 19800004, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: InitialModule.startColor.maxColor.b
value: 1
objectReference: {fileID: 0}
- target: {fileID: 19800004, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: InitialModule.startSize.scalar
value: 5
objectReference: {fileID: 0}
- target: {fileID: 19800004, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: InitialModule.startColor.maxColor.a
value: 1
objectReference: {fileID: 0}
- target: {fileID: 19800006, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
propertyPath: InitialModule.startSize.minScalar
value: 8.07
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 157253c33b5e2ae4c99dd92c193b5413, type: 3}
--- !u!1 &6391351660618440115 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 100012, guid: 157253c33b5e2ae4c99dd92c193b5413,
type: 3}
m_PrefabInstance: {fileID: 6391351660618341151}
m_PrefabAsset: {fileID: 0}

View File

@ -443,7 +443,7 @@ namespace FORGE3D
}
// Play heavy plasma beam shot and loop audio at specific position
public void PlasmaBeamHeavyLoop(Vector3 pos, Transform loopParent)
public AudioSource PlasmaBeamHeavyLoop(Vector3 pos, Transform loopParent)
{
AudioSource aOpen =
F3DPoolManager.Pools["GeneratedPool"].SpawnAudio(audioSource, plasmabeamHeavyOpen, pos, null)
@ -468,6 +468,7 @@ namespace FORGE3D
aLoop.Play();
}
return aLoop;
}
// Play heavy plasma beam closing audio at specific position

View File

@ -8,7 +8,15 @@ namespace FORGE3D
{
public LayerMask layerMask;
public F3DFXType fxType; // Weapon type
[Tooltip("The amount of damage this projectil inflicts generally.")]
public float Damage = 1f;
[Tooltip("The magnitude of the blast when hitting something.")]
public float BlastMagnitude = 0.1f;
[HideInInspector]
public int OwnerId = 0;
public WeaponEffect fxType; // Weapon type
public bool OneShot; // Constant or single beam?
public Texture[] BeamFrames; // Animation frame sequence
@ -82,7 +90,8 @@ namespace FORGE3D
float propMult = MaxBeamLength * (beamScale / 10f);
// Raycast
if (Physics.Raycast(ray, out hitPoint, MaxBeamLength, layerMask))
if (Physics.Raycast(ray, out hitPoint, MaxBeamLength, layerMask)
&& DetectorCollision(hitPoint) != OwnerId)
{
// Get current beam length and update line renderer accordingly
beamLength = Vector3.Distance(transform.position, hitPoint.point);
@ -93,22 +102,18 @@ namespace FORGE3D
// Spawn prefabs and apply force
switch (fxType)
{
case F3DFXType.Sniper:
case WeaponEffect.Sniper:
F3DFXController.instance.SniperImpact(hitPoint.point + hitPoint.normal * fxOffset);
ApplyForce(4f);
break;
case F3DFXType.RailGun:
case WeaponEffect.RailGun:
F3DFXController.instance.RailgunImpact(hitPoint.point + hitPoint.normal * fxOffset);
ApplyForce(7f);
break;
case F3DFXType.PlasmaBeam:
ApplyForce(0.5f);
case WeaponEffect.PlasmaBeam:
break;
case F3DFXType.PlasmaBeamHeavy:
ApplyForce(2f);
case WeaponEffect.PlasmaBeamHeavy:
break;
}
@ -116,49 +121,6 @@ namespace FORGE3D
if (rayImpact)
rayImpact.position = hitPoint.point - transform.forward * 0.5f;
}
//checking in 2d mode
else
{
RaycastHit2D ray2D = Physics2D.Raycast(new Vector2(transform.position.x, transform.position.y),
new Vector2(transform.forward.x, transform.forward.y), beamLength, layerMask);
if (ray2D)
{
// Get current beam length and update line renderer accordingly
beamLength = Vector3.Distance(transform.position, ray2D.point);
lineRenderer.SetPosition(1, new Vector3(0f, 0f, beamLength));
// Calculate default beam proportion multiplier based on default scale and current length
propMult = beamLength * (beamScale / 10f);
// Spawn prefabs and apply force
switch (fxType)
{
case F3DFXType.Sniper:
F3DFXController.instance.SniperImpact(ray2D.point + ray2D.normal * fxOffset);
ApplyForce(4f);
break;
case F3DFXType.RailGun:
F3DFXController.instance.RailgunImpact(ray2D.point + ray2D.normal * fxOffset);
ApplyForce(7f);
break;
case F3DFXType.PlasmaBeam:
ApplyForce(0.5f);
break;
case F3DFXType.PlasmaBeamHeavy:
ApplyForce(2f);
break;
}
// Adjust impact effect position
if (rayImpact)
rayImpact.position = new Vector3(ray2D.point.x,
ray2D.point.y,
this.gameObject.transform.position.z) - transform.forward * 0.5f;
}
// Nothing was his
else
{
// Set beam to maximum length
@ -169,7 +131,6 @@ namespace FORGE3D
if (rayImpact)
rayImpact.position = transform.position + transform.forward * beamLength;
}
}
// Adjust muzzle position
if (rayMuzzle)
@ -179,6 +140,35 @@ namespace FORGE3D
lineRenderer.material.SetTextureScale("_BaseMap", new Vector2(propMult, 1f));
}
/// <summary>
/// Checks if a HitDetector was hit and registers a hit
/// on it if so.
/// </summary>
/// <param name="hitPoint"></param>
/// <returns>OwnerId of the hit detector (-1 on none)</returns>
int DetectorCollision(RaycastHit hitPoint)
{
if (hitPoint.collider.gameObject.TryGetComponent(out HitDetection detector))
{
// Check if the one firing was hit
if (detector.OwnerId == OwnerId)
{
return OwnerId;
}
ProjectileDamage inflictling = new()
{
DamageValue = Damage,
ImpactMagnitude = BlastMagnitude,
ImpactPoint = hitPoint.point,
ImpactDirection = transform.forward
};
detector.RegisterHit(inflictling);
return detector.OwnerId;
}
return -1;
}
// Advance texture frame
void OnFrameStep()
{

View File

@ -1,12 +1,11 @@
using UnityEngine;
using System.Collections;
using System;
using System.Linq;
namespace FORGE3D
{
// Weapon types
public enum F3DFXType
public enum WeaponEffect
{
Vulcan,
SoloGun,
@ -19,7 +18,8 @@ namespace FORGE3D
PlasmaBeamHeavy,
LightningGun,
FlameRed,
LaserImpulse
LaserImpulse,
None
}
public class F3DFXController : MonoBehaviour
@ -34,22 +34,23 @@ namespace FORGE3D
// Timer reference
private int timerID = -1;
[Header("Turret setup")] public Transform[] TurretSocket; // Sockets reference
public ParticleSystem[] ShellParticles; // Bullet shells particle system
public F3DFXType DefaultFXType; // Default starting weapon type
public WeaponEffect SelectedWeaponEffect; // Default starting weapon type
[Header("Vulcan")] public Transform vulcanProjectile; // Projectile prefab
public Transform vulcanMuzzle; // Muzzle flash prefab
public Transform vulcanImpact; // Impact prefab
public float vulcanOffset;
public float VulcanFireRate = 0.07f;
[Header("Solo gun")] public Transform soloGunProjectile;
public Transform soloGunMuzzle;
public Transform soloGunImpact;
public float soloGunOffset;
public float SoloGunFireRate = 0.3f;
[Header("Sniper")] public Transform sniperBeam;
public Transform sniperMuzzle;
@ -65,11 +66,13 @@ namespace FORGE3D
public Transform seekerMuzzle;
public Transform seekerImpact;
public float seekerOffset;
public float SeekerFireRate = 0.5f;
[Header("Rail gun")] public Transform railgunBeam;
public Transform railgunMuzzle;
public Transform railgunImpact;
public float railgunOffset;
public float RailGunFireRate = 1f;
[Header("Plasma gun")] public Transform plasmagunProjectile;
public Transform plasmagunMuzzle;
@ -81,6 +84,7 @@ namespace FORGE3D
[Header("Plasma beam heavy")] public Transform plasmaBeamHeavy;
public float plasmaBeamHeavyOffset;
private AudioSource plasmaBeamLoopAudio;
[Header("Lightning gun")] public Transform lightningGunBeam;
public float lightingGunBeamOffset;
@ -92,9 +96,14 @@ namespace FORGE3D
public Transform laserImpulseMuzzle;
public Transform laserImpulseImpact;
public float laserImpulseOffset;
public float LaserImpulseFireRate = 0.08f;
//Owner of this weapon system
private int _ownerId = 0;
private void Awake()
{
_ownerId = gameObject.GetInstanceID();
// Initialize singleton
instance = this;
@ -112,18 +121,18 @@ namespace FORGE3D
// Switch to next weapon type
public void NextWeapon()
{
if ((int) DefaultFXType < Enum.GetNames(typeof(F3DFXType)).Length - 1)
if ((int)SelectedWeaponEffect < Enum.GetNames(typeof(WeaponEffect)).Length - 1)
{
DefaultFXType++;
SelectedWeaponEffect++;
}
}
// Switch to previous weapon type
public void PrevWeapon()
{
if (DefaultFXType > 0)
if (SelectedWeaponEffect > 0)
{
DefaultFXType--;
SelectedWeaponEffect--;
}
}
@ -138,67 +147,67 @@ namespace FORGE3D
// Fire turret weapon
public void Fire()
{
switch (DefaultFXType)
switch (SelectedWeaponEffect)
{
case F3DFXType.Vulcan:
case WeaponEffect.Vulcan:
// Fire vulcan at specified rate until canceled
timerID = F3DTime.time.AddTimer(VulcanFireRate, Vulcan);
// Invoke manually before the timer ticked to avoid initial delay
Vulcan();
break;
case F3DFXType.SoloGun:
timerID = F3DTime.time.AddTimer(0.2f, SoloGun);
case WeaponEffect.SoloGun:
timerID = F3DTime.time.AddTimer(SoloGunFireRate, SoloGun);
SoloGun();
break;
case F3DFXType.Sniper:
case WeaponEffect.Sniper:
timerID = F3DTime.time.AddTimer(0.3f, Sniper);
Sniper();
break;
case F3DFXType.ShotGun:
case WeaponEffect.ShotGun:
timerID = F3DTime.time.AddTimer(0.3f, ShotGun);
ShotGun();
break;
case F3DFXType.Seeker:
timerID = F3DTime.time.AddTimer(0.2f, Seeker);
case WeaponEffect.Seeker:
timerID = F3DTime.time.AddTimer(SeekerFireRate, Seeker);
Seeker();
break;
case F3DFXType.RailGun:
timerID = F3DTime.time.AddTimer(0.2f, RailGun);
case WeaponEffect.RailGun:
timerID = F3DTime.time.AddTimer(RailGunFireRate, RailGun);
RailGun();
break;
case F3DFXType.PlasmaGun:
case WeaponEffect.PlasmaGun:
timerID = F3DTime.time.AddTimer(0.2f, PlasmaGun);
PlasmaGun();
break;
case F3DFXType.PlasmaBeam:
case WeaponEffect.PlasmaBeam:
// Beams has no timer requirement
PlasmaBeam();
break;
case F3DFXType.PlasmaBeamHeavy:
case WeaponEffect.PlasmaBeamHeavy:
// Beams has no timer requirement
PlasmaBeamHeavy();
break;
case F3DFXType.LightningGun:
case WeaponEffect.LightningGun:
// Beams has no timer requirement
LightningGun();
break;
case F3DFXType.FlameRed:
case WeaponEffect.FlameRed:
// Flames has no timer requirement
FlameRed();
break;
case F3DFXType.LaserImpulse:
timerID = F3DTime.time.AddTimer(0.15f, LaserImpulse);
case WeaponEffect.LaserImpulse:
timerID = F3DTime.time.AddTimer(LaserImpulseFireRate, LaserImpulse);
LaserImpulse();
break;
}
@ -210,25 +219,28 @@ namespace FORGE3D
// Remove firing timer
if (timerID != -1)
{
F3DTime.time.RemoveTimer(timerID);
F3DTime.time.RemoveTimerNextTick(timerID);
timerID = -1;
}
switch (DefaultFXType)
switch (SelectedWeaponEffect)
{
case F3DFXType.PlasmaBeam:
case WeaponEffect.PlasmaBeam:
F3DAudioController.instance.PlasmaBeamClose(transform.position);
break;
case F3DFXType.PlasmaBeamHeavy:
case WeaponEffect.PlasmaBeamHeavy:
StopPlasmaBeamHeavy();
F3DAudioController.instance.PlasmaBeamHeavyClose(transform.position);
if (plasmaBeamLoopAudio == null) break;
F3DPoolManager.Pools["GeneratedPool"].Despawn(plasmaBeamLoopAudio.gameObject.transform);
break;
case F3DFXType.LightningGun:
case WeaponEffect.LightningGun:
F3DAudioController.instance.LightningGunClose(transform.position);
break;
case F3DFXType.FlameRed:
case WeaponEffect.FlameRed:
F3DAudioController.instance.FlameGunClose(transform.position);
break;
}
@ -251,6 +263,7 @@ namespace FORGE3D
if (proj)
{
proj.SetOffset(vulcanOffset);
proj.OwnerId = _ownerId;
}
// Emit one bullet shell
@ -287,6 +300,7 @@ namespace FORGE3D
if (proj)
{
proj.SetOffset(soloGunOffset);
proj.OwnerId = _ownerId;
}
F3DAudioController.instance.SoloGunShot(TurretSocket[curSocket].position);
@ -362,6 +376,7 @@ namespace FORGE3D
if (proj)
{
proj.SetOffset(seekerOffset);
proj.OwnerId = _ownerId;
}
F3DAudioController.instance.SeekerShot(TurretSocket[curSocket].position);
@ -390,6 +405,7 @@ namespace FORGE3D
if (beam)
{
beam.SetOffset(railgunOffset);
beam.OwnerId = _ownerId;
}
F3DAudioController.instance.RailGunShot(TurretSocket[curSocket].position);
@ -418,6 +434,7 @@ namespace FORGE3D
if (proj)
{
proj.SetOffset(plasmaOffset);
proj.OwnerId = _ownerId;
}
F3DAudioController.instance.PlasmaGunShot(TurretSocket[curSocket].position);
@ -444,6 +461,17 @@ namespace FORGE3D
F3DAudioController.instance.PlasmaBeamLoop(transform.position, transform.parent);
}
private void StopPlasmaBeamHeavy()
{
for (var i = 0; i < TurretSocket.Length; i++)
{
foreach (Transform child in TurretSocket[i])
{
F3DPoolManager.Pools["GeneratedPool"].Despawn(child, plasmaBeamHeavy);
}
}
}
// Fire heavy beam weapon
private void PlasmaBeamHeavy()
{
@ -454,7 +482,7 @@ namespace FORGE3D
TurretSocket[i]);
}
F3DAudioController.instance.PlasmaBeamHeavyLoop(transform.position, transform.parent);
plasmaBeamLoopAudio = F3DAudioController.instance.PlasmaBeamHeavyLoop(transform.position, transform.parent);
}
// Fire lightning gun weapon
@ -496,6 +524,7 @@ namespace FORGE3D
if (proj)
{
proj.SetOffset(laserImpulseOffset);
proj.OwnerId = _ownerId;
}
F3DAudioController.instance.LaserImpulseShot(TurretSocket[curSocket].position);

View File

@ -3,7 +3,7 @@ using System.Collections;
namespace FORGE3D
{
[RequireComponent(typeof (LineRenderer))]
[RequireComponent(typeof(LineRenderer))]
public class F3DLightning : MonoBehaviour
{
public LayerMask layerMask;
@ -27,6 +27,14 @@ namespace FORGE3D
public Transform rayImpact; // Impact transform
public Transform rayMuzzle; // Muzzle flash transform
[Tooltip("The amount of damage this projectil inflicts generally.")]
public float damage = 10f;
[Tooltip("The magnitude of the blast when hitting something.")]
public float blastMagnitude = 1f;
[HideInInspector]
public int OwnerId = 0;
LineRenderer lineRenderer; // Line rendered component
RaycastHit hitPoint; // Raycast structure
@ -92,10 +100,11 @@ namespace FORGE3D
Ray ray = new Ray(transform.position, transform.forward);
// Calculate default beam proportion multiplier based on default scale and maximum length
float propMult = MaxBeamLength*(beamScale/10f);
float propMult = MaxBeamLength * (beamScale / 10f);
// Raycast
if (Physics.Raycast(ray, out hitPoint, MaxBeamLength, layerMask))
if (Physics.Raycast(ray, out hitPoint, MaxBeamLength, layerMask)
&& DetectorCollision(hitPoint) != OwnerId)
{
// Get current beam length
beamLength = Vector3.Distance(transform.position, hitPoint.point);
@ -105,14 +114,11 @@ namespace FORGE3D
lineRenderer.SetPosition(1, new Vector3(0f, 0f, beamLength));
// Calculate default beam proportion multiplier based on default scale and current length
propMult = beamLength*(beamScale/10f);
// Apply hit force to rigidbody
ApplyForce(0.1f);
propMult = beamLength * (beamScale / 10f);
// Adjust impact effect position
if (rayImpact)
rayImpact.position = hitPoint.point - transform.forward*0.5f;
rayImpact.position = hitPoint.point - transform.forward * 0.5f;
}
// Nothing was his
@ -127,17 +133,46 @@ namespace FORGE3D
// Adjust impact effect position
if (rayImpact)
rayImpact.position = transform.position + transform.forward*beamLength;
rayImpact.position = transform.position + transform.forward * beamLength;
}
// Adjust muzzle position
if (rayMuzzle)
rayMuzzle.position = transform.position + transform.forward*0.1f;
rayMuzzle.position = transform.position + transform.forward * 0.1f;
// Set beam scaling according to its length
lineRenderer.material.SetTextureScale("_BaseMap", new Vector2(propMult, 1f));
}
/// <summary>
/// Checks if a HitDetector was hit and registers a hit
/// on it if so.
/// </summary>
/// <param name="hitPoint"></param>
/// <returns>OwnerId of the hit detector (-1 on none)</returns>
int DetectorCollision(RaycastHit hitPoint)
{
if (hitPoint.collider.gameObject.TryGetComponent(out HitDetection detector))
{
// Check if the one firing was hit
if (detector.OwnerId == OwnerId)
{
return OwnerId;
}
ProjectileDamage inflictling = new()
{
DamageValue = damage,
ImpactMagnitude = blastMagnitude,
ImpactPoint = hitPoint.point,
ImpactDirection = transform.forward
};
detector.RegisterHit(inflictling);
return detector.OwnerId;
}
return -1;
}
// Generate random noise numbers based on amplitude
float GetRandomNoise()
{
@ -164,12 +199,12 @@ namespace FORGE3D
void OnOscillate()
{
// Calculate number of points based on beam length and default number of points
int points = (int) ((beamLength/10f)*Points);
int points = (int)((beamLength / 10f) * Points);
// Update line rendered segments in case number of points less than 2
if (points < 2)
{
// lineRenderer.SetVertexCount(2);
// lineRenderer.SetVertexCount(2);
lineRenderer.positionCount = 2;
lineRenderer.SetPosition(0, Vector3.zero);
lineRenderer.SetPosition(1, new Vector3(0, 0, beamLength));
@ -185,7 +220,7 @@ namespace FORGE3D
// Update each point with random noise based on amplitude
for (int i = 1; i < points - 1; i++)
lineRenderer.SetPosition(i,
new Vector3(GetRandomNoise(), GetRandomNoise(), (beamLength/(points - 1))*i));
new Vector3(GetRandomNoise(), GetRandomNoise(), (beamLength / (points - 1)) * i));
// Set last point manually
lineRenderer.SetPosition(points - 1, new Vector3(0f, 0f, beamLength));
@ -209,14 +244,14 @@ namespace FORGE3D
void ApplyForce(float force)
{
if (hitPoint.rigidbody != null)
hitPoint.rigidbody.AddForceAtPosition(transform.forward*force, hitPoint.point, ForceMode.VelocityChange);
hitPoint.rigidbody.AddForceAtPosition(transform.forward * force, hitPoint.point, ForceMode.VelocityChange);
}
void Update()
{
// Animate texture UV
if (AnimateUV)
lineRenderer.material.SetVector("_Offset", new Vector2(Time.time*UVTime + initialBeamOffset, 0f));
lineRenderer.material.SetVector("_Offset", new Vector2(Time.time * UVTime + initialBeamOffset, 0f));
// Process raycasting
Raycast();

View File

@ -5,9 +5,18 @@ namespace FORGE3D
{
public class F3DProjectile : MonoBehaviour
{
public F3DFXType fxType; // Weapon type
public WeaponEffect fxType; // Weapon type
public LayerMask layerMask;
public float lifeTime = 5f; // Projectile life time
[Tooltip("The amount of damage this projectil inflicts generally.")]
public float Damage = 10f;
[Tooltip("The magnitude of the blast when hitting something.")]
public float BlastMagnitude = 1f;
[HideInInspector]
public int OwnerId = 0;
public float LifeTime = 5f; // Projectile life time
public float despawnDelay; // Delay despawn in ms
public float velocity = 300f; // Projectile velocity
public float RaycastAdvance = 2f; // Raycast advance multiplier
@ -26,6 +35,7 @@ namespace FORGE3D
// Cache transform and get all particle systems attached
transform = GetComponent<Transform>();
particles = GetComponentsInChildren<ParticleSystem>();
}
// OnSpawned called by pool manager
@ -73,12 +83,13 @@ namespace FORGE3D
F3DPoolManager.Pools["GeneratedPool"].Despawn(transform);
}
// Apply hit force on impact
// TODO: for my purposes this is not enough control over this effect
// I will have to implement HitDetectors for everything which can be hit
void ApplyForce(float force)
{
if (hitPoint.rigidbody != null)
hitPoint.rigidbody.AddForceAtPosition(transform.forward * force, hitPoint.point,
ForceMode.VelocityChange);
// if (hitPoint.rigidbody != null)
// hitPoint.rigidbody.AddForceAtPosition(transform.forward * force, hitPoint.point,
// ForceMode.VelocityChange);
}
void Update()
@ -92,27 +103,27 @@ namespace FORGE3D
// Invoke corresponding method that spawns FX
switch (fxType)
{
case F3DFXType.Vulcan:
case WeaponEffect.Vulcan:
F3DFXController.instance.VulcanImpact(hitPoint.point + hitPoint.normal * fxOffset);
ApplyForce(2.5f);
break;
case F3DFXType.SoloGun:
case WeaponEffect.SoloGun:
F3DFXController.instance.SoloGunImpact(hitPoint.point + hitPoint.normal * fxOffset);
ApplyForce(25f);
break;
case F3DFXType.Seeker:
case WeaponEffect.Seeker:
F3DFXController.instance.SeekerImpact(hitPoint.point + hitPoint.normal * fxOffset);
ApplyForce(30f);
break;
case F3DFXType.PlasmaGun:
case WeaponEffect.PlasmaGun:
F3DFXController.instance.PlasmaGunImpact(hitPoint.point + hitPoint.normal * fxOffset);
ApplyForce(25f);
break;
case F3DFXType.LaserImpulse:
case WeaponEffect.LaserImpulse:
F3DFXController.instance.LaserImpulseImpact(hitPoint.point + hitPoint.normal * fxOffset);
ApplyForce(25f);
break;
@ -137,13 +148,16 @@ namespace FORGE3D
step.magnitude * RaycastAdvance,
layerMask))
{
isHit = true;
if (hitPoint.collider.gameObject.TryGetComponent(out HitFeedbackTestObjectBehavior obj))
if (DetectorCollision(hitPoint) == OwnerId)
{
obj.Hit();
transform.position += 2 * step;
timer += Time.deltaTime;
return;
}
isHit = true;
// Invoke delay routine if required
if (DelayDespawn)
{
@ -156,7 +170,7 @@ namespace FORGE3D
else
{
// Projectile despawn after run out of time
if (timer >= lifeTime)
if (timer >= LifeTime)
OnProjectileDestroy();
}
@ -168,6 +182,35 @@ namespace FORGE3D
timer += Time.deltaTime;
}
/// <summary>
/// Checks if a HitDetector was hit and registers a hit
/// on it if so.
/// </summary>
/// <param name="hitPoint"></param>
/// <returns>OwnerId of the hit detector (-1 on none)</returns>
int DetectorCollision(RaycastHit hitPoint)
{
if (hitPoint.collider.gameObject.TryGetComponent(out HitDetection detector))
{
// Check if the one firing was hit
if (detector.OwnerId == OwnerId)
{
return OwnerId;
}
ProjectileDamage inflictling = new()
{
DamageValue = Damage,
ImpactMagnitude = BlastMagnitude,
ImpactPoint = hitPoint.point,
ImpactDirection = transform.forward
};
detector.RegisterHit(inflictling);
return detector.OwnerId;
}
return -1;
}
//Set offset
public void SetOffset(float offset)
{

View File

@ -2,6 +2,7 @@
using System.Collections;
using System.Collections.Generic;
using System;
using System.Linq;
namespace FORGE3D
{
@ -23,6 +24,7 @@ namespace FORGE3D
{
public int id;
public bool isActive;
public bool removeNextTick = false;
public float rate;
public int ticks;
@ -47,6 +49,13 @@ namespace FORGE3D
if (isActive && last >= rate)
{
if (removeNextTick)
{
isActive = false;
F3DTime.time.RemoveTimer(id);
return;
}
last = 0;
ticksElapsed++;
callBack.Invoke();
@ -104,6 +113,11 @@ namespace FORGE3D
removalPending.Add(timerId);
}
public void RemoveTimerNextTick(int timerId)
{
timers.First(t => t.id == timerId).removeNextTick = true;
}
/// <summary>
/// Timer removal queue handler
/// </summary>

View File

@ -31,7 +31,7 @@ namespace FORGE3D
void SetWeaponTypeText()
{
WeaponTypeText.text = _fxTypeName[(int) _fxControllers[0].DefaultFXType];
WeaponTypeText.text = _fxTypeName[(int)_fxControllers[0].SelectedWeaponEffect];
}
public void OnButtonNext()

View File

@ -21,8 +21,7 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Burnout_Heat_001
m_Shader: {fileID: -6465566751694194690, guid: a69f632f7605c4347b0ac15ec7b2d967,
type: 3}
m_Shader: {fileID: -6465566751694194690, guid: a69f632f7605c4347b0ac15ec7b2d967, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
@ -75,7 +74,7 @@ Material:
- _AlphaCutoff: 0.5
- _BumpAmt: 0
- _Dist: 1
- _Distort: 0.01
- _Distort: 0
- _InvFade: 3
- _QueueControl: 0
- _QueueOffset: 0

View File

@ -21,8 +21,7 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Burnout_Sparks
m_Shader: {fileID: -6465566751694194690, guid: 894e255bca895714c929238ea0e6273f,
type: 3}
m_Shader: {fileID: -6465566751694194690, guid: 894e255bca895714c929238ea0e6273f, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
@ -76,6 +75,7 @@ Material:
- _AlphaToMask: 0
- _Blend: 2
- _BlendOp: 0
- _Blur: -1
- _Boost: 65.64
- _CameraFadingEnabled: 0
- _CameraFarFadeDistance: 2
@ -109,6 +109,7 @@ Material:
- _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _Offset: {r: 0, g: 0, b: 0, a: 0}
- _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0}
- _TintColor: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []

View File

@ -120,7 +120,7 @@ Material:
- _AlphaCutoff: 0.5
- _BurnOut: 0
- _BurnUVOffset: 0.15
- _Burnout: 0.3
- _Burnout: 0
- _ClipThreshold: 0.12
- _Cut: -0.47
- _Cutoff: 0.33

View File

@ -21,8 +21,7 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: seeker_bolt_flare
m_Shader: {fileID: -6465566751694194690, guid: 894e255bca895714c929238ea0e6273f,
type: 3}
m_Shader: {fileID: -6465566751694194690, guid: 89754397a45ebd242a4116119466e163, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
@ -76,6 +75,7 @@ Material:
- _AlphaToMask: 0
- _Blend: 2
- _BlendOp: 0
- _Blur: -1
- _Boost: 1.29
- _CameraFadingEnabled: 0
- _CameraFarFadeDistance: 2
@ -109,6 +109,7 @@ Material:
- _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _Offset: {r: 0, g: 0, b: 0, a: 0}
- _SoftParticleFadeParams: {r: 0, g: 1, b: 0, a: 0}
- _TintColor: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []

View File

@ -21,8 +21,7 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: seeker_bolt_fragment
m_Shader: {fileID: -6465566751694194690, guid: 894e255bca895714c929238ea0e6273f,
type: 3}
m_Shader: {fileID: -6465566751694194690, guid: 89754397a45ebd242a4116119466e163, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
@ -76,6 +75,7 @@ Material:
- _AlphaToMask: 0
- _Blend: 2
- _BlendOp: 0
- _Blur: -1
- _Boost: 1
- _CameraFadingEnabled: 0
- _CameraFarFadeDistance: 2
@ -109,6 +109,7 @@ Material:
- _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _Offset: {r: 0, g: 0, b: 0, a: 0}
- _SoftParticleFadeParams: {r: 0, g: 1, b: 0, a: 0}
- _TintColor: {r: 0.99999994, g: 0.99999994, b: 0.99999994, a: 1}
m_BuildTextureStacks: []

View File

@ -8,8 +8,7 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: seeker_bolt_muzzle
m_Shader: {fileID: -6465566751694194690, guid: 894e255bca895714c929238ea0e6273f,
type: 3}
m_Shader: {fileID: -6465566751694194690, guid: 89754397a45ebd242a4116119466e163, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
@ -63,6 +62,7 @@ Material:
- _AlphaToMask: 0
- _Blend: 2
- _BlendOp: 0
- _Blur: -1
- _Boost: 1
- _CameraFadingEnabled: 0
- _CameraFarFadeDistance: 2

View File

@ -1,4 +0,0 @@
fileFormatVersion: 2
guid: 49ca46ce7082ccf4c91329cd9b7c4b61
NativeFormatImporter:
userData:

View File

@ -1,4 +0,0 @@
fileFormatVersion: 2
guid: 762a17aff08aa1f40ac72b27c15fe2d1
NativeFormatImporter:
userData:

View File

@ -1,319 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &100000
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 400000}
- component: {fileID: 3300000}
- component: {fileID: 2300000}
m_Layer: 0
m_Name: Quad
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &400000
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100000}
m_LocalRotation: {x: 0, y: -0.7071068, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: 0.7987106}
m_LocalScale: {x: 2.2, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 400004}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: -90, z: 0}
--- !u!33 &3300000
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100000}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &2300000
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100000}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 931f12332f881b342980bc9900f15441, type: 2}
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!1 &100002
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 400002}
- component: {fileID: 3300002}
- component: {fileID: 2300002}
m_Layer: 0
m_Name: Quad
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &400002
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100002}
m_LocalRotation: {x: 0.5, y: -0.5, z: 0.5, w: 0.5}
m_LocalPosition: {x: 0, y: 0, z: 0.7987106}
m_LocalScale: {x: 2.2, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 400004}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 90}
--- !u!33 &3300002
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100002}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &2300002
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100002}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 931f12332f881b342980bc9900f15441, type: 2}
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!1 &100004
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 400004}
- component: {fileID: 11400000}
- component: {fileID: 11400002}
m_Layer: 0
m_Name: seeker_bolt_muzzle_example
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &400004
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100004}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 400002}
- {fileID: 400000}
- {fileID: 400006}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100004}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: af19da7458dc9174699d0b34f404eafc, type: 3}
m_Name:
m_EditorClassIdentifier:
DespawnDelay: 0.05
DespawnOnMouseUp: 0
--- !u!114 &11400002
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100004}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a5df3c5f0444ba74991107c0d882530e, type: 3}
m_Name:
m_EditorClassIdentifier:
RandomScale: 1
RandomRotation: 1
MinScale: 0.8
MaxScale: 1.1
MinRotation: -360
MaxRotaion: 360
--- !u!1 &100006
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 400006}
- component: {fileID: 10800000}
m_Layer: 0
m_Name: Point light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &400006
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100006}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0.6052952}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 400004}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!108 &10800000
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100006}
m_Enabled: 1
serializedVersion: 10
m_Type: 2
m_Shape: 0
m_Color: {r: 1, g: 0.82941175, b: 0.5735294, a: 1}
m_Intensity: 1.2311152
m_Range: 250
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_Shadows:
m_Type: 1
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 0.536
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 1
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_ShadowRadius: 0
m_ShadowAngle: 0

View File

@ -1,4 +0,0 @@
fileFormatVersion: 2
guid: 43a8e47b31adb9a47b81c4653b412e5c
NativeFormatImporter:
userData: