Merge pull request #60 from dnutiu/camera-shake

Add camera shake
This commit is contained in:
Denis-Cosmin Nutiu 2019-07-21 18:13:31 +03:00 committed by GitHub
commit 0b4796e6fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 714 additions and 354 deletions

View file

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

View file

@ -0,0 +1,66 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &4734973651968032115
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4734973651968032113}
- component: {fileID: 4734973651968032114}
m_Layer: 10
m_Name: CameraConfiner
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4734973651968032113
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4734973651968032115}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 7.78, y: -0.87, z: -9.911216}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!60 &4734973651968032114
PolygonCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4734973651968032115}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0, y: 0}
oldSize: {x: 0, y: 0}
newSize: {x: 0, y: 0}
adaptiveTilingThreshold: 0
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
m_Points:
m_Paths:
- - {x: 5.054474, y: 3.8528316}
- {x: -8.78912, y: 3.8268971}
- {x: -8.739267, y: -21.093697}
- {x: 24.250868, y: -21.10404}
- {x: 24.203676, y: 3.9160552}
- {x: 23.120907, y: 3.9196432}
- {x: 23.107159, y: 3.9179695}
- {x: 12.502958, y: 3.92474}

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b753f30f50e804ee1ba8e3ab7eae2bf9
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,122 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &485484359815033065
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 485484359815032853}
- component: {fileID: 485484359815033066}
- component: {fileID: 485484359815033064}
- component: {fileID: 485484359815033067}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &485484359815032853
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 485484359815033065}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 10.969402, y: -4.0430503, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!20 &485484359815033066
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 485484359815033065}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 2
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_GateFitMode: 2
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.1
far clip plane: 5000
field of view: 40
orthographic: 1
orthographic size: 7
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 0
m_HDR: 1
m_AllowMSAA: 0
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 0
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!81 &485484359815033064
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 485484359815033065}
m_Enabled: 1
--- !u!114 &485484359815033067
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 485484359815033065}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 72ece51f2901e7445ab60da3685d6b5f, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ShowDebugText: 0
m_ShowCameraFrustum: 1
m_IgnoreTimeScale: 0
m_WorldUpOverride: {fileID: 0}
m_UpdateMethod: 2
m_DefaultBlend:
m_Style: 1
m_Time: 2
m_CustomCurve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_CustomBlends: {fileID: 0}
m_CameraCutEvent:
m_PersistentCalls:
m_Calls: []
m_TypeName: Cinemachine.CinemachineBrain+BrainEvent, Cinemachine, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
m_CameraActivatedEvent:
m_PersistentCalls:
m_Calls: []
m_TypeName: Cinemachine.CinemachineBrain+VcamActivatedEvent, Cinemachine, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a977eab75b5324ec4b659c2e2a0e9cfd
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,206 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2337714413289243000
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2337714413289243006}
- component: {fileID: 2337714413289243001}
- component: {fileID: 2337714413289243007}
- component: {fileID: 2337714413289243004}
m_Layer: 0
m_Name: VCAM1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2337714413289243006
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2337714413289243000}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 2337714413388022133}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2337714413289243001
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2337714413289243000}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 45e653bab7fb20e499bda25e1b646fea, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ExcludedPropertiesInInspector:
- m_Script
m_LockStageInInspector:
m_StreamingVersion: 20170927
m_Priority: 10
m_StandbyUpdate: 2
m_LookAt: {fileID: 0}
m_Follow: {fileID: 0}
m_Lens:
FieldOfView: 40
OrthographicSize: 7
NearClipPlane: 0.1
FarClipPlane: 5000
Dutch: 0
LensShift: {x: 0, y: 0}
m_Transitions:
m_BlendHint: 0
m_InheritPosition: 0
m_OnCameraLive:
m_PersistentCalls:
m_Calls: []
m_TypeName: Cinemachine.CinemachineBrain+VcamActivatedEvent, Cinemachine, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
m_LegacyBlendHint: 0
m_ComponentOwner: {fileID: 2337714413388022133}
--- !u!114 &2337714413289243007
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2337714413289243000}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a2fba25a5cd15594e8f050a11e386c80, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ConfineMode: 0
m_BoundingVolume: {fileID: 0}
m_BoundingShape2D: {fileID: 0}
m_ConfineScreenEdges: 1
m_Damping: 0
--- !u!114 &2337714413289243004
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2337714413289243000}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a65b88b27c07a4aa4ae8e0526372c8b4, type: 3}
m_Name:
m_EditorClassIdentifier:
amplitudeGain: 2
frequencyGain: 6
--- !u!1 &2337714413388022132
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2337714413388022133}
- component: {fileID: 2337714413388022139}
- component: {fileID: 2337714413388022138}
- component: {fileID: 2337714413388022136}
m_Layer: 0
m_Name: cm
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2337714413388022133
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2337714413388022132}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.7924186, y: -1.0737722, z: 9.911216}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 2337714413289243006}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2337714413388022139
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2337714413388022132}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ac0b09e7857660247b1477e93731de29, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &2337714413388022138
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2337714413388022132}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6ad980451443d70438faac0bc6c235a0, type: 3}
m_Name:
m_EditorClassIdentifier:
m_LookaheadTime: 0
m_LookaheadSmoothing: 10
m_LookaheadIgnoreY: 0
m_XDamping: 1
m_YDamping: 1
m_ZDamping: 1
m_ScreenX: 0.5
m_ScreenY: 0.5
m_CameraDistance: 10
m_DeadZoneWidth: 0
m_DeadZoneHeight: 0
m_DeadZoneDepth: 0
m_UnlimitedSoftZone: 0
m_SoftZoneWidth: 0.8
m_SoftZoneHeight: 0.8
m_BiasX: 0
m_BiasY: 0
m_CenterOnActivate: 1
m_GroupFramingMode: 2
m_AdjustmentMode: 2
m_GroupFramingSize: 0.8
m_MaxDollyIn: 5000
m_MaxDollyOut: 5000
m_MinimumDistance: 1
m_MaximumDistance: 5000
m_MinimumFOV: 3
m_MaximumFOV: 60
m_MinimumOrthoSize: 1
m_MaximumOrthoSize: 5000
--- !u!114 &2337714413388022136
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2337714413388022132}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 68bb026fafb42b14791938953eaace77, type: 3}
m_Name:
m_EditorClassIdentifier:
m_NoiseProfile: {fileID: 11400000, guid: 69ce8388f6785dd4c8c39915efece2f4, type: 2}
m_AmplitudeGain: 0
m_FrequencyGain: 0
mNoiseOffsets: {x: -283.46573, y: 131.49252, z: 491.17087}

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 25b81e3a3904a4b4ca0b10944fcea79b
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -112,374 +112,24 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &97386694
GameObject:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 97386695}
- component: {fileID: 97386697}
- component: {fileID: 97386696}
m_Layer: 0
m_Name: cm
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &97386695
Transform:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 97386694}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.7924186, y: -1.0737722, z: 9.911216}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 266944716}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &97386696
MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 97386694}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6ad980451443d70438faac0bc6c235a0, type: 3}
m_Name:
m_EditorClassIdentifier:
m_LookaheadTime: 0
m_LookaheadSmoothing: 10
m_LookaheadIgnoreY: 0
m_XDamping: 1
m_YDamping: 1
m_ZDamping: 1
m_ScreenX: 0.5
m_ScreenY: 0.5
m_CameraDistance: 10
m_DeadZoneWidth: 0
m_DeadZoneHeight: 0
m_DeadZoneDepth: 0
m_UnlimitedSoftZone: 0
m_SoftZoneWidth: 0.8
m_SoftZoneHeight: 0.8
m_BiasX: 0
m_BiasY: 0
m_CenterOnActivate: 1
m_GroupFramingMode: 2
m_AdjustmentMode: 2
m_GroupFramingSize: 0.8
m_MaxDollyIn: 5000
m_MaxDollyOut: 5000
m_MinimumDistance: 1
m_MaximumDistance: 5000
m_MinimumFOV: 3
m_MaximumFOV: 60
m_MinimumOrthoSize: 1
m_MaximumOrthoSize: 5000
--- !u!114 &97386697
MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 97386694}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ac0b09e7857660247b1477e93731de29, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &185746015 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 9082059503774285365, guid: fd1ddd924c55b4f9694b98102c91a0a6,
type: 3}
m_PrefabInstance: {fileID: 9082059503859367018}
m_PrefabAsset: {fileID: 0}
--- !u!1 &266944714
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 266944716}
- component: {fileID: 266944715}
- component: {fileID: 266944717}
m_Layer: 0
m_Name: Cinemachine VCAM 1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &266944715
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 266944714}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 45e653bab7fb20e499bda25e1b646fea, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ExcludedPropertiesInInspector:
- m_Script
m_LockStageInInspector:
m_StreamingVersion: 20170927
m_Priority: 10
m_StandbyUpdate: 2
m_LookAt: {fileID: 0}
m_Follow: {fileID: 1352658977}
m_Lens:
FieldOfView: 40
OrthographicSize: 7
NearClipPlane: 0.1
FarClipPlane: 5000
Dutch: 0
LensShift: {x: 0, y: 0}
m_Transitions:
m_BlendHint: 0
m_InheritPosition: 0
m_OnCameraLive:
m_PersistentCalls:
m_Calls: []
m_TypeName: Cinemachine.CinemachineBrain+VcamActivatedEvent, Cinemachine, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
m_LegacyBlendHint: 0
m_ComponentOwner: {fileID: 97386695}
--- !u!4 &266944716
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 266944714}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 97386695}
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &266944717
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 266944714}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a2fba25a5cd15594e8f050a11e386c80, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ConfineMode: 0
m_BoundingVolume: {fileID: 0}
m_BoundingShape2D: {fileID: 1135949885}
m_ConfineScreenEdges: 1
m_Damping: 0
--- !u!1 &519420028
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 519420032}
- component: {fileID: 519420031}
- component: {fileID: 519420029}
- component: {fileID: 519420030}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &519420029
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 519420028}
m_Enabled: 1
--- !u!114 &519420030
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 519420028}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 72ece51f2901e7445ab60da3685d6b5f, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ShowDebugText: 0
m_ShowCameraFrustum: 1
m_IgnoreTimeScale: 0
m_WorldUpOverride: {fileID: 0}
m_UpdateMethod: 2
m_DefaultBlend:
m_Style: 1
m_Time: 2
m_CustomCurve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_CustomBlends: {fileID: 0}
m_CameraCutEvent:
m_PersistentCalls:
m_Calls: []
m_TypeName: Cinemachine.CinemachineBrain+BrainEvent, Cinemachine, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
m_CameraActivatedEvent:
m_PersistentCalls:
m_Calls: []
m_TypeName: Cinemachine.CinemachineBrain+VcamActivatedEvent, Cinemachine, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!20 &519420031
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 519420028}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 2
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_GateFitMode: 2
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.1
far clip plane: 5000
field of view: 40
orthographic: 1
orthographic size: 7
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 0
m_HDR: 1
m_AllowMSAA: 0
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 0
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &519420032
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 519420028}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 13.828903, y: -4.0430503, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &585332173 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7054975846833851208, guid: f064c0737a3e54f1fadc75fc09919760,
type: 3}
m_PrefabInstance: {fileID: 7054975846332595845}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1135949884
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1135949886}
- component: {fileID: 1135949885}
m_Layer: 10
m_Name: CameraConfiner
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!60 &1135949885
--- !u!60 &1135949885 stripped
PolygonCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_CorrespondingSourceObject: {fileID: 4734973651968032114, guid: b753f30f50e804ee1ba8e3ab7eae2bf9,
type: 3}
m_PrefabInstance: {fileID: 4734973653032518991}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1135949884}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0, y: 0}
oldSize: {x: 0, y: 0}
newSize: {x: 0, y: 0}
adaptiveTilingThreshold: 0
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
m_Points:
m_Paths:
- - {x: 5.054474, y: 3.8528316}
- {x: -8.78912, y: 3.8268971}
- {x: -8.739267, y: -21.093697}
- {x: 24.250868, y: -21.10404}
- {x: 24.203676, y: 3.9160552}
- {x: 23.120907, y: 3.9196432}
- {x: 23.107159, y: 3.9179695}
- {x: 12.502958, y: 3.92474}
--- !u!4 &1135949886
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1135949884}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 7.78, y: -0.87, z: -9.911216}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &1352658977 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 6843575828445418654, guid: d3055091a17dc4aa1accf2e33ccef144,
@ -634,6 +284,75 @@ PrefabInstance:
objectReference: {fileID: 185746015}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: fdaa7451ab31b477b930076bbc888bab, type: 3}
--- !u!1001 &485484359436847253
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 485484359815033065, guid: a977eab75b5324ec4b659c2e2a0e9cfd,
type: 3}
propertyPath: m_Name
value: Main Camera
objectReference: {fileID: 0}
- target: {fileID: 485484359815032853, guid: a977eab75b5324ec4b659c2e2a0e9cfd,
type: 3}
propertyPath: m_LocalPosition.x
value: 10.969402
objectReference: {fileID: 0}
- target: {fileID: 485484359815032853, guid: a977eab75b5324ec4b659c2e2a0e9cfd,
type: 3}
propertyPath: m_LocalPosition.y
value: -4.0430503
objectReference: {fileID: 0}
- target: {fileID: 485484359815032853, guid: a977eab75b5324ec4b659c2e2a0e9cfd,
type: 3}
propertyPath: m_LocalPosition.z
value: -10
objectReference: {fileID: 0}
- target: {fileID: 485484359815032853, guid: a977eab75b5324ec4b659c2e2a0e9cfd,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 485484359815032853, guid: a977eab75b5324ec4b659c2e2a0e9cfd,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 485484359815032853, guid: a977eab75b5324ec4b659c2e2a0e9cfd,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 485484359815032853, guid: a977eab75b5324ec4b659c2e2a0e9cfd,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 485484359815032853, guid: a977eab75b5324ec4b659c2e2a0e9cfd,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 485484359815032853, guid: a977eab75b5324ec4b659c2e2a0e9cfd,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 485484359815032853, guid: a977eab75b5324ec4b659c2e2a0e9cfd,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 485484359815032853, guid: a977eab75b5324ec4b659c2e2a0e9cfd,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: a977eab75b5324ec4b659c2e2a0e9cfd, type: 3}
--- !u!1001 &2219516563411082784
PrefabInstance:
m_ObjectHideFlags: 0
@ -777,6 +496,154 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 4ca131020414f4b1597dac2e1d292d7f, type: 3}
--- !u!1001 &2337714413341229490
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 2337714413289243000, guid: 25b81e3a3904a4b4ca0b10944fcea79b,
type: 3}
propertyPath: m_Name
value: VCAM1
objectReference: {fileID: 0}
- target: {fileID: 2337714413289243006, guid: 25b81e3a3904a4b4ca0b10944fcea79b,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2337714413289243006, guid: 25b81e3a3904a4b4ca0b10944fcea79b,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2337714413289243006, guid: 25b81e3a3904a4b4ca0b10944fcea79b,
type: 3}
propertyPath: m_LocalPosition.z
value: -10
objectReference: {fileID: 0}
- target: {fileID: 2337714413289243006, guid: 25b81e3a3904a4b4ca0b10944fcea79b,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2337714413289243006, guid: 25b81e3a3904a4b4ca0b10944fcea79b,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2337714413289243006, guid: 25b81e3a3904a4b4ca0b10944fcea79b,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2337714413289243006, guid: 25b81e3a3904a4b4ca0b10944fcea79b,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2337714413289243006, guid: 25b81e3a3904a4b4ca0b10944fcea79b,
type: 3}
propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
- target: {fileID: 2337714413289243006, guid: 25b81e3a3904a4b4ca0b10944fcea79b,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2337714413289243006, guid: 25b81e3a3904a4b4ca0b10944fcea79b,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2337714413289243006, guid: 25b81e3a3904a4b4ca0b10944fcea79b,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2337714413289243001, guid: 25b81e3a3904a4b4ca0b10944fcea79b,
type: 3}
propertyPath: m_Follow
value:
objectReference: {fileID: 1352658977}
- target: {fileID: 2337714413289243007, guid: 25b81e3a3904a4b4ca0b10944fcea79b,
type: 3}
propertyPath: m_BoundingShape2D
value:
objectReference: {fileID: 1135949885}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 25b81e3a3904a4b4ca0b10944fcea79b, type: 3}
--- !u!1001 &4734973653032518991
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4734973651968032115, guid: b753f30f50e804ee1ba8e3ab7eae2bf9,
type: 3}
propertyPath: m_Name
value: CameraConfiner
objectReference: {fileID: 0}
- target: {fileID: 4734973651968032113, guid: b753f30f50e804ee1ba8e3ab7eae2bf9,
type: 3}
propertyPath: m_LocalPosition.x
value: 7.78
objectReference: {fileID: 0}
- target: {fileID: 4734973651968032113, guid: b753f30f50e804ee1ba8e3ab7eae2bf9,
type: 3}
propertyPath: m_LocalPosition.y
value: -0.87
objectReference: {fileID: 0}
- target: {fileID: 4734973651968032113, guid: b753f30f50e804ee1ba8e3ab7eae2bf9,
type: 3}
propertyPath: m_LocalPosition.z
value: -9.911216
objectReference: {fileID: 0}
- target: {fileID: 4734973651968032113, guid: b753f30f50e804ee1ba8e3ab7eae2bf9,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4734973651968032113, guid: b753f30f50e804ee1ba8e3ab7eae2bf9,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4734973651968032113, guid: b753f30f50e804ee1ba8e3ab7eae2bf9,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4734973651968032113, guid: b753f30f50e804ee1ba8e3ab7eae2bf9,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4734973651968032113, guid: b753f30f50e804ee1ba8e3ab7eae2bf9,
type: 3}
propertyPath: m_RootOrder
value: 6
objectReference: {fileID: 0}
- target: {fileID: 4734973651968032113, guid: b753f30f50e804ee1ba8e3ab7eae2bf9,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4734973651968032113, guid: b753f30f50e804ee1ba8e3ab7eae2bf9,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4734973651968032113, guid: b753f30f50e804ee1ba8e3ab7eae2bf9,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: b753f30f50e804ee1ba8e3ab7eae2bf9, type: 3}
--- !u!1001 &6843575829779162303
PrefabInstance:
m_ObjectHideFlags: 0

