diff --git a/Assets/Material/CRTBlit.mat b/Assets/Material/CRTBlit.mat index daf8798..93704e9 100644 --- a/Assets/Material/CRTBlit.mat +++ b/Assets/Material/CRTBlit.mat @@ -117,24 +117,24 @@ Material: - _Surface: 0 - _WorkflowMode: 1 - _ZWrite: 1 - - u_bend: 3.09 - - u_blue_offset_y: 0.002 + - u_bend: 4 + - u_blue_offset_y: 0.0022 - u_green_offset_y: 0 - - u_noise_amount: 0.012 - - u_noise_size: 170 - - u_red_offset_y: -0.002 - - u_scanlin_transparence1: 0.021 - - u_scanlin_transparence2: 0.031 + - u_noise_amount: 0.01 + - u_noise_size: 417 + - u_red_offset_y: -0.0021 + - u_scanlin_transparence1: 0.011 + - u_scanlin_transparence2: 0.021 - u_scanline_amount: 0.047 - u_scanline_size_1: 277 - u_scanline_size_2: 521 - u_scanline_speed_1: 94.13 - u_scanline_speed_2: 30 - - u_space_bend: 2.135 + - u_space_bend: 2.14 - u_time: 15.95 - - u_vignette_edge_round: 7.8 - - u_vignette_size: 1.82 - - u_vignette_smoothness: 0.56 + - u_vignette_edge_round: 6 + - u_vignette_size: 1.8 + - u_vignette_smoothness: 0.26 m_Colors: - _BaseColor: {r: 1, g: 1, b: 1, a: 1} - _Color: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Prefabs/MainMenuButtons.prefab b/Assets/Prefabs/MainMenuButtons.prefab index d6fb153..282a2f7 100644 --- a/Assets/Prefabs/MainMenuButtons.prefab +++ b/Assets/Prefabs/MainMenuButtons.prefab @@ -77,8 +77,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4291166124 - m_fontColor: {r: 0.67358494, g: 1, b: 0.7738154, a: 1} + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -95,7 +95,7 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 10.05 + m_fontSize: 23.25 m_fontSizeBase: 24 m_fontWeight: 400 m_enableAutoSizing: 1 @@ -199,15 +199,15 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.31014594, g: 0.6792453, b: 0.5950109, a: 1} + m_Color: {r: 0.60248095, g: 0.9716981, b: 0.5353506, a: 1} 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: 10905, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 + m_Sprite: {fileID: 21300000, guid: 116e65d2b34493c439f545f71aa487b5, type: 3} + m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 @@ -215,7 +215,7 @@ MonoBehaviour: m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 + m_PixelsPerUnitMultiplier: 8.2 --- !u!114 &5917528464644539590 MonoBehaviour: m_ObjectHideFlags: 0 @@ -237,10 +237,10 @@ MonoBehaviour: m_SelectOnRight: {fileID: 0} m_Transition: 1 m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.5377358, g: 0.5377358, b: 0.5377358, a: 1} - m_PressedColor: {r: 0.5754717, g: 0.3441972, b: 0.3441972, a: 1} - m_SelectedColor: {r: 0.5283019, g: 0.5283019, b: 0.5283019, a: 1} + m_NormalColor: {r: 0.7830189, g: 0.7830189, b: 0.7830189, a: 1} + m_HighlightedColor: {r: 1, g: 1, b: 1, a: 1} + m_PressedColor: {r: 1, g: 0.57924527, b: 0.57924527, a: 1} + m_SelectedColor: {r: 1, g: 1, b: 1, a: 1} m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_ColorMultiplier: 1 m_FadeDuration: 0.1 diff --git a/Assets/Scenes/MainMenu.unity b/Assets/Scenes/MainMenu.unity index bbcc4c8..de54565 100644 --- a/Assets/Scenes/MainMenu.unity +++ b/Assets/Scenes/MainMenu.unity @@ -237,6 +237,21 @@ PrefabInstance: propertyPath: m_Name value: Button-Quit objectReference: {fileID: 0} + - target: {fileID: 5917528464644539590, guid: 0bdc45a9254ade843b7ba60aaab62301, + type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Mode + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5917528464644539590, guid: 0bdc45a9254ade843b7ba60aaab62301, + type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName + value: Quit + objectReference: {fileID: 0} + - target: {fileID: 5917528464644539590, guid: 0bdc45a9254ade843b7ba60aaab62301, + type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName + value: ButtonAction, Assembly-CSharp + objectReference: {fileID: 0} - target: {fileID: 5917528464644539591, guid: 0bdc45a9254ade843b7ba60aaab62301, type: 3} propertyPath: m_Pivot.x @@ -342,6 +357,31 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 5917528464644539593, guid: 0bdc45a9254ade843b7ba60aaab62301, + type: 3} + propertyPath: m_UseSpriteMesh + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5917528464644539593, guid: 0bdc45a9254ade843b7ba60aaab62301, + type: 3} + propertyPath: m_RaycastPadding.w + value: 4.03 + objectReference: {fileID: 0} + - target: {fileID: 5917528464644539593, guid: 0bdc45a9254ade843b7ba60aaab62301, + type: 3} + propertyPath: m_RaycastPadding.x + value: -2.02 + objectReference: {fileID: 0} + - target: {fileID: 5917528464644539593, guid: 0bdc45a9254ade843b7ba60aaab62301, + type: 3} + propertyPath: m_RaycastPadding.y + value: -4.73 + objectReference: {fileID: 0} + - target: {fileID: 5917528464644539593, guid: 0bdc45a9254ade843b7ba60aaab62301, + type: 3} + propertyPath: m_RaycastPadding.z + value: 0.99 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 0bdc45a9254ade843b7ba60aaab62301, type: 3} --- !u!224 &129620053 stripped @@ -592,7 +632,7 @@ RectTransform: - {fileID: 815245103} - {fileID: 129620053} m_Father: {fileID: 753457328} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -617,7 +657,7 @@ MonoBehaviour: m_Top: 20 m_Bottom: 28 m_ChildAlignment: 4 - m_Spacing: 19.62 + m_Spacing: 25 m_ChildForceExpandWidth: 1 m_ChildForceExpandHeight: 1 m_ChildControlWidth: 1 @@ -738,6 +778,7 @@ RectTransform: m_LocalScale: {x: 0, y: 0, z: 0} m_ConstrainProportionsScale: 0 m_Children: + - {fileID: 1079852939} - {fileID: 1451380980} - {fileID: 1281004661} - {fileID: 574174949} @@ -835,8 +876,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4285573976 - m_fontColor: {r: 0.3437522, g: 0.6698113, b: 0.43886983, a: 1} + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -925,6 +966,11 @@ PrefabInstance: propertyPath: m_Name value: Button-Options objectReference: {fileID: 0} + - target: {fileID: 5917528464644539588, guid: 0bdc45a9254ade843b7ba60aaab62301, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} - target: {fileID: 5917528464644539590, guid: 0bdc45a9254ade843b7ba60aaab62301, type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size @@ -978,7 +1024,7 @@ PrefabInstance: - target: {fileID: 5917528464644539591, guid: 0bdc45a9254ade843b7ba60aaab62301, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 5917528464644539591, guid: 0bdc45a9254ade843b7ba60aaab62301, type: 3} @@ -988,17 +1034,17 @@ PrefabInstance: - target: {fileID: 5917528464644539591, guid: 0bdc45a9254ade843b7ba60aaab62301, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 5917528464644539591, guid: 0bdc45a9254ade843b7ba60aaab62301, type: 3} propertyPath: m_SizeDelta.x - value: 0 + value: 91.09 objectReference: {fileID: 0} - target: {fileID: 5917528464644539591, guid: 0bdc45a9254ade843b7ba60aaab62301, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 15.2666645 objectReference: {fileID: 0} - target: {fileID: 5917528464644539591, guid: 0bdc45a9254ade843b7ba60aaab62301, type: 3} @@ -1038,12 +1084,12 @@ PrefabInstance: - target: {fileID: 5917528464644539591, guid: 0bdc45a9254ade843b7ba60aaab62301, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 68 objectReference: {fileID: 0} - target: {fileID: 5917528464644539591, guid: 0bdc45a9254ade843b7ba60aaab62301, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -70.15333 objectReference: {fileID: 0} - target: {fileID: 5917528464644539591, guid: 0bdc45a9254ade843b7ba60aaab62301, type: 3} @@ -1080,6 +1126,82 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5383d580c7e5c0d41a73c7791506ead1, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!1 &1079852938 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1079852939} + - component: {fileID: 1079852941} + - component: {fileID: 1079852940} + m_Layer: 5 + m_Name: Background2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1079852939 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1079852938} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 753457328} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1079852940 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1079852938} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + 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: 21300000, guid: f101856c7df715742a264dc02c835fb4, 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: 10 +--- !u!222 &1079852941 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1079852938} + m_CullTransparentMesh: 1 --- !u!1 &1281004660 GameObject: m_ObjectHideFlags: 0 @@ -1111,12 +1233,12 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 753457328} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -77.453, y: -53.481995} - m_SizeDelta: {x: 154.907, y: 106.963} + m_AnchoredPosition: {x: -91.338, y: -53.481995} + m_SizeDelta: {x: 127.138, y: 106.963} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1281004662 MonoBehaviour: @@ -1138,7 +1260,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: Stretch Graplin + m_text: '[Graplin Jeff]' m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_sharedMaterial: {fileID: 2100000, guid: e73a58f6e2794ae7b1b7e50b7fb811b0, type: 2} @@ -1172,7 +1294,7 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 - m_HorizontalAlignment: 1 + m_HorizontalAlignment: 4 m_VerticalAlignment: 1024 m_textAlignment: 65535 m_characterSpacing: 0 @@ -1238,7 +1360,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &1451380980 RectTransform: m_ObjectHideFlags: 0 @@ -1252,7 +1374,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 753457328} - m_RootOrder: 0 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -1337,12 +1459,12 @@ RectTransform: - {fileID: 779369316} - {fileID: 973613} m_Father: {fileID: 753457328} - m_RootOrder: 3 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 82.547, y: -53.407013} - m_SizeDelta: {x: -165.09, y: -106.81} + m_AnchoredPosition: {x: 78.414, y: -48.979} + m_SizeDelta: {x: -173.356, y: -115.666} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1703051055 MonoBehaviour: @@ -1661,5 +1783,25 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 5917528464644539593, guid: 0bdc45a9254ade843b7ba60aaab62301, + type: 3} + propertyPath: m_RaycastPadding.w + value: -1.64 + objectReference: {fileID: 0} + - target: {fileID: 5917528464644539593, guid: 0bdc45a9254ade843b7ba60aaab62301, + type: 3} + propertyPath: m_RaycastPadding.x + value: -5.02 + objectReference: {fileID: 0} + - target: {fileID: 5917528464644539593, guid: 0bdc45a9254ade843b7ba60aaab62301, + type: 3} + propertyPath: m_RaycastPadding.y + value: -1.41 + objectReference: {fileID: 0} + - target: {fileID: 5917528464644539593, guid: 0bdc45a9254ade843b7ba60aaab62301, + type: 3} + propertyPath: m_RaycastPadding.z + value: 0.13 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 0bdc45a9254ade843b7ba60aaab62301, type: 3} diff --git a/Assets/Scripts/ButtonAction.cs b/Assets/Scripts/ButtonAction.cs index b556a02..3eee442 100644 --- a/Assets/Scripts/ButtonAction.cs +++ b/Assets/Scripts/ButtonAction.cs @@ -1,16 +1,12 @@ using System; -using System.Collections; -using System.Collections.Generic; -using Unity.VisualScripting; -using UnityEditor; using UnityEngine; using UnityEngine.SceneManagement; public class ButtonAction : MonoBehaviour { - public void LoadScene(SceneAsset sceneAsset) + public void LoadScene(String sceneName) { - SceneManager.LoadScene(sceneAsset.name); + SceneManager.LoadScene(sceneName); } public void OpenOption() diff --git a/Assets/Scripts/GraphicRaycasterBend.cs b/Assets/Scripts/GraphicRaycasterBend.cs deleted file mode 100644 index eb8d083..0000000 --- a/Assets/Scripts/GraphicRaycasterBend.cs +++ /dev/null @@ -1,356 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.EventSystems; -using UnityEngine.Serialization; -using UnityEngine.UI; - -public class GraphicRaycasterBend : GraphicRaycaster -{ - Vector2 Bend(Vector2 uv, float bend) - { - uv -= new Vector2(0.5f, 0.5f); - uv *= new Vector2(2, 2); - - uv.x *= (float)(1 + Math.Pow(Math.Abs(uv.y) / bend, 2)); - uv.y *= (float)(1 + Math.Pow(Math.Abs(uv.x) / bend, 2)); - - uv /= new Vector2(2.107f, 2.107f); - return uv + new Vector2(0.5f, 0.5f); - } - - private Canvas m_Canvas; - - private Canvas canvas - { - get - { - if (m_Canvas != null) - return m_Canvas; - - m_Canvas = GetComponent(); - return m_Canvas; - } - } - - [NonSerialized] private List m_RaycastResults = new List(); - - /// - /// Perform the raycast against the list of graphics associated with the Canvas. - /// - /// Current event data - /// List of hit objects to append new results to. - public override void Raycast(PointerEventData eventData, List resultAppendList) - { - if (canvas == null) - return; - - var canvasGraphics = GraphicRegistry.GetRaycastableGraphicsForCanvas(canvas); - if (canvasGraphics == null || canvasGraphics.Count == 0) - return; - - int displayIndex; - var currentEventCamera = eventCamera; // Property can call Camera.main, so cache the reference - - if (canvas.renderMode == RenderMode.ScreenSpaceOverlay || currentEventCamera == null) - displayIndex = canvas.targetDisplay; - else - displayIndex = currentEventCamera.targetDisplay; - - var eventPosition = RelativeMouseAtScaled(eventData.position); - if (eventPosition != Vector3.zero) - { - // We support multiple display and display identification based on event position. - - int eventDisplayIndex = (int)eventPosition.z; - - // Discard events that are not part of this display so the user does not interact with multiple displays at once. - if (eventDisplayIndex != displayIndex) - return; - } - else - { - // The multiple display system is not supported on all platforms, when it is not supported the returned position - // will be all zeros so when the returned index is 0 we will default to the event data to be safe. - eventPosition = eventData.position; - -#if UNITY_EDITOR - if (Display.activeEditorGameViewTarget != displayIndex) - return; - eventPosition.z = Display.activeEditorGameViewTarget; -#endif - - // We dont really know in which display the event occured. We will process the event assuming it occured in our display. - } - - // Convert to view space - Vector2 pos; - if (currentEventCamera == null) - { - // Multiple display support only when not the main display. For display 0 the reported - // resolution is always the desktops resolution since its part of the display API, - // so we use the standard none multiple display method. (case 741751) - float w = Screen.width; - float h = Screen.height; - if (displayIndex > 0 && displayIndex < Display.displays.Length) - { - w = Display.displays[displayIndex].systemWidth; - h = Display.displays[displayIndex].systemHeight; - } - - pos = new Vector2(eventPosition.x / w, eventPosition.y / h); - } - else - pos = currentEventCamera.ScreenToViewportPoint(eventPosition); - - // If it's outside the camera's viewport, do nothing - if (pos.x < 0f || pos.x > 1f || pos.y < 0f || pos.y > 1f) - return; - - pos = Bend(pos, 3.03f); - - float hitDistance = float.MaxValue; - - Ray ray = new Ray(); - - if (currentEventCamera != null) - ray = currentEventCamera.ScreenPointToRay(eventPosition); - - if (canvas.renderMode != RenderMode.ScreenSpaceOverlay && blockingObjects != BlockingObjects.None) - { - float distanceToClipPlane = 100.0f; - - if (currentEventCamera != null) - { - float projectionDirection = ray.direction.z; - distanceToClipPlane = Mathf.Approximately(0.0f, projectionDirection) - ? Mathf.Infinity - : Mathf.Abs((currentEventCamera.farClipPlane - currentEventCamera.nearClipPlane) / - projectionDirection); - } -#if PACKAGE_PHYSICS - if (blockingObjects == BlockingObjects.ThreeD || blockingObjects == BlockingObjects.All) - { - if (ReflectionMethodsCache.Singleton.raycast3D != null) - { - var hits = - ReflectionMethodsCache.Singleton.raycast3DAll(ray, distanceToClipPlane, (int)m_BlockingMask); - if (hits.Length > 0) - hitDistance = hits[0].distance; - } - } -#endif -#if PACKAGE_PHYSICS2D - if (blockingObjects == BlockingObjects.TwoD || blockingObjects == BlockingObjects.All) - { - if (ReflectionMethodsCache.Singleton.raycast2D != null) - { - var hits = - ReflectionMethodsCache.Singleton.getRayIntersectionAll(ray, distanceToClipPlane, (int)m_BlockingMask); - if (hits.Length > 0) - hitDistance = hits[0].distance; - } - } -#endif - } - - m_RaycastResults.Clear(); - - Raycast(canvas, currentEventCamera, eventPosition, canvasGraphics, m_RaycastResults); - - int totalCount = m_RaycastResults.Count; - for (var index = 0; index < totalCount; index++) - { - var go = m_RaycastResults[index].gameObject; - bool appendGraphic = true; - - if (ignoreReversedGraphics) - { - if (currentEventCamera == null) - { - // If we dont have a camera we know that we should always be facing forward - var dir = go.transform.rotation * Vector3.forward; - appendGraphic = Vector3.Dot(Vector3.forward, dir) > 0; - } - else - { - // If we have a camera compare the direction against the cameras forward. - var cameraForward = currentEventCamera.transform.rotation * Vector3.forward * - currentEventCamera.nearClipPlane; - appendGraphic = - Vector3.Dot(go.transform.position - currentEventCamera.transform.position - cameraForward, - go.transform.forward) >= 0; - } - } - - if (appendGraphic) - { - float distance = 0; - Transform trans = go.transform; - Vector3 transForward = trans.forward; - - if (currentEventCamera == null || canvas.renderMode == RenderMode.ScreenSpaceOverlay) - distance = 0; - else - { - // http://geomalgorithms.com/a06-_intersect-2.html - distance = (Vector3.Dot(transForward, trans.position - ray.origin) / - Vector3.Dot(transForward, ray.direction)); - - // Check to see if the go is behind the camera. - if (distance < 0) - continue; - } - - if (distance >= hitDistance) - continue; - - var castResult = new RaycastResult - { - gameObject = go, - module = this, - distance = distance, - screenPosition = eventPosition, - displayIndex = displayIndex, - index = resultAppendList.Count, - depth = m_RaycastResults[index].depth, - sortingLayer = canvas.sortingLayerID, - sortingOrder = canvas.sortingOrder, - worldPosition = ray.origin + ray.direction * distance, - worldNormal = -transForward - }; - resultAppendList.Add(castResult); - } - } - } - - private static Vector3 RelativeMouseAtScaled(Vector2 position) - { -#if !UNITY_EDITOR && !UNITY_WSA - // If the main display is now the same resolution as the system then we need to scale the mouse position. (case 1141732) - if (Display.main.renderingWidth != Display.main.systemWidth || Display.main.renderingHeight != Display.main.systemHeight) - { - // The system will add padding when in full-screen and using a non-native aspect ratio. (case UUM-7893) - // For example Rendering 1920x1080 with a systeem resolution of 3440x1440 would create black bars on each side that are 330 pixels wide. - // we need to account for this or it will offset our coordinates when we are not on the main display. - var systemAspectRatio = Display.main.systemWidth / (float)Display.main.systemHeight; - - var sizePlusPadding = new Vector2(Display.main.renderingWidth, Display.main.renderingHeight); - var padding = Vector2.zero; - if (Screen.fullScreen) - { - var aspectRatio = Screen.width / (float)Screen.height; - if (Display.main.systemHeight * aspectRatio < Display.main.systemWidth) - { - // Horizontal padding - sizePlusPadding.x = Display.main.renderingHeight * systemAspectRatio; - padding.x = (sizePlusPadding.x - Display.main.renderingWidth) * 0.5f; - } - else - { - // Vertical padding - sizePlusPadding.y = Display.main.renderingWidth / systemAspectRatio; - padding.y = (sizePlusPadding.y - Display.main.renderingHeight) * 0.5f; - } - } - - var sizePlusPositivePadding = sizePlusPadding - padding; - - // If we are not inside of the main display then we must adjust the mouse position so it is scaled by - // the main display and adjusted for any padding that may have been added due to different aspect ratios. - if (position.y < -padding.y || position.y > sizePlusPositivePadding.y || - position.x < -padding.x || position.x > sizePlusPositivePadding.x) - { - var adjustedPosition = position; - - if (!Screen.fullScreen) - { - // When in windowed mode, the window will be centered with the 0,0 coordinate at the top left, we need to adjust so it is relative to the screen instead. - adjustedPosition.x -= (Display.main.renderingWidth - Display.main.systemWidth) * 0.5f; - adjustedPosition.y -= (Display.main.renderingHeight - Display.main.systemHeight) * 0.5f; - } - else - { - // Scale the mouse position to account for the black bars when in a non-native aspect ratio. - adjustedPosition += padding; - adjustedPosition.x *= Display.main.systemWidth / sizePlusPadding.x; - adjustedPosition.y *= Display.main.systemHeight / sizePlusPadding.y; - } - - var relativePos = Display.RelativeMouseAt(adjustedPosition); - - // If we are not on the main display then return the adjusted position. - if (relativePos.z != 0) - return relativePos; - } - - // We are using the main display. - return new Vector3(position.x, position.y, 0); - } -#endif - return Display.RelativeMouseAt(position); - } - - /// - /// The camera that will generate rays for this raycaster. - /// - /// - /// - Null if Camera mode is ScreenSpaceOverlay or ScreenSpaceCamera and has no camera. - /// - canvas.worldCanvas if not null - /// - Camera.main. - /// - public override Camera eventCamera - { - get - { - var canvas = this.canvas; - var renderMode = canvas.renderMode; - if (renderMode == RenderMode.ScreenSpaceOverlay - || (renderMode == RenderMode.ScreenSpaceCamera && canvas.worldCamera == null)) - return null; - - return canvas.worldCamera ?? Camera.main; - } - } - - /// - /// Perform a raycast into the screen and collect all graphics underneath it. - /// - [NonSerialized] static readonly List s_SortedGraphics = new List(); - - private static void Raycast(Canvas canvas, Camera eventCamera, Vector2 pointerPosition, - IList foundGraphics, List results) - { - // Necessary for the event system - int totalCount = foundGraphics.Count; - for (int i = 0; i < totalCount; ++i) - { - Graphic graphic = foundGraphics[i]; - - // -1 means it hasn't been processed by the canvas, which means it isn't actually drawn - if (!graphic.raycastTarget || graphic.canvasRenderer.cull || graphic.depth == -1) - continue; - - if (!RectTransformUtility.RectangleContainsScreenPoint(graphic.rectTransform, pointerPosition, eventCamera, - graphic.raycastPadding)) - continue; - - if (eventCamera != null && eventCamera.WorldToScreenPoint(graphic.rectTransform.position).z > - eventCamera.farClipPlane) - continue; - - if (graphic.Raycast(pointerPosition, eventCamera)) - { - s_SortedGraphics.Add(graphic); - } - } - - s_SortedGraphics.Sort((g1, g2) => g2.depth.CompareTo(g1.depth)); - totalCount = s_SortedGraphics.Count; - for (int i = 0; i < totalCount; ++i) - results.Add(s_SortedGraphics[i]); - - s_SortedGraphics.Clear(); - } -} \ No newline at end of file diff --git a/Assets/Scripts/GraphicRaycasterBend.cs.meta b/Assets/Scripts/GraphicRaycasterBend.cs.meta deleted file mode 100644 index 7b63ab8..0000000 --- a/Assets/Scripts/GraphicRaycasterBend.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: c1e09fff2a59d384da651e8d0ddfd50c -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Shaders/Blit.cs b/Assets/Shaders/Blit.cs index c18c1c7..bc9262e 100644 --- a/Assets/Shaders/Blit.cs +++ b/Assets/Shaders/Blit.cs @@ -116,12 +116,17 @@ namespace Shaders GetType().Name); return; } - - if (Application.isPlaying || settings.alwaysRender) +#if UNITY_WEBGL + blitPass.Setup(src, dest); + renderer.EnqueuePass(blitPass); +#endif +#if UNITY_EDITOR + if (Application.isPlaying || settings.alwaysRender) { blitPass.Setup(src, dest); renderer.EnqueuePass(blitPass); } +#endif } } } \ No newline at end of file diff --git a/Assets/Shaders/CRTShader.shader b/Assets/Shaders/CRTShader.shader index 19694ee..109652d 100644 --- a/Assets/Shaders/CRTShader.shader +++ b/Assets/Shaders/CRTShader.shader @@ -6,10 +6,10 @@ Shader "CRTShader" u_time("Time",float) = 0.5 u_bend("Bend",range(0.5, 10.0)) = 0.5 u_space_bend("Space Bend",range(1.5, 2.5)) = 2.5 - u_scanlin_transparence1("Scanline 1 Transparence",range(0, 1)) = 0.5 + u_scanlin_transparence1("Scanline 1 Transparence",range(0, 0.5)) = 0.5 u_scanline_size_1("Scanline Size 1",range(0, 750)) = 0.5 u_scanline_speed_1("Scanline Speed 1",float) = 0.5 - u_scanlin_transparence2("Scanline 2 Transparence",range(0, 1)) = 0.5 + u_scanlin_transparence2("Scanline 2 Transparence",range(0, 0.5)) = 0.5 u_scanline_size_2("Scanline Size 2",range(0, 750)) = 0.5 u_scanline_speed_2("Scanline Speed 2",float) = 0.5 u_scanline_amount("Scanline Amount",range(0, 1)) = 0.5 @@ -17,7 +17,7 @@ Shader "CRTShader" u_vignette_smoothness("Vignette Smoothness",range(0, 2)) = 0.5 u_vignette_edge_round("Vignette Edge Round",range(0, 100)) = 0.5 u_noise_size("Noise Size",range(0, 500 )) = 0.5 - u_noise_amount("Noise Amount",range(0, 0.3)) = 0.5 + u_noise_amount("Noise Amount",range(0, 0.15)) = 0.5 u_red_offset_y("Red Offset",range(-0.01,0.01)) = 0 u_green_offset_y("Green Offset",range(-0.01,0.01)) = 0 u_blue_offset_y("Blue Offset",range(-0.01,0.01)) = 0 diff --git a/Assets/Sprites/MenuBackGround2.png b/Assets/Sprites/MenuBackGround2.png new file mode 100644 index 0000000..80cde8d Binary files /dev/null and b/Assets/Sprites/MenuBackGround2.png differ diff --git a/Assets/Sprites/MenuBackGround2.png.meta b/Assets/Sprites/MenuBackGround2.png.meta new file mode 100644 index 0000000..3469c88 --- /dev/null +++ b/Assets/Sprites/MenuBackGround2.png.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: f101856c7df715742a264dc02c835fb4 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Sprites/testAsesprite.png b/Assets/Sprites/testAsesprite.png index 3c29164..48d5f11 100644 Binary files a/Assets/Sprites/testAsesprite.png and b/Assets/Sprites/testAsesprite.png differ diff --git a/Assets/Sprites/testAsesprite.png.meta b/Assets/Sprites/testAsesprite.png.meta index 73cec51..00c6c1a 100644 --- a/Assets/Sprites/testAsesprite.png.meta +++ b/Assets/Sprites/testAsesprite.png.meta @@ -44,7 +44,7 @@ TextureImporter: compressionQuality: 50 spriteMode: 1 spriteExtrude: 1 - spriteMeshType: 1 + spriteMeshType: 0 alignment: 0 spritePivot: {x: 0.5, y: 0.5} spritePixelsToUnits: 32 diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index 85b67c8..f84443f 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -5,12 +5,12 @@ EditorBuildSettings: m_ObjectHideFlags: 0 serializedVersion: 2 m_Scenes: - - enabled: 1 - path: Assets/Scenes/SampleScene.unity - guid: 99c9720ab356a0642a771bea13969a05 - enabled: 1 path: Assets/Scenes/MainMenu.unity guid: af63aef6e17277b44ade3df35992db53 + - enabled: 1 + path: Assets/Scenes/LevelDesign.unity + guid: 4b213b8915c09ca49873cfadc143c61b m_configObjects: com.unity.input.settings: {fileID: 11400000, guid: 83b4255e269437642ad0474a7bdb56b5, type: 2}