made it feel like a game <3

This commit is contained in:
Dom Harris 2021-01-09 16:18:29 +00:00
parent f98f80c57f
commit 09c763043d
25 changed files with 755 additions and 433 deletions

View File

@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c271cfa846431634db54fa41238b7b35, type: 3} m_Script: {fileID: 11500000, guid: c271cfa846431634db54fa41238b7b35, type: 3}
m_Name: Accessibility Options m_Name: Accessibility Options
m_EditorClassIdentifier: m_EditorClassIdentifier:
_mode: 0 _mode: 1
_calm: _calm:
_tunnel: {fileID: 2100000, guid: 735a92a62479ffd458216009452fec2b, type: 2} _tunnel: {fileID: 2100000, guid: 735a92a62479ffd458216009452fec2b, type: 2}
_vibe: _vibe:

View File

@ -155,6 +155,17 @@ namespace Input
""action"": ""Shoot"", ""action"": ""Shoot"",
""isComposite"": false, ""isComposite"": false,
""isPartOfComposite"": false ""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""6c7bd30a-0e04-4215-b3bd-2be74887a139"",
""path"": ""<Keyboard>/space"",
""interactions"": """",
""processors"": """",
""groups"": ""Default"",
""action"": ""Shoot"",
""isComposite"": false,
""isPartOfComposite"": false
} }
] ]
} }

View File

@ -140,6 +140,17 @@
"action": "Shoot", "action": "Shoot",
"isComposite": false, "isComposite": false,
"isPartOfComposite": false "isPartOfComposite": false
},
{
"name": "",
"id": "6c7bd30a-0e04-4215-b3bd-2be74887a139",
"path": "<Keyboard>/space",
"interactions": "",
"processors": "",
"groups": "Default",
"action": "Shoot",
"isComposite": false,
"isPartOfComposite": false
} }
] ]
} }

View File

@ -12,5 +12,5 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d86361ffc5ae478d9e976629c5d651bd, type: 3} m_Script: {fileID: 11500000, guid: d86361ffc5ae478d9e976629c5d651bd, type: 3}
m_Name: PlayerSpeed m_Name: PlayerSpeed
m_EditorClassIdentifier: m_EditorClassIdentifier:
_initialValue: 12 _initialValue: 24
_readOnly: 0 _readOnly: 0

View File

@ -92,6 +92,7 @@ Material:
- _DstBlend: 0 - _DstBlend: 0
- _EnvironmentReflections: 1 - _EnvironmentReflections: 1
- _FadeStrength: 0.9 - _FadeStrength: 0.9
- _FlashAmount: 0
- _GlossMapScale: 0 - _GlossMapScale: 0
- _Glossiness: 0 - _Glossiness: 0
- _GlossyReflections: 0 - _GlossyReflections: 0
@ -114,6 +115,7 @@ Material:
- _Color1: {r: 0.5411765, g: 1.8509804, b: 2, a: 1} - _Color1: {r: 0.5411765, g: 1.8509804, b: 2, a: 1}
- _Color2: {r: 1.2078432, g: 0, b: 1.1058824, a: 1} - _Color2: {r: 1.2078432, g: 0, b: 1.1058824, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _FlashColor: {r: 1.1, g: 1.1, b: 1.1, a: 1}
- _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_BuildTextureStacks: [] m_BuildTextureStacks: []
--- !u!114 &1642389398374086642 --- !u!114 &1642389398374086642

View File

@ -9,6 +9,7 @@ public class MovePlayer : MonoBehaviour
{ {
[SerializeField] private SerialFloat speed; [SerializeField] private SerialFloat speed;
[SerializeField] private RectOffset extents; [SerializeField] private RectOffset extents;
[SerializeField] private float lerpAmount = 0.95f;
private PlayerInput _input; private PlayerInput _input;
@ -18,9 +19,14 @@ public class MovePlayer : MonoBehaviour
private Rect _pos; private Rect _pos;
private float _yPos;
private float _zPos;
private void Awake() private void Awake()
{ {
_transform = transform; _transform = transform;
_yPos = _transform.localPosition.y;
_zPos = _transform.localPosition.z;
} }
private void OnEnable() private void OnEnable()
@ -40,15 +46,16 @@ public class MovePlayer : MonoBehaviour
private void Update() private void Update()
{ {
_transform.localPosition += (Vector3) _currentInput * speed * Time.deltaTime; _transform.localPosition += (Vector3) _currentInput * speed * Time.deltaTime;
_transform.localPosition = new Vector3( _transform.localPosition = new Vector3(
Mathf.Clamp(_transform.localPosition.x, extents.left, extents.right), Mathf.Clamp(_transform.localPosition.x, extents.left, extents.right),
Mathf.Clamp(_transform.localPosition.y, extents.bottom, extents.top), _yPos,
_transform.localPosition.z); _zPos);
} }
private void DoMove(InputAction.CallbackContext context) private void DoMove(InputAction.CallbackContext context)
{ {
var value = context.ReadValue<Vector2>(); var value = context.ReadValue<Vector2>();
_currentInput = value; _currentInput = Vector2.Lerp(_currentInput, value, lerpAmount);
} }
} }

View File

@ -14,7 +14,6 @@ GameObject:
- component: {fileID: 233269787904781725} - component: {fileID: 233269787904781725}
- component: {fileID: 2766037370157449026} - component: {fileID: 2766037370157449026}
- component: {fileID: 2122656558574222561} - component: {fileID: 2122656558574222561}
- component: {fileID: 499203000553078885}
m_Layer: 7 m_Layer: 7
m_Name: Enemy m_Name: Enemy
m_TagString: Untagged m_TagString: Untagged
@ -123,18 +122,3 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5b2c8b098025f4e2f997759b5c00fef7, type: 3} m_Script: {fileID: 11500000, guid: 5b2c8b098025f4e2f997759b5c00fef7, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!114 &499203000553078885
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1738226812227614583}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 331122d8907f44ed9b0f8f2337d176b9, type: 3}
m_Name:
m_EditorClassIdentifier:
beatsBeforeMove: 16
scaleAmount: 1.5
numBeatsAfterScale: 0

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5d8131bcfdc1241c8ad61ac6e83826ab
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -123,6 +123,37 @@ NavMeshSettings:
debug: debug:
m_Flags: 0 m_Flags: 0
m_NavMeshData: {fileID: 0} m_NavMeshData: {fileID: 0}
--- !u!1 &79664420
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 79664421}
m_Layer: 0
m_Name: PlayerContainer
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &79664421
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 79664420}
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: 1173812008}
m_Father: {fileID: 0}
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &84273093 --- !u!1 &84273093
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -175,7 +206,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 8 m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &186457103 --- !u!1 &186457103
GameObject: GameObject:
@ -207,7 +238,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 4 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
--- !u!114 &186457105 --- !u!114 &186457105
MonoBehaviour: MonoBehaviour:
@ -244,14 +275,9 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
pauseOnBeat: 16 pauseOnBeat: 16
pauseLengthInBeats: 8 pauseLengthInBeats: 0
beatOffset: 2 beatOffset: 2
--- !u!20 &502054319 stripped --- !u!1 &728836291
Camera:
m_CorrespondingSourceObject: {fileID: 3397488660173986648, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3}
m_PrefabInstance: {fileID: 1077224733}
m_PrefabAsset: {fileID: 0}
--- !u!1 &660289115
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
@ -259,159 +285,93 @@ GameObject:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
serializedVersion: 6 serializedVersion: 6
m_Component: m_Component:
- component: {fileID: 660289116} - component: {fileID: 728836292}
- component: {fileID: 660289118} - component: {fileID: 728836295}
- component: {fileID: 660289117} - component: {fileID: 728836294}
- component: {fileID: 660289119} - component: {fileID: 728836293}
m_Layer: 5 m_Layer: 6
m_Name: CrossHair m_Name: Sphere (2)
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 1
--- !u!224 &660289116 --- !u!4 &728836292
RectTransform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 660289115} m_GameObject: {fileID: 728836291}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 1, y: -1.05, z: -1.641}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
m_Children: [] m_Children: []
m_Father: {fileID: 1942400137} m_Father: {fileID: 1173812008}
m_RootOrder: 0 m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} --- !u!135 &728836293
m_AnchorMax: {x: 0, y: 0} SphereCollider:
m_AnchoredPosition: {x: 960, y: 540}
m_SizeDelta: {x: 150, y: 150}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &660289117
MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 660289115} m_GameObject: {fileID: 728836291}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_IsTrigger: 0
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 5716787406560419972, guid: 8fd3c31c95b6f42ddbe7f923aa74992e, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &660289118
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 660289115}
m_CullTransparentMesh: 1
--- !u!114 &660289119
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 660289115}
m_Enabled: 1 m_Enabled: 1
m_EditorHideFlags: 0 serializedVersion: 2
m_Script: {fileID: 11500000, guid: 434522008507440b2b2eee74cd306cc0, type: 3} m_Radius: 0.5
m_Name: m_Center: {x: 0, y: 0, z: 0}
m_EditorClassIdentifier: --- !u!23 &728836294
speed: {fileID: 11400000, guid: 417174c1875ee4a0dbc6f1739c00e93a, type: 2} MeshRenderer:
extents:
m_Left: 200
m_Right: 200
m_Top: 200
m_Bottom: 200
canvas: {fileID: 1942400137}
--- !u!1 &710724060
GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
serializedVersion: 6 m_GameObject: {fileID: 728836291}
m_Component:
- component: {fileID: 710724061}
- component: {fileID: 710724062}
- component: {fileID: 710724063}
m_Layer: 5
m_Name: TargetLockPool
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &710724061
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 710724060}
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: []
m_Father: {fileID: 1942400137}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &710724062
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 710724060}
m_Enabled: 1 m_Enabled: 1
m_EditorHideFlags: 0 m_CastShadows: 1
m_Script: {fileID: 11500000, guid: 9463c7c973b354f1c882567f52337aed, type: 3} m_ReceiveShadows: 1
m_Name: m_DynamicOccludee: 1
m_EditorClassIdentifier: m_MotionVectors: 1
numObjects: 256 m_LightProbeUsage: 1
prefab: {fileID: 2976458840329059775, guid: 9129a265c1cf84274b8703ba593b266c, type: 3} m_ReflectionProbeUsage: 1
numToSpawnPerFrame: 10 m_RayTracingMode: 2
--- !u!114 &710724063 m_RayTraceProcedural: 0
MonoBehaviour: m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 0cef45e7a8ed5434c82d2291106a3fff, 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
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &728836295
MeshFilter:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 710724060} m_GameObject: {fileID: 728836291}
m_Enabled: 1 m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bffdbe5c9628347fc84123c966e47c8e, type: 3}
m_Name:
m_EditorClassIdentifier:
pool: {fileID: 710724062}
cam: {fileID: 502054319}
--- !u!1 &763784687 --- !u!1 &763784687
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -484,7 +444,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 1 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1077224733 --- !u!1001 &1077224733
PrefabInstance: PrefabInstance:
@ -517,10 +477,18 @@ PrefabInstance:
propertyPath: _fractalAnimations.Array.data[0].multiplier propertyPath: _fractalAnimations.Array.data[0].multiplier
value: 1000 value: 1000
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3397488660173986646, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3}
propertyPath: m_RenderPostProcessing
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3397488660173986648, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3} - target: {fileID: 3397488660173986648, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3}
propertyPath: field of view propertyPath: field of view
value: 60 value: 60
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3397488660571973483, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3}
propertyPath: m_RenderPostProcessing
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3397488660842926088, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3} - target: {fileID: 3397488660842926088, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3}
propertyPath: m_Materials.Array.data[0] propertyPath: m_Materials.Array.data[0]
value: value:
@ -531,7 +499,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3397488660842926093, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3} - target: {fileID: 3397488660842926093, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3}
propertyPath: m_LocalScale.x propertyPath: m_LocalScale.x
value: 2282.9778 value: 1847.5209
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3397488660842926093, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3} - target: {fileID: 3397488660842926093, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3}
propertyPath: m_LocalScale.y propertyPath: m_LocalScale.y
@ -551,7 +519,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3397488660859550701, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3} - target: {fileID: 3397488660859550701, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 6 value: 4
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3397488660859550701, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3} - target: {fileID: 3397488660859550701, guid: 1f82f952c53fc7449a0091cf29ba3def, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
@ -610,10 +578,12 @@ GameObject:
- component: {fileID: 1173812008} - component: {fileID: 1173812008}
- component: {fileID: 1173812005} - component: {fileID: 1173812005}
- component: {fileID: 1173812009} - component: {fileID: 1173812009}
- component: {fileID: 1173812010}
- component: {fileID: 1173812012} - component: {fileID: 1173812012}
- component: {fileID: 1173812013} - component: {fileID: 1173812007}
- component: {fileID: 1173812011} - component: {fileID: 1173812006}
- component: {fileID: 1173812014}
- component: {fileID: 1173812015}
- component: {fileID: 1173812010}
m_Layer: 6 m_Layer: 6
m_Name: Player m_Name: Player
m_TagString: Untagged m_TagString: Untagged
@ -634,6 +604,62 @@ BoxCollider:
serializedVersion: 2 serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1} m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0} m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &1173812006
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1173812004}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 10481c2d3ecd249e688b671736b66d62, type: 3}
m_Name:
m_EditorClassIdentifier:
lives: 3
OnDie:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1173812014}
m_TargetAssemblyTypeName: HitStopOnDie, Assembly-CSharp
m_MethodName: OnDie
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 1173812015}
m_TargetAssemblyTypeName: LoseLife, Assembly-CSharp
m_MethodName: LifeLost
m_Mode: 0
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnGameOver:
m_PersistentCalls:
m_Calls: []
--- !u!114 &1173812007
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1173812004}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d77551efeb20a4bdabb517c8351695ff, type: 3}
m_Name:
m_EditorClassIdentifier:
maxHealth: 1
--- !u!4 &1173812008 --- !u!4 &1173812008
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -642,13 +668,16 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1173812004} m_GameObject: {fileID: 1173812004}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: -4, z: 6}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: m_Children:
- {fileID: 1639649351} - {fileID: 1639649351}
- {fileID: 1222495243} - {fileID: 1222495243}
m_Father: {fileID: 0} - {fileID: 1581716070}
m_RootOrder: 2 - {fileID: 1611642540}
- {fileID: 728836292}
m_Father: {fileID: 79664421}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1173812009 --- !u!114 &1173812009
MonoBehaviour: MonoBehaviour:
@ -664,10 +693,11 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
speed: {fileID: 11400000, guid: 866d52dfca73e4880858f1da4ae6b2ef, type: 2} speed: {fileID: 11400000, guid: 866d52dfca73e4880858f1da4ae6b2ef, type: 2}
extents: extents:
m_Left: -6 m_Left: -10
m_Right: 6 m_Right: 10
m_Top: 4 m_Top: 4
m_Bottom: -4 m_Bottom: -4
lerpAmount: 0.95
--- !u!114 &1173812010 --- !u!114 &1173812010
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -677,34 +707,19 @@ MonoBehaviour:
m_GameObject: {fileID: 1173812004} m_GameObject: {fileID: 1173812004}
m_Enabled: 1 m_Enabled: 1
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ee402da2b1ce44634affa14c193a5d3b, type: 3} m_Script: {fileID: 11500000, guid: 1226902ebd2674aefa463e6dc0e75ad7, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
cam: {fileID: 502054319}
distance: 30
lookAt: {fileID: 660289116}
--- !u!114 &1173812011
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1173812004}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 916a2fb9e08e14be9bd626096bc2ac0b, type: 3}
m_Name:
m_EditorClassIdentifier:
weapon: {fileID: 11400000, guid: 0b18e2c03a96a4ba3b3a76f5fddfcbdf, type: 2}
bulletPool: {fileID: 1395215962} bulletPool: {fileID: 1395215962}
weapon: {fileID: 11400000, guid: 0b18e2c03a96a4ba3b3a76f5fddfcbdf, type: 2}
bulletPos: {fileID: 1222495243} bulletPos: {fileID: 1222495243}
input: {fileID: 1173812012}
OnFire: OnFire:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
OnBulletCollide: OnBulletCollide:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
numTargets: 4
--- !u!114 &1173812012 --- !u!114 &1173812012
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -717,7 +732,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c48c9af9318404dc095b40b0731334c8, type: 3} m_Script: {fileID: 11500000, guid: c48c9af9318404dc095b40b0731334c8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
--- !u!114 &1173812013 --- !u!114 &1173812014
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
@ -726,61 +741,27 @@ MonoBehaviour:
m_GameObject: {fileID: 1173812004} m_GameObject: {fileID: 1173812004}
m_Enabled: 1 m_Enabled: 1
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3d3bf172892f141e5a18148a06f708cb, type: 3} m_Script: {fileID: 11500000, guid: ea329ed41d9c4422aa3f3b3773421383, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
cam: {fileID: 502054319} lengthInSeconds: 0.1
cursor: {fileID: 660289116} --- !u!114 &1173812015
maxTargets: 100 MonoBehaviour:
targetSize: 1 m_ObjectHideFlags: 0
collideWith: m_CorrespondingSourceObject: {fileID: 0}
serializedVersion: 2 m_PrefabInstance: {fileID: 0}
m_Bits: 128 m_PrefabAsset: {fileID: 0}
OnTargetFound: m_GameObject: {fileID: 1173812004}
m_PersistentCalls: m_Enabled: 1
m_Calls: m_EditorHideFlags: 0
- m_Target: {fileID: 710724063} m_Script: {fileID: 11500000, guid: 78c7d8f0c42e149ce8006c1a6f7b3ee3, type: 3}
m_TargetAssemblyTypeName: TargetLockIcon, Assembly-CSharp m_Name:
m_MethodName: SpawnIcon m_EditorClassIdentifier:
m_Mode: 0 healthMarkers:
m_Arguments: - {fileID: 1581716072}
m_ObjectArgument: {fileID: 0} - {fileID: 1611642542}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine - {fileID: 728836294}
m_IntArgument: 0 polygon: {fileID: 1639649353}
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
OnTargetLock:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 710724063}
m_TargetAssemblyTypeName: TargetLockIcon, Assembly-CSharp
m_MethodName: ClearIcons
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 1173812011}
m_TargetAssemblyTypeName: FireAtTargets, Assembly-CSharp
m_MethodName: Fire
m_Mode: 0
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
shootOnBeat: 16
noTargetLengthInBeats: 8
beatOffset: 2
--- !u!1 &1215971662 --- !u!1 &1215971662
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -825,7 +806,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 5 m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1222495242 --- !u!1 &1222495242
GameObject: GameObject:
@ -851,7 +832,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1222495242} m_GameObject: {fileID: 1222495242}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: -0.62, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 1173812008} m_Father: {fileID: 1173812008}
@ -903,18 +884,6 @@ MonoBehaviour:
m_StringArgument: m_StringArgument:
m_BoolArgument: 0 m_BoolArgument: 0
m_CallState: 2 m_CallState: 2
- m_Target: {fileID: 1173812013}
m_TargetAssemblyTypeName: TargetLockOn, Assembly-CSharp
m_MethodName: OnBeat
m_Mode: 0
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!4 &1250063708 --- !u!4 &1250063708
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -927,7 +896,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 7 m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1250063710 --- !u!114 &1250063710
MonoBehaviour: MonoBehaviour:
@ -976,7 +945,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 3 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1395215962 --- !u!114 &1395215962
MonoBehaviour: MonoBehaviour:
@ -993,6 +962,244 @@ MonoBehaviour:
numObjects: 3000 numObjects: 3000
prefab: {fileID: 1738226812227614580, guid: e084e082567284f79a41423c4fe1adab, type: 3} prefab: {fileID: 1738226812227614580, guid: e084e082567284f79a41423c4fe1adab, type: 3}
numToSpawnPerFrame: 10 numToSpawnPerFrame: 10
--- !u!1 &1558812835
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1558812837}
- component: {fileID: 1558812836}
m_Layer: 0
m_Name: PostProcessing
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1558812836
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1558812835}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3}
m_Name:
m_EditorClassIdentifier:
isGlobal: 1
priority: 0
blendDistance: 0
weight: 1
sharedProfile: {fileID: 11400000, guid: 7cf7c4ef7a9fb45c0b93cb37aa1b1917, type: 2}
--- !u!4 &1558812837
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1558812835}
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: []
m_Father: {fileID: 0}
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1581716069
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1581716070}
- component: {fileID: 1581716073}
- component: {fileID: 1581716072}
- component: {fileID: 1581716071}
m_Layer: 6
m_Name: Sphere
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1581716070
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1581716069}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -1, y: -1.05, z: -1.641}
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
m_Children: []
m_Father: {fileID: 1173812008}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!135 &1581716071
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1581716069}
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!23 &1581716072
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1581716069}
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_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 0cef45e7a8ed5434c82d2291106a3fff, 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
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &1581716073
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1581716069}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &1611642539
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1611642540}
- component: {fileID: 1611642543}
- component: {fileID: 1611642542}
- component: {fileID: 1611642541}
m_Layer: 6
m_Name: Sphere (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1611642540
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1611642539}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: -1.05, z: -1.641}
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
m_Children: []
m_Father: {fileID: 1173812008}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!135 &1611642541
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1611642539}
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!23 &1611642542
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1611642539}
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_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 0cef45e7a8ed5434c82d2291106a3fff, 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
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &1611642543
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1611642539}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &1639649350 --- !u!1 &1639649350
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1088,104 +1295,3 @@ MeshFilter:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1639649350} m_GameObject: {fileID: 1639649350}
m_Mesh: {fileID: -5495902117074765545, guid: c2fbec7900214e24ea3cad9629da11c2, type: 3} m_Mesh: {fileID: -5495902117074765545, guid: c2fbec7900214e24ea3cad9629da11c2, type: 3}
--- !u!1 &1942400133
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1942400137}
- component: {fileID: 1942400136}
- component: {fileID: 1942400135}
- component: {fileID: 1942400134}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1942400134
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1942400133}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &1942400135
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1942400133}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 1920, y: 1080}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 1
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
m_PresetInfoIsWorld: 0
--- !u!223 &1942400136
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1942400133}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 0
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 25
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!224 &1942400137
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1942400133}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 660289116}
- {fileID: 710724061}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}

View File

@ -0,0 +1,99 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-3395606675299854484
MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0b2db86121404754db890f4c8dfe81b2, type: 3}
m_Name: Bloom
m_EditorClassIdentifier:
active: 1
m_AdvancedMode: 0
threshold:
m_OverrideState: 1
m_Value: 1
min: 0
intensity:
m_OverrideState: 1
m_Value: 2
min: 0
scatter:
m_OverrideState: 0
m_Value: 0.7
min: 0
max: 1
clamp:
m_OverrideState: 0
m_Value: 65472
min: 0
tint:
m_OverrideState: 0
m_Value: {r: 1, g: 1, b: 1, a: 1}
hdr: 0
showAlpha: 0
showEyeDropper: 1
highQualityFiltering:
m_OverrideState: 0
m_Value: 0
skipIterations:
m_OverrideState: 0
m_Value: 1
min: 0
max: 16
dirtTexture:
m_OverrideState: 0
m_Value: {fileID: 0}
dirtIntensity:
m_OverrideState: 0
m_Value: 0
min: 0
--- !u!114 &-142191583213071455
MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 29fa0085f50d5e54f8144f766051a691, type: 3}
m_Name: FilmGrain
m_EditorClassIdentifier:
active: 1
m_AdvancedMode: 0
type:
m_OverrideState: 1
m_Value: 0
intensity:
m_OverrideState: 1
m_Value: 1
min: 0
max: 1
response:
m_OverrideState: 0
m_Value: 0.8
min: 0
max: 1
texture:
m_OverrideState: 0
m_Value: {fileID: 0}
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3}
m_Name: PostProcessing Profile
m_EditorClassIdentifier:
components:
- {fileID: -3395606675299854484}
- {fileID: -142191583213071455}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7cf7c4ef7a9fb45c0b93cb37aa1b1917
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -11,13 +11,13 @@ using Debug = UnityEngine.Debug;
public class AudioBeatManager : MonoBehaviour, IAudioBeatManager public class AudioBeatManager : MonoBehaviour, IAudioBeatManager
{ {
[SerializeField] private float bpm; [SerializeField] private float bpm;
private float _secPerBeat;
public float TimeBetweenBeats => _secPerBeat; public float TimeBetweenBeats => _secPerBeat;
private float _bps;
private int _currentBeat = 0; private int _currentBeat = 0;
private float _timer; private float _timer;
private float _secPerBeat;
[SerializeField] [FormerlySerializedAs("OnBeat")] [SerializeField] [FormerlySerializedAs("OnBeat")]
private IntEvent _onBeat; private IntEvent _onBeat;
@ -34,7 +34,6 @@ public class AudioBeatManager : MonoBehaviour, IAudioBeatManager
private void Awake() private void Awake()
{ {
_bps = bpm / 60f;
_secPerBeat = 60f / bpm; _secPerBeat = 60f / bpm;
_timer = 0; _timer = 0;
RuntimeManager.CoreSystem.getMasterChannelGroup(out _channelGroup); RuntimeManager.CoreSystem.getMasterChannelGroup(out _channelGroup);

View File

@ -33,7 +33,7 @@ namespace Weapons.Editor
AddRelativeProperty( property, "numToSpawn", space, ref currentPos); AddRelativeProperty( property, "numToSpawn", space, ref currentPos);
AddRelativeProperty( property, "spawnDir", space, ref currentPos); AddRelativeProperty( property, "spawnDir", space, ref currentPos);
AddRelativeProperty( property, "spawnPlane", space, ref currentPos);
AddRelativeProperty( property, "surfaceOnly", space, ref currentPos); AddRelativeProperty( property, "surfaceOnly", space, ref currentPos);
AddRelativeProperty(property, "offset", space, ref currentPos); AddRelativeProperty(property, "offset", space, ref currentPos);
@ -61,6 +61,7 @@ namespace Weapons.Editor
AddRelativeProperty(property, "numSides", space, ref currentPos); AddRelativeProperty(property, "numSides", space, ref currentPos);
AddRelativeProperty(property, "numPerSide", space, ref currentPos); AddRelativeProperty(property, "numPerSide", space, ref currentPos);
AddRelativeProperty( property, "radius", space, ref currentPos); AddRelativeProperty( property, "radius", space, ref currentPos);
AddRelativeProperty(property, "flipVertical", space, ref currentPos);
} }
EditorGUI.indentLevel--; EditorGUI.indentLevel--;

View File

@ -17,7 +17,9 @@ public class EnemyAppearBehaviour : BaseBulletBehaviour
bullet.localScale = Vector3.zero; bullet.localScale = Vector3.zero;
bullet.localPosition = new Vector3(pos.x, pos.y, zPos); bullet.localPosition = new Vector3(pos.x, pos.y, zPos);
DOTween.Sequence() DOTween.Sequence()
.Append(bullet.DOMove(pos, moveInDuration).SetEase(Ease.OutQuint)) //.Append(bullet.DOMove(pos, moveInDuration).SetEase(Ease.OutQuint))
.Insert(scaleUpDelay, bullet.DORotate(new Vector3(0,0,45), moveInDuration/2f))
.Insert(scaleUpDelay + moveInDuration/2f, bullet.DORotate(Vector3.zero, moveInDuration/2f))
.Insert(scaleUpDelay, bullet.DOScale(Vector3.one * size, scaleUpDuration).SetEase(Ease.OutQuint)); .Insert(scaleUpDelay, bullet.DOScale(Vector3.one * size, scaleUpDuration).SetEase(Ease.OutQuint));
} }
} }

