From 4504ee8b32c6e68f0bfc27da9854f32dd5fcdd64 Mon Sep 17 00:00:00 2001 From: BOT Alex <44818698+MagicBOTAlex@users.noreply.github.com> Date: Sun, 21 Apr 2024 07:43:19 +0200 Subject: [PATCH 1/2] Moved play buttons to right --- Assets/Prefabs/UI/GameUI.prefab | 46 ++++++++++++++++----------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/Assets/Prefabs/UI/GameUI.prefab b/Assets/Prefabs/UI/GameUI.prefab index fa9d468..828d747 100644 --- a/Assets/Prefabs/UI/GameUI.prefab +++ b/Assets/Prefabs/UI/GameUI.prefab @@ -620,7 +620,6 @@ RectTransform: - {fileID: 7094050956717546836} - {fileID: 5203690656153714838} - {fileID: 4429602029198271624} - - {fileID: 2823721143316666755} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -857,9 +856,9 @@ RectTransform: - {fileID: 6925912160577396843} m_Father: {fileID: 1571444269651810830} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 97.85, y: -475.8032} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 150, y: 150} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1590834972027237251 @@ -1245,18 +1244,18 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2074820118910961211} - 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_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 9031083463025029788} - {fileID: 6503638792597430501} - m_Father: {fileID: 3367038424042638127} + m_Father: {fileID: 5203690656153714838} 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_AnchoredPosition: {x: -1320, y: 0} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &2229423673042055192 @@ -1628,9 +1627,9 @@ RectTransform: - {fileID: 8740154629202535075} m_Father: {fileID: 1571444269651810830} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 97.85, y: -105} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 150, y: 150} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &4030747125337201116 @@ -2476,7 +2475,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &4429602029198271624 RectTransform: m_ObjectHideFlags: 0 @@ -2670,7 +2669,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0} m_AnchorMax: {x: 0.5, y: 0} - m_AnchoredPosition: {x: -863.80005, y: -387.09998} + m_AnchoredPosition: {x: 739, y: -387.09998} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &2593507632019896054 @@ -3009,7 +3008,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &5203690656153714838 RectTransform: m_ObjectHideFlags: 0 @@ -3025,6 +3024,7 @@ RectTransform: - {fileID: 9125599128698433918} - {fileID: 41458428043916546} - {fileID: 5814772211296616353} + - {fileID: 2823721143316666755} m_Father: {fileID: 3367038424042638127} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 1, y: 0.5} @@ -3154,9 +3154,9 @@ RectTransform: - {fileID: 2761822326100020935} m_Father: {fileID: 1571444269651810830} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 97.85, y: -846.6064} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 150, y: 150} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &8651936493222350935 @@ -4033,9 +4033,9 @@ RectTransform: - {fileID: 3463979208659812338} m_Father: {fileID: 1571444269651810830} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 97.85, y: -290.4016} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 150, y: 150} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1595412627603319622 @@ -4627,7 +4627,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0} m_AnchorMax: {x: 0.5, y: 0} - m_AnchoredPosition: {x: -747.5, y: -387.09998} + m_AnchoredPosition: {x: 855.30005, y: -387.09998} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &2186931942408298377 @@ -4750,9 +4750,9 @@ RectTransform: - {fileID: 1879052238577856330} m_Father: {fileID: 1571444269651810830} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 97.85, y: -661.2048} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 150, y: 150} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &2364807694092123912 From 124f95a31d4f0402dd9964df9fd1c539b71518c9 Mon Sep 17 00:00:00 2001 From: kimrdd Date: Sun, 21 Apr 2024 07:48:36 +0200 Subject: [PATCH 2/2] camera shake not working --- Assets/Scripts/Camera/CameraShake.cs | 40 +++++++++++++++++++++++ Assets/Scripts/Camera/CameraShake.cs.meta | 11 +++++++ 2 files changed, 51 insertions(+) create mode 100644 Assets/Scripts/Camera/CameraShake.cs create mode 100644 Assets/Scripts/Camera/CameraShake.cs.meta diff --git a/Assets/Scripts/Camera/CameraShake.cs b/Assets/Scripts/Camera/CameraShake.cs new file mode 100644 index 0000000..8345514 --- /dev/null +++ b/Assets/Scripts/Camera/CameraShake.cs @@ -0,0 +1,40 @@ +using Cinemachine; +using UnityEngine; + +public class CameraShake : MonoBehaviour +{ + [SerializeField]private CinemachineFreeLook v_Camera; + private float shakeTimer; + + public static CameraShake Instance; + + private void Start() + { + if (Instance != this) + Destroy(Instance); + Instance = this; + } + + public void ShakeCamera(float intensity, float time) + { + CinemachineBasicMultiChannelPerlin multiChannelPerlin = v_Camera.GetComponent(); + + multiChannelPerlin.m_AmplitudeGain = intensity; + shakeTimer = time; + } + + private void Update() + { + if (shakeTimer > 0) + { + shakeTimer -= Time.deltaTime; + if (shakeTimer <= 0f) + { + CinemachineBasicMultiChannelPerlin multiChannelPerlin = v_Camera.GetComponent(); + + multiChannelPerlin.m_AmplitudeGain = 0f; + + } + } + } +} diff --git a/Assets/Scripts/Camera/CameraShake.cs.meta b/Assets/Scripts/Camera/CameraShake.cs.meta new file mode 100644 index 0000000..85fcbb9 --- /dev/null +++ b/Assets/Scripts/Camera/CameraShake.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: da54a1d427b68cf40a53acebb823123d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: