From dd4c8a2eb30652d14f0899fa029d08fdfa9eec1b Mon Sep 17 00:00:00 2001 From: Jens Pitkanen Date: Fri, 7 Aug 2020 02:06:00 +0300 Subject: [PATCH] Add 'read' command and remove some PP effects --- .../DefaultPostProcessingVolumeProfile.asset | 84 +------------------ Assets/Scripts/Util/PressedActionDisplayer.cs | 34 +++++++- 2 files changed, 32 insertions(+), 86 deletions(-) diff --git a/Assets/RenderPipeline/DefaultPostProcessingVolumeProfile.asset b/Assets/RenderPipeline/DefaultPostProcessingVolumeProfile.asset index 90596d6..df76464 100644 --- a/Assets/RenderPipeline/DefaultPostProcessingVolumeProfile.asset +++ b/Assets/RenderPipeline/DefaultPostProcessingVolumeProfile.asset @@ -20,7 +20,7 @@ MonoBehaviour: min: 0 intensity: m_OverrideState: 1 - m_Value: 0.8 + m_Value: 1 min: 0 scatter: m_OverrideState: 0 @@ -47,55 +47,6 @@ MonoBehaviour: m_OverrideState: 0 m_Value: 0 min: 0 ---- !u!114 &-3919862544555392601 -MonoBehaviour: - m_ObjectHideFlags: 3 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 29fa0085f50d5e54f8144f766051a691, type: 3} - m_Name: FilmGrain - m_EditorClassIdentifier: - active: 1 - m_AdvancedMode: 0 - type: - m_OverrideState: 0 - m_Value: 0 - intensity: - m_OverrideState: 1 - m_Value: 0.1 - min: 0 - max: 1 - response: - m_OverrideState: 0 - m_Value: 0.8 - min: 0 - max: 1 - texture: - m_OverrideState: 0 - m_Value: {fileID: 0} ---- !u!114 &-1329204002016237937 -MonoBehaviour: - m_ObjectHideFlags: 3 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 81180773991d8724ab7f2d216912b564, type: 3} - m_Name: ChromaticAberration - m_EditorClassIdentifier: - active: 1 - m_AdvancedMode: 0 - intensity: - m_OverrideState: 1 - m_Value: 0.05 - min: 0 - max: 1 --- !u!114 &11400000 MonoBehaviour: m_ObjectHideFlags: 0 @@ -111,39 +62,6 @@ MonoBehaviour: components: - {fileID: -8161577573876022021} - {fileID: 7991213835716202865} - - {fileID: 4212929005619836917} - - {fileID: -1329204002016237937} - - {fileID: -3919862544555392601} ---- !u!114 &4212929005619836917 -MonoBehaviour: - m_ObjectHideFlags: 3 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ccf1aba9553839d41ae37dd52e9ebcce, type: 3} - m_Name: MotionBlur - m_EditorClassIdentifier: - active: 1 - m_AdvancedMode: 0 - mode: - m_OverrideState: 0 - m_Value: 0 - quality: - m_OverrideState: 0 - m_Value: 0 - intensity: - m_OverrideState: 1 - m_Value: 0.5 - min: 0 - max: 1 - clamp: - m_OverrideState: 0 - m_Value: 0.05 - min: 0 - max: 0.2 --- !u!114 &7991213835716202865 MonoBehaviour: m_ObjectHideFlags: 3 diff --git a/Assets/Scripts/Util/PressedActionDisplayer.cs b/Assets/Scripts/Util/PressedActionDisplayer.cs index 6353245..fdf696e 100644 --- a/Assets/Scripts/Util/PressedActionDisplayer.cs +++ b/Assets/Scripts/Util/PressedActionDisplayer.cs @@ -1,5 +1,6 @@ using UnityEngine; using UnityEngine.InputSystem; +using NeonTea.Quakeball.Interface; namespace NeonTea.Quakeball.Util { public class PressedActionDisplayer : MonoBehaviour { @@ -7,6 +8,7 @@ namespace NeonTea.Quakeball.Util { private InputAction AnyAction; private InputActionRebindingExtensions.RebindingOperation Rebinding; + private bool InitializedFromTerminal = false; private void Awake() { AnyAction = new InputAction("InputAction displayer", binding: "*/*"); @@ -14,16 +16,42 @@ namespace NeonTea.Quakeball.Util { Initializer = new InputAction("Display the next InputAction", binding: "/f1"); Initializer.Enable(); Initializer.performed += _ => { - Debug.Log("Waiting for InputAction to display..."); - Rebinding = AnyAction.PerformInteractiveRebinding().Start(); + InitializedFromTerminal = false; + StartWaiting(); }; + + Terminal.Singleton.RegisterCommand("read", args => { + if (args.Length == 0) { + InitializedFromTerminal = true; + StartWaiting(); + return true; + } else { + Terminal.Singleton.AddMessage($"The 'read' command takes no arguments."); + return false; + } + }); + } + + private void StartWaiting() { + if (!InitializedFromTerminal) { + Debug.Log("Waiting for InputAction to display..."); + } else { + Terminal.Singleton.AddMessage("Waiting for InputAction to display..."); + } + Rebinding = AnyAction.PerformInteractiveRebinding().Start(); } private void Update() { if (Rebinding != null && Rebinding.completed) { string Binding = Rebinding.action.ToString(); + Rebinding.Dispose(); int Index = Binding.IndexOf("/") + 1; - Debug.Log(Binding.Substring(Index, Binding.Length - Index - 1)); + Binding = Binding.Substring(Index, Binding.Length - Index - 1); + if (!InitializedFromTerminal) { + Debug.Log("Binding: " + Binding); + } else { + Terminal.Singleton.AddMessage("Binding: " + Binding); + } Rebinding = null; } }