diff --git a/Assets/Scenes/TestScene.unity b/Assets/Scenes/TestScene.unity index b4bbc15..2004648 100644 --- a/Assets/Scenes/TestScene.unity +++ b/Assets/Scenes/TestScene.unity @@ -97,7 +97,7 @@ LightmapSettings: m_ExportTrainingData: 0 m_TrainingDataDestination: TrainingData m_LightProbeSampleCountMultiplier: 4 - m_LightingDataAsset: {fileID: 112000000, guid: 34a8b00aa8bba4449a5285eb76698434, type: 2} + m_LightingDataAsset: {fileID: 112000000, guid: d320c7848150f754dbf371825f1b378c, type: 2} m_LightingSettings: {fileID: 4890085278179872738, guid: eab3e4c589c0a1147a910511c80f5e0c, type: 2} --- !u!196 &4 NavMeshSettings: @@ -4267,7 +4267,7 @@ Transform: - {fileID: 1734890299} - {fileID: 529416814} m_Father: {fileID: 0} - m_RootOrder: 5 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &205498803 GameObject: @@ -5155,7 +5155,7 @@ Transform: - {fileID: 1533302259} - {fileID: 129354770} m_Father: {fileID: 0} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &529416811 GameObject: @@ -8079,6 +8079,37 @@ Mesh: offset: 0 size: 0 path: +--- !u!1 &875920202 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 875920203} + m_Layer: 0 + m_Name: Debug + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &875920203 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 875920202} + 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: 1931179857} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &913024989 GameObject: m_ObjectHideFlags: 0 @@ -9832,7 +9863,7 @@ Transform: - {fileID: 594137574} - {fileID: 1609014458} m_Father: {fileID: 0} - m_RootOrder: 3 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1104743577 GameObject: @@ -10392,7 +10423,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 6 + m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} --- !u!1 &1210745934 GameObject: @@ -12602,7 +12633,7 @@ Transform: - {fileID: 1870782421} - {fileID: 1220168323} m_Father: {fileID: 0} - m_RootOrder: 4 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1494157025 GameObject: @@ -17271,7 +17302,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1756963543 GameObject: @@ -17980,6 +18011,49 @@ Light: m_UseBoundingSphereOverride: 0 m_ShadowRadius: 0 m_ShadowAngle: 0 +--- !u!1 &1931179856 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1931179857} + - component: {fileID: 1931179858} + m_Layer: 0 + m_Name: PressedActionDisplayer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1931179857 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1931179856} + 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: 875920203} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1931179858 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1931179856} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 801f25d33af5f3544bb267095351b25f, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!43 &1991269797 Mesh: m_ObjectHideFlags: 0 @@ -18519,6 +18593,18 @@ PrefabInstance: propertyPath: Player value: objectReference: {fileID: 1711551243} + - target: {fileID: 5023538681700148317, guid: 68b0b7d9f7cd54f4a9f3382b9452d809, type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5023538681700148317, guid: 68b0b7d9f7cd54f4a9f3382b9452d809, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5023538681700148317, guid: 68b0b7d9f7cd54f4a9f3382b9452d809, type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 68b0b7d9f7cd54f4a9f3382b9452d809, type: 3} --- !u!1001 &7391558912839012296 @@ -18562,7 +18648,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7391558912774766616, guid: 0bffd92c46c257840806f5e957954800, type: 3} propertyPath: m_RootOrder - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 7391558912774766616, guid: 0bffd92c46c257840806f5e957954800, type: 3} propertyPath: m_LocalEulerAnglesHint.x diff --git a/Assets/Scripts/Options.cs b/Assets/Scripts/Options.cs index 1f92f03..56e697f 100644 --- a/Assets/Scripts/Options.cs +++ b/Assets/Scripts/Options.cs @@ -38,9 +38,11 @@ namespace NeonTea.Quakeball { OptionsData Options = (OptionsData)Serializer.Deserialize(OptionsFile); OptionsFile.Close(); return Options; - } catch (Exception) { - return new OptionsData(); + } catch (FileLoadException) { + } catch (Exception ex) { + Debug.LogWarning(ex); } + return new OptionsData(); } } } diff --git a/Assets/Scripts/Util.meta b/Assets/Scripts/Util.meta new file mode 100644 index 0000000..ef18802 --- /dev/null +++ b/Assets/Scripts/Util.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 21a503016fa1e364f92d125a27f4b2c4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Util/PressedActionDisplayer.cs b/Assets/Scripts/Util/PressedActionDisplayer.cs new file mode 100644 index 0000000..6353245 --- /dev/null +++ b/Assets/Scripts/Util/PressedActionDisplayer.cs @@ -0,0 +1,31 @@ +using UnityEngine; +using UnityEngine.InputSystem; + +namespace NeonTea.Quakeball.Util { + public class PressedActionDisplayer : MonoBehaviour { + private InputAction Initializer; + private InputAction AnyAction; + + private InputActionRebindingExtensions.RebindingOperation Rebinding; + + private void Awake() { + AnyAction = new InputAction("InputAction displayer", binding: "*/*"); + + Initializer = new InputAction("Display the next InputAction", binding: "/f1"); + Initializer.Enable(); + Initializer.performed += _ => { + Debug.Log("Waiting for InputAction to display..."); + Rebinding = AnyAction.PerformInteractiveRebinding().Start(); + }; + } + + private void Update() { + if (Rebinding != null && Rebinding.completed) { + string Binding = Rebinding.action.ToString(); + int Index = Binding.IndexOf("/") + 1; + Debug.Log(Binding.Substring(Index, Binding.Length - Index - 1)); + Rebinding = null; + } + } + } +} diff --git a/Assets/Scripts/Util/PressedActionDisplayer.cs.meta b/Assets/Scripts/Util/PressedActionDisplayer.cs.meta new file mode 100644 index 0000000..3efb6ab --- /dev/null +++ b/Assets/Scripts/Util/PressedActionDisplayer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 801f25d33af5f3544bb267095351b25f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: