diff --git a/Assets/RenderAssets/URP Asset Renderer.asset b/Assets/RenderAssets/URP Asset Renderer.asset index 544af25..46f5669 100644 --- a/Assets/RenderAssets/URP Asset Renderer.asset +++ b/Assets/RenderAssets/URP Asset Renderer.asset @@ -34,7 +34,7 @@ MonoBehaviour: - name: Additive with Mask maskTextureChannel: 1 blendMode: 0 - m_UseDepthStencilBuffer: 1 + m_UseDepthStencilBuffer: 0 m_UseCameraSortingLayersTexture: 0 m_CameraSortingLayersTextureBound: -1 m_CameraSortingLayerDownsamplingMethod: 0 diff --git a/Assets/RenderAssets/URP Asset.asset b/Assets/RenderAssets/URP Asset.asset index 6f58113..ec51328 100644 --- a/Assets/RenderAssets/URP Asset.asset +++ b/Assets/RenderAssets/URP Asset.asset @@ -61,7 +61,7 @@ MonoBehaviour: m_MixedLightingSupported: 1 m_SupportsLightLayers: 0 m_DebugLevel: 0 - m_UseAdaptivePerformance: 1 + m_UseAdaptivePerformance: 0 m_ColorGradingMode: 0 m_ColorGradingLutSize: 32 m_UseFastSRGBLinearConversion: 0 diff --git a/Assets/Scripts/Dimensions.cs b/Assets/Scripts/Dimensions.cs index 658a3b3..93746f4 100644 --- a/Assets/Scripts/Dimensions.cs +++ b/Assets/Scripts/Dimensions.cs @@ -1,7 +1,6 @@ using System; using UnityEngine; -[ExecuteInEditMode] public class Dimensions : MonoBehaviour { [Tooltip("How much height for player panels")] public float panelHeightPercentage; @@ -18,8 +17,18 @@ public class Dimensions : MonoBehaviour { public SpriteRenderer background; public static Dimensions Singleton; - private void OnEnable() { + private void Awake() { Singleton = this; + GetComponents(); + } + + private void OnValidate() { + GetComponents(); + } + + private void GetComponents() { + topL = topC.GetComponent(); + bottomL = bottomC.GetComponent(); } public float top, bottom, left, right; @@ -30,11 +39,6 @@ public class Dimensions : MonoBehaviour { private LineRenderer topL, bottomL; - private void OnValidate() { - topL = topC.GetComponent(); - bottomL = bottomC.GetComponent(); - } - private void Update() { float height = mainCamera.orthographicSize * 2; float panelHeight = height * panelHeightPercentage / 100f; diff --git a/Assets/Scripts/Dimensions.cs.meta b/Assets/Scripts/Dimensions.cs.meta index 0a5ff89..990e77d 100644 --- a/Assets/Scripts/Dimensions.cs.meta +++ b/Assets/Scripts/Dimensions.cs.meta @@ -1,3 +1,11 @@ fileFormatVersion: 2 guid: 572c5b8dd6a94b3585befaa50a883755 -timeCreated: 1680781703 \ No newline at end of file +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: -10 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Game/GameManager.cs b/Assets/Scripts/Game/GameManager.cs index 903832b..89cf81c 100644 --- a/Assets/Scripts/Game/GameManager.cs +++ b/Assets/Scripts/Game/GameManager.cs @@ -16,6 +16,10 @@ namespace Game { private void OnEnable() { Singleton = this; + + // Move this to settings + Application.targetFrameRate = 144; + QualitySettings.vSyncCount = 0; } public Object ballPrefab; diff --git a/Assets/Scripts/Game/Player.cs b/Assets/Scripts/Game/Player.cs index 3c3bd77..c83f0d9 100644 --- a/Assets/Scripts/Game/Player.cs +++ b/Assets/Scripts/Game/Player.cs @@ -1,14 +1,9 @@ using System; -using System.Collections; using System.Collections.Generic; using System.Linq; -using System.Transactions; using Unity.Netcode; -using UnityEditor; -using UnityEditor.UIElements; using UnityEngine; using UnityEngine.InputSystem; -using UnityEngine.Serialization; using UnityEngine.UIElements; namespace Game { @@ -42,8 +37,8 @@ namespace Game { } // Unit distance from zero - private readonly float baseBorder = Dimensions.Singleton.Width / 2 * 0.8f; - private readonly float borderSummand = Dimensions.Singleton.Width / 2 * 0.2f; + private readonly float baseBorder = Dimensions.Singleton.Width / 2 * 0.9f; + private readonly float borderSummand = Dimensions.Singleton.Width / 2 * 0.1f; protected float Border { get { return Mathf.Min(Modifications.Where(m => m.Properties.effect == ModEffect.Border) diff --git a/Assets/Scripts/GameUI.cs b/Assets/Scripts/GameUI.cs index 72944eb..0db1e40 100644 --- a/Assets/Scripts/GameUI.cs +++ b/Assets/Scripts/GameUI.cs @@ -2,9 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; using Game; -using UnityEditor.UIElements; using UnityEngine; -using UnityEngine.Assertions; using UnityEngine.UIElements; public class GameUI : MonoBehaviour { @@ -52,24 +50,25 @@ public class GameUI : MonoBehaviour { float heightPercentage = Dimensions.Singleton.panelHeightPercentage; PlayerPanel(Side.Top).style.height = PlayerPanel(Side.Bottom).style.height = Length.Percent(heightPercentage); - SetupButtons(Side.Top); - SetupButtons(Side.Bottom); + SetupGoButton(Side.Top, "left"); + SetupGoButton(Side.Top, "right"); + SetupGoButton(Side.Bottom, "left"); + SetupGoButton(Side.Bottom, "right"); } - public delegate void ButtonDown(Side side, string direction); + public delegate void ButtonDown(Side verticalSide, string horizontalSide); public delegate void ButtonUp(Side side, string direction); public ButtonDown buttonDown; public ButtonUp buttonUp; - private void SetupButtons(Side side) { - Button btnLeft = PlayerPanel(side).Q