View File

@ -0,0 +1,30 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Utils;
public class HitStopOnDie : MonoBehaviour
{
[SerializeField] private float lengthInSeconds = 0.1f;
private WaitForSecondsRealtime wait;
private void Awake()
{
wait = new WaitForSecondsRealtime(lengthInSeconds);
}
public void OnDie()
{
Wait().Run();
}
private IEnumerator Wait()
{
//Time.timeScale = 0;
yield return wait;
Time.timeScale = 1;
}
}

View File

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

View File

@ -9,34 +9,18 @@ public class LoseLife : MonoBehaviour
{ {
[SerializeField] private Renderer[] healthMarkers; [SerializeField] private Renderer[] healthMarkers;
[SerializeField] private Renderer polygon; [SerializeField] private Renderer polygon;
[SerializeField] private WeaponHandler weapon;
private Color[] _markerColors;
private EntityHealth _health; private EntityHealth _health;
private Color _polygonColor;
private Color _polygonColorClear;
private void Awake() private void Awake()
{ {
_health = GetComponent<EntityHealth>(); _health = GetComponent<EntityHealth>();
_polygonColor = polygon.material.color;
_polygonColorClear = _polygonColor;
_polygonColorClear.a = 0;
_markerColors = new Color[healthMarkers.Length];
for (int i = 0; i < healthMarkers.Length; i++)
{
_markerColors[i] = healthMarkers[i].material.color;
_markerColors[i].a = 0;
}
} }
public void LifeLost(int livesLeft) public void LifeLost(int livesLeft)
{ {
healthMarkers[livesLeft].transform.DOScale(Vector3.one * 5f, 1f).SetEase(Ease.InQuint).SetUpdate(true); healthMarkers[livesLeft].transform.DOScale(Vector3.zero, 1f).SetEase(Ease.InBack).SetUpdate(true);
healthMarkers[livesLeft].material.DOColor(_markerColors[livesLeft], 1f).SetDelay(0.25f).SetUpdate(true);
_health.enabled = false; _health.enabled = false;
weapon.enabled = false;
var timeVal = Time.timeScale; var timeVal = Time.timeScale;
Time.timeScale = 0; Time.timeScale = 0;
WaitUtils.Wait(0.1f, false, () => Time.timeScale = timeVal); WaitUtils.Wait(0.1f, false, () => Time.timeScale = timeVal);
@ -44,13 +28,12 @@ public class LoseLife : MonoBehaviour
var sequence = DOTween.Sequence(); var sequence = DOTween.Sequence();
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
{ {
sequence.Append(polygon.material.DOColor(_polygonColorClear, 0.2f).SetUpdate(true)); sequence.Append(polygon.material.DOFloat(1,"_FlashAmount", 0.2f).SetUpdate(true));
sequence.Append(polygon.material.DOColor(_polygonColor, 0.2f).SetUpdate(true)); sequence.Append(polygon.material.DOFloat(0,"_FlashAmount", 0.2f).SetUpdate(true));
} }
sequence.Play().OnComplete(() => sequence.Play().OnComplete(() =>
{ {
weapon.enabled = true;
_health.enabled = true; _health.enabled = true;
}); });
} }

View File

@ -9,15 +9,18 @@ using Random = UnityEngine.Random;
namespace Weapons.Spawning namespace Weapons.Spawning
{ {
public enum SpawnType { Circle, Square, Polygon, Composite } public enum SpawnType { Circle, Square, Polygon, Composite }
public enum SpawnPlane { XY, XZ }
public enum SpawnDir { None, Randomised, Spherised, Directional} public enum SpawnDir { None, Randomised, Spherised, Directional}
[Serializable] [Serializable]
public struct SpawnZone public struct SpawnZone
{ {
[SerializeField] private int numToSpawn; [SerializeField] private int numToSpawn;
[SerializeField] private Vector2 offset; [SerializeField] private Vector3 offset;
[SerializeField] private SpawnType spawnType; [SerializeField] private SpawnType spawnType;
[SerializeField] private SpawnDir spawnDir; [SerializeField] private SpawnDir spawnDir;
[SerializeField] private SpawnPlane spawnPlane;
[SerializeField] private float width; [SerializeField] private float width;
[SerializeField] private float height; [SerializeField] private float height;
@ -27,6 +30,7 @@ namespace Weapons.Spawning
[SerializeField] private int numSides; [SerializeField] private int numSides;
[SerializeField] private int numPerSide; [SerializeField] private int numPerSide;
[SerializeField] private bool flipVertical;
[SerializeField] private float radius; [SerializeField] private float radius;
[SerializeField, Range(0, 360)] private float arc; [SerializeField, Range(0, 360)] private float arc;
@ -37,7 +41,7 @@ namespace Weapons.Spawning
public int NumToSpawn => numToSpawn; public int NumToSpawn => numToSpawn;
public void GetPoint(Transform transform, Action<Vector2, Vector2> onGetPoint) public void GetPoint(Transform transform, Action<Vector3, Vector3> onGetPoint)
{ {
switch (spawnType) switch (spawnType)
{ {
@ -58,7 +62,7 @@ namespace Weapons.Spawning
} }
} }
private void SpawnPoly(Transform transform, Action<Vector2, Vector2> onGetPoint) private void SpawnPoly(Transform transform, Action<Vector3, Vector3> onGetPoint)
{ {
var points = new Vector2[numSides]; var points = new Vector2[numSides];
for (int i = 0; i < numSides; i++) for (int i = 0; i < numSides; i++)
@ -81,10 +85,20 @@ namespace Weapons.Spawning
{ {
var t = j / (float) numPerSide; var t = j / (float) numPerSide;
t += (1f / numPerSide)/2f; t += (1f / numPerSide)/2f;
var point = Vector2.Lerp(points[i], points[next], t); var point = Vector3.Lerp(points[i], points[next], t);
if (flipVertical)
point.y = 1 - point.y;
point *= radius; point *= radius;
var dir = Vector2.up; if (spawnPlane == SpawnPlane.XZ)
{
point.z = point.y;
point.y = 0;
}
var dir = Vector3.up;
if (spawnDir == SpawnDir.Directional) if (spawnDir == SpawnDir.Directional)
dir = direction; dir = direction;
else if (spawnDir == SpawnDir.Spherised) else if (spawnDir == SpawnDir.Spherised)
@ -92,12 +106,17 @@ namespace Weapons.Spawning
else if (spawnDir == SpawnDir.Randomised) else if (spawnDir == SpawnDir.Randomised)
dir = Random.insideUnitCircle.normalized; dir = Random.insideUnitCircle.normalized;
if (!surfaceOnly)
point = Vector2.Lerp(point, Vector3.zero, Random.Range(0, 1f));
onGetPoint?.Invoke(point, dir); onGetPoint?.Invoke(point, dir);
} }
} }
} }
private void SpawnComposite(Transform transform, Action<Vector2, Vector2> onGetPoint) private void SpawnComposite(Transform transform, Action<Vector3, Vector3> onGetPoint)
{ {
for (int i = 0; i < numToSpawn; i++) for (int i = 0; i < numToSpawn; i++)
{ {
@ -105,13 +124,14 @@ namespace Weapons.Spawning
} }
} }
private void SpawnCircle(Transform transform, Action<Vector2, Vector2> onGetPoint) private void SpawnCircle(Transform transform, Action<Vector3, Vector3> onGetPoint)
{ {
Assert.IsNotNull(onGetPoint); Assert.IsNotNull(onGetPoint);
for (int i = 0; i < numToSpawn; i++) for (int i = 0; i < numToSpawn; i++)
{ {
Vector2 point; var point = Vector3.zero;
if (!evenDistribution) if (!evenDistribution)
{ {
var angle = (Random.Range(-arc / 2f, arc / 2f) + 90 - transform.eulerAngles.y) * Mathf.Deg2Rad; var angle = (Random.Range(-arc / 2f, arc / 2f) + 90 - transform.eulerAngles.y) * Mathf.Deg2Rad;
@ -135,8 +155,13 @@ namespace Weapons.Spawning
} }
if (spawnPlane == SpawnPlane.XZ)
{
point.z = point.y;
point.y = 0;
}
var dir = Vector2.up; var dir = Vector3.up;
if (spawnDir == SpawnDir.Spherised || spawnDir == SpawnDir.Directional) if (spawnDir == SpawnDir.Spherised || spawnDir == SpawnDir.Directional)
dir = point.normalized; dir = point.normalized;
else if (spawnDir == SpawnDir.Randomised) else if (spawnDir == SpawnDir.Randomised)
@ -147,13 +172,13 @@ namespace Weapons.Spawning
} }
} }
private void SpawnSquare(Transform transform, Action<Vector2, Vector2> onGetPoint) private void SpawnSquare(Transform transform, Action<Vector3, Vector3> onGetPoint)
{ {
Assert.IsNotNull(onGetPoint); Assert.IsNotNull(onGetPoint);
for (int i = 0; i < numToSpawn; i++) for (int i = 0; i < numToSpawn; i++)
{ {
var point = new Vector2 var point = new Vector3
{ {
x = Random.Range(-.5f, .5f), x = Random.Range(-.5f, .5f),
y = Random.Range(-.5f, .5f) y = Random.Range(-.5f, .5f)
@ -168,14 +193,18 @@ namespace Weapons.Spawning
point.x *= width; point.x *= width;
point.y *= height; point.y *= height;
if (spawnPlane == SpawnPlane.XZ)
{
point.z = point.y;
point.y = 0;
}
var dir = Vector2.up; var dir = Vector3.up;
if (spawnDir == SpawnDir.Spherised || spawnDir == SpawnDir.Directional) if (spawnDir == SpawnDir.Spherised || spawnDir == SpawnDir.Directional)
dir = point.normalized; dir = point.normalized;
else if (spawnDir == SpawnDir.Randomised) else if (spawnDir == SpawnDir.Randomised)
dir = Random.insideUnitCircle.normalized; dir = Random.insideUnitCircle.normalized;
onGetPoint(point + offset, dir); onGetPoint(point + offset, dir);
} }
} }
@ -212,9 +241,9 @@ namespace Weapons.Spawning
Gizmos.color = color; Gizmos.color = color;
SpawnCircle(transform, (point, dir) => SpawnCircle(transform, (point, dir) =>
{ {
Gizmos.DrawSphere(new Vector3(point.x, 0, point.y), 0.25f); Gizmos.DrawSphere( transform.position + point, 0.25f);
if (color.a > 0.5f) if (color.a > 0.5f)
Gizmos.DrawRay(new Vector3(point.x, 0, point.y), new Vector3(dir.x, 0, dir.y)); Gizmos.DrawRay( transform.position + point, new Vector3(dir.x, 0, dir.y));
}); });
} }
@ -223,9 +252,9 @@ namespace Weapons.Spawning
Gizmos.color = color; Gizmos.color = color;
SpawnPoly(transform, (point, dir) => SpawnPoly(transform, (point, dir) =>
{ {
Gizmos.DrawSphere(transform.position + new Vector3(point.x, 0, point.y), 0.25f); Gizmos.DrawSphere(transform.position + point, 0.25f);
if (color.a > 0.5f) if (color.a > 0.5f)
Gizmos.DrawRay(transform.position + new Vector3(point.x, 0, point.y), new Vector3(dir.x, 0, dir.y)); Gizmos.DrawRay(transform.position + point, new Vector3(dir.x, 0, dir.y));
}); });
} }
@ -234,9 +263,9 @@ namespace Weapons.Spawning
Gizmos.color = color; Gizmos.color = color;
SpawnSquare(transform, (point, dir) => SpawnSquare(transform, (point, dir) =>
{ {
Gizmos.DrawSphere(new Vector3(point.x, 0, point.y), 0.25f); Gizmos.DrawSphere(transform.position + point, 0.25f);
if (color.a > 0.5f) if (color.a > 0.5f)
Gizmos.DrawRay(new Vector3(point.x, 0, point.y), new Vector3(dir.x, 0, dir.y)); Gizmos.DrawRay(transform.position + point, new Vector3(dir.x, 0, dir.y));
}); });
} }
} }