View file

@ -0,0 +1,55 @@
using System.Collections;
using Cinemachine;
using src.Base;
using src.Managers;
using UnityEngine;
namespace src.Ammo
{
public class BombCameraShake : GameplayComponent
{
private readonly BombsUtilManager _bombsUtilManager = BombsUtilManager.Instance;
public float amplitudeGain = 3f;
public float frequencyGain = 3f;
private int _currentlyShaking;
private CinemachineVirtualCamera _virtualCamera;
private CinemachineBasicMultiChannelPerlin _noiseMachine;
// Start is called before the first frame update
private void Start()
{
_virtualCamera = GetComponent<CinemachineVirtualCamera>();
_noiseMachine = _virtualCamera.GetCinemachineComponent<CinemachineBasicMultiChannelPerlin>();
}
public void StartCameraShakeCoro()
{
StartCoroutine(_startCameraShake());
}
private IEnumerator _startCameraShake()
{
SetCameraNoise(amplitudeGain, frequencyGain);
yield return new WaitForSeconds(_bombsUtilManager.ExplosionDuration);
SetCameraNoise(0, 0);
}
internal void SetCameraNoise(float amplitude, float frequency) {
/* Fix camera shaking when multiple instances request shake at the same time. */
if (amplitude > 0 || frequency > 0)
{
_currentlyShaking += 1;
}
else
{
_currentlyShaking -= 1;
}
if (_currentlyShaking > 0 && amplitude == 0f || frequencyGain == 0f)
{
return;
}
_noiseMachine.m_AmplitudeGain = amplitude;
_noiseMachine.m_FrequencyGain = frequency;
}
}
}

View file

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

View file

@ -1,5 +1,6 @@
using System.Collections;
using src.Base;
using src.Helpers;
using src.Managers;
using UnityEngine;
@ -9,12 +10,14 @@ namespace src.Ammo
{
public GameObject explosionPrefab;
private BombCameraShake _cameraShake;
private readonly BombsUtilManager _bombsUtil = BombsUtilManager.Instance;
private bool _exploded;
// Start is called before the first frame update
void Start()
{
_cameraShake = GameObject.Find("VCAM1").GetComponent<BombCameraShake>();
Invoke(nameof(Explode), _bombsUtil.Timer);
}
@ -24,6 +27,7 @@ namespace src.Ammo
GetComponentInChildren<SpriteRenderer>().enabled = false;
_cameraShake.StartCameraShakeCoro();
StartCoroutine(CreateExplosions(Vector3.down));
StartCoroutine(CreateExplosions(Vector3.left));
StartCoroutine(CreateExplosions(Vector3.up));