View File

@ -60,8 +60,13 @@ public class TargetLockOn : MonoBehaviour
for (int i = 0; i < numHits; i++) for (int i = 0; i < numHits; i++)
{ {
if (_targets.Contains(_colliders[i].transform)) continue; if (_targets.Contains(_colliders[i].transform)) continue;
_targets.Add(_colliders[i].transform); if (_targets.Count < maxTargets)
OnTargetFound?.Invoke(_colliders[i].transform); {
_targets.Add(_colliders[i].transform);
OnTargetFound?.Invoke(_colliders[i].transform);
}
if (_targets.Count >= maxTargets) if (_targets.Count >= maxTargets)
break; break;

View File

@ -35,6 +35,7 @@ public class Weapon : ScriptableObject
private struct Bullet private struct Bullet
{ {
public Vector3 Direction; public Vector3 Direction;
public Vector3 PrevPos;
public float Speed; public float Speed;
public float Lifetime; public float Lifetime;
public bool IsAlive; public bool IsAlive;
@ -53,7 +54,6 @@ public class Weapon : ScriptableObject
[SerializeField] private SpawnZone zone; [SerializeField] private SpawnZone zone;
[SerializeField] private bool manualFire; [SerializeField] private bool manualFire;
[SerializeField] private BaseBulletBehaviour behaviour; [SerializeField] private BaseBulletBehaviour behaviour;
[SerializeField] private bool useDeltaTime;
private List<Bullet> _bullets; private List<Bullet> _bullets;
private List<Transform> _bulletTransforms; private List<Transform> _bulletTransforms;
@ -75,13 +75,20 @@ public class Weapon : ScriptableObject
_job = new BulletMoveJob(); _job = new BulletMoveJob();
_bullets = new List<Bullet>(); _bullets = new List<Bullet>();
_bulletTransforms = new List<Transform>(); _bulletTransforms = new List<Transform>();
_currentCooldown = fireRate * Time.deltaTime; _currentCooldown = fireRate;
} }
public void Update() public void Update()
{ {
_currentCooldown += Time.deltaTime; _currentCooldown += Time.deltaTime;
for (int i = 0; i < _bulletTransforms.Count; i++)
{
_currentBullet = _bullets[i];
_currentBullet.PrevPos = _bulletTransforms[i].position;
_bullets[i] = _currentBullet;
}
_job.DeltaTime = Time.deltaTime; _job.DeltaTime = Time.deltaTime;
_job.Bullets = _bullets.ToNativeArray(Allocator.Persistent); _job.Bullets = _bullets.ToNativeArray(Allocator.Persistent);
@ -101,9 +108,11 @@ public class Weapon : ScriptableObject
_currentBullet.Lifetime -= Time.deltaTime; _currentBullet.Lifetime -= Time.deltaTime;
if (_currentBullet.Lifetime <= 0) if (_currentBullet.Lifetime <= 0)
_currentBullet.IsAlive = false; _currentBullet.IsAlive = false;
_bullets[i] = _currentBullet; _bullets[i] = _currentBullet;
if (_bullets[i].IsAlive) continue; if (_bullets[i].IsAlive && _bulletTransforms[i].gameObject.activeSelf) continue;
_bulletTransforms[i].gameObject.SetActive(false); _bulletTransforms[i].gameObject.SetActive(false);
_pool.ReturnObject(_bulletTransforms[i], _bullets[i].Idx); _pool.ReturnObject(_bulletTransforms[i], _bullets[i].Idx);
@ -124,7 +133,7 @@ public class Weapon : ScriptableObject
if (!_currentTransform.gameObject.activeSelf || !_currentBullet.IsAlive) continue; if (!_currentTransform.gameObject.activeSelf || !_currentBullet.IsAlive) continue;
// if it has hit something // if it has hit something
if (CheckCollision(_currentTransform, _currentTransform.localScale.x, out var numHits)) if (CheckCollision(_currentTransform, _currentBullet.PrevPos, _currentTransform.localScale.x, out var numHits))
{ {
// send the event // send the event
BulletCollision?.Invoke(_currentTransform.position); BulletCollision?.Invoke(_currentTransform.position);
@ -138,6 +147,10 @@ public class Weapon : ScriptableObject
// deactivate the bullet // deactivate the bullet
_currentBullet.IsAlive = false; _currentBullet.IsAlive = false;
_currentTransform.gameObject.SetActive(false);
_pool.ReturnObject(_currentTransform, _currentBullet.Idx);
_bullets.RemoveAt(i);
_bulletTransforms.RemoveAt(i);
} }
// apply the changes we made // apply the changes we made
@ -145,7 +158,7 @@ public class Weapon : ScriptableObject
} }
} }
private bool CheckCollision(Transform instance, float size, out int numHits) private bool CheckCollision(Transform instance, Vector3 prevPos, float size, out int numHits)
{ {
numHits = 0; numHits = 0;
@ -153,7 +166,7 @@ public class Weapon : ScriptableObject
if (!instance.gameObject.activeSelf) return false; if (!instance.gameObject.activeSelf) return false;
// use the non allocating version so we don't have to allocate memory for every bullet // use the non allocating version so we don't have to allocate memory for every bullet
numHits = Physics.OverlapSphereNonAlloc(instance.position, size/2f, _results, collidesWith, QueryTriggerInteraction.Collide); numHits = Physics.OverlapCapsuleNonAlloc(prevPos, instance.position, size/2f, _results, collidesWith, QueryTriggerInteraction.Collide);
return numHits > 0; return numHits > 0;
} }
@ -165,7 +178,7 @@ public class Weapon : ScriptableObject
if (!manualFire) if (!manualFire)
{ {
if (_currentCooldown > fireRate * (useDeltaTime ? Time.deltaTime : 1)) return false; if (_currentCooldown < fireRate) return false;
_currentCooldown = 0; _currentCooldown = 0;
} }
@ -192,12 +205,11 @@ public class Weapon : ScriptableObject
// enable the bullet // enable the bullet
bullet.gameObject.SetActive(true); bullet.gameObject.SetActive(true);
var newPos = new Vector3(point.x, point.y); var newPos = point;
newPos = Vector3.Lerp(newPos, Vector3.zero, Random.Range(0, 1f));
bullet.position = transform.position + newPos; bullet.position = transform.position + newPos;
// point the bullet in the right direction // point the bullet in the right direction
bullet.forward = new Vector3(dir.x, dir.y); bullet.forward = dir;
bullet.transform.localScale = Vector3.one * bulletSize.EvaluateMinMaxCurve(); bullet.transform.localScale = Vector3.one * bulletSize.EvaluateMinMaxCurve();
behaviour.DoBehaviour(bullet, bulletSize.EvaluateMinMaxCurve(), bullet.position); behaviour.DoBehaviour(bullet, bulletSize.EvaluateMinMaxCurve(), bullet.position);
if (zone.SpawnDir != SpawnDir.Spherised) if (zone.SpawnDir != SpawnDir.Spherised)
@ -214,6 +226,7 @@ public class Weapon : ScriptableObject
_bullets.Add(new Bullet _bullets.Add(new Bullet
{ {
Direction = bullet.forward, Direction = bullet.forward,
PrevPos = bullet.position,
IsAlive = true, IsAlive = true,
Speed = bulletSpeed.EvaluateMinMaxCurve(), Speed = bulletSpeed.EvaluateMinMaxCurve(),
Lifetime = bulletLifetime.EvaluateMinMaxCurve(), Lifetime = bulletLifetime.EvaluateMinMaxCurve(),
@ -232,10 +245,16 @@ public class Weapon : ScriptableObject
color.a = Selection.activeObject == this ? 1 : 0.05f; color.a = Selection.activeObject == this ? 1 : 0.05f;
zone.DrawGizmos(color, transform); zone.DrawGizmos(color, transform);
Gizmos.color = Color.white;
if (_bullets == null) return; if (_bullets == null) return;
foreach (var b in _bulletTransforms.Where(b => b != null)) for (int i = 0; i < _bulletTransforms.Count; i++)
{ {
Gizmos.DrawWireSphere(b.position, b.localScale.x/2f * bulletSize.EvaluateMinMaxCurve()); var b = _bulletTransforms[i];
if (b == null) continue;
Gizmos.DrawSphere(b.position, b.localScale.x/2f * bulletSize.EvaluateMinMaxCurve());
Gizmos.DrawSphere(_bullets[i].PrevPos, b.localScale.x/2f * bulletSize.EvaluateMinMaxCurve());
Gizmos.DrawLine(b.position, _bullets[i].PrevPos);
} }
#endif #endif
} }

View File

@ -12,6 +12,7 @@ public class WeaponHandler : MonoBehaviour
[SerializeField] private UnityEvent OnFire; [SerializeField] private UnityEvent OnFire;
[SerializeField] private Vector3Event OnBulletCollide; [SerializeField] private Vector3Event OnBulletCollide;
private bool _canShoot = false; private bool _canShoot = false;
private void Awake() private void Awake()

View File

@ -7,9 +7,10 @@ Shader "custom/ship"
{ {
[HDR] _Color1("Color 1", Color) = (1,1,1,1) [HDR] _Color1("Color 1", Color) = (1,1,1,1)
[HDR] _Color2("Color 2", Color) = (1,1,1,1) [HDR] _Color2("Color 2", Color) = (1,1,1,1)
[HDR] _FlashColor("Flash Color", Color) = (1.1,1.1,1.1,1)
_FadeStrength("Fade Strength", Float) = 0.1 _FadeStrength("Fade Strength", Float) = 0.1
_VertexScale("Vertex Scale", Float) = 0 _VertexScale("Vertex Scale", Float) = 0
_FlashAmount("Flash Amount", Float) = 0
_NoiseMap("Noise Map", 2D) = "black" _NoiseMap("Noise Map", 2D) = "black"
} }
@ -43,8 +44,10 @@ Shader "custom/ship"
float4 _Color1; float4 _Color1;
float4 _Color2; float4 _Color2;
float4 _FlashColor;
float _VertexScale; float _VertexScale;
float _FadeStrength; float _FadeStrength;
float _FlashAmount;
// This macro declares _BaseMap as a Texture2D object. // This macro declares _BaseMap as a Texture2D object.
TEXTURE2D(_BaseMap); TEXTURE2D(_BaseMap);
@ -92,7 +95,8 @@ Shader "custom/ship"
float2 p = -1.0+2.0*IN.positionHCS.xy/res.xy; float2 p = -1.0+2.0*IN.positionHCS.xy/res.xy;
float t = length(p); float t = length(p);
return lerp(_Color1,_Color2,t * _FadeStrength); float4 shaderColor = lerp(_Color1,_Color2,t * _FadeStrength);
return lerp(shaderColor, _FlashColor, _FlashAmount);
} }
ENDHLSL ENDHLSL
} }

View File

@ -64,10 +64,10 @@ MonoBehaviour:
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
m_ConstantMin: 0 m_ConstantMin: 20
m_ConstantMax: 0 m_ConstantMax: 30
bulletLifetime: bulletLifetime:
m_Mode: 3 m_Mode: 0
m_CurveMultiplier: 0 m_CurveMultiplier: 0
m_CurveMin: m_CurveMin:
serializedVersion: 2 serializedVersion: 2
@ -82,7 +82,7 @@ MonoBehaviour:
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
m_ConstantMin: 15 m_ConstantMin: 15
m_ConstantMax: 20 m_ConstantMax: 5
bulletSize: bulletSize:
m_Mode: 0 m_Mode: 0
m_CurveMultiplier: 0 m_CurveMultiplier: 0
@ -107,18 +107,19 @@ MonoBehaviour:
accuracy: 0 accuracy: 0
zone: zone:
numToSpawn: 10 numToSpawn: 10
offset: {x: 0, y: 0} offset: {x: 0, y: 0, z: 0}
spawnType: 0 spawnType: 0
spawnDir: 0 spawnDir: 0
spawnPlane: 1
width: 0 width: 0
height: 0 height: 0
surfaceOnly: 0 surfaceOnly: 0
evenDistribution: 0 evenDistribution: 0
numSides: 5 numSides: 5
numPerSide: 80 numPerSide: 10
radius: 15 flipVertical: 0
radius: 10
arc: 360 arc: 360
composite: [] composite: []
manualFire: 1 manualFire: 1
behaviour: {fileID: 11400000, guid: bb1cb2a77c68c42d4900953d18b23a49, type: 2} behaviour: {fileID: 11400000, guid: bb1cb2a77c68c42d4900953d18b23a49, type: 2}
useDeltaTime: 0

View File

@ -12,5 +12,5 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8d6fb9bb806b4efcbd8aefb293811842, type: 3} m_Script: {fileID: 11500000, guid: 8d6fb9bb806b4efcbd8aefb293811842, type: 3}
m_Name: PlayerBulletScale m_Name: PlayerBulletScale
m_EditorClassIdentifier: m_EditorClassIdentifier:
scaleTime: 0.5 scaleTime: 0.25
scaleEase: 15 scaleEase: 15

View File

@ -104,7 +104,7 @@ MonoBehaviour:
collidesWith: collidesWith:
serializedVersion: 2 serializedVersion: 2
m_Bits: 128 m_Bits: 128
accuracy: 0 accuracy: 5
zone: zone:
numToSpawn: 1 numToSpawn: 1
offset: {x: 0, y: 0} offset: {x: 0, y: 0}
@ -116,8 +116,9 @@ MonoBehaviour:
evenDistribution: 1 evenDistribution: 1
numSides: 3 numSides: 3
numPerSide: 5 numPerSide: 5
flipVertical: 1
radius: 1.25 radius: 1.25
arc: 360 arc: 360
composite: [] composite: []
manualFire: 1 manualFire: 0
behaviour: {fileID: 11400000, guid: 20de5bc0e86bc4037a85f6c46356a227, type: 2} behaviour: {fileID: 11400000, guid: 20de5bc0e86bc4037a85f6c46356a227, type: 2}