From 73fad024c0f02aa16a037eef9aa170ef7db1e818 Mon Sep 17 00:00:00 2001 From: henrisel Date: Sun, 1 Mar 2026 13:44:40 +0200 Subject: [PATCH] made radio button collision less flaky --- 3d-generation-pipeline/README.md | 2 +- .../_PROJECT/Fonts/Quantico-Regular SDF.asset | 4 +-- .../ModeGeneration/ReleasableButton.cs | 14 ++++++--- .../ShapeDetection/ButtonTrigger.cs | 31 +++++++++++++++++++ .../ShapeDetection/ButtonTrigger.cs.meta | 11 +++++++ 5 files changed, 55 insertions(+), 7 deletions(-) create mode 100644 Assets/_PROJECT/Scripts/ModeGeneration/ShapeDetection/ButtonTrigger.cs create mode 100644 Assets/_PROJECT/Scripts/ModeGeneration/ShapeDetection/ButtonTrigger.cs.meta diff --git a/3d-generation-pipeline/README.md b/3d-generation-pipeline/README.md index f5a7c968..9619cbfc 100644 --- a/3d-generation-pipeline/README.md +++ b/3d-generation-pipeline/README.md @@ -15,7 +15,7 @@ * shape detection: * raadio nupp võiks töötada recording mode'is, mitte streamina - kui lased lahti, siis hakkab processima * professor võiks öelda "good job, continue..." pärast esimest successi - * kui kõik configurationid tehtud, siis professor ütleb "thank you" + * kui kõik configurationid tehtud, siis professor ütleb "thank you" * peab mängijale kuidagi selgitama, kuidas scale'ida prinditud objekte * prinditud objekti scale'imisele min ja max size limiit * archery range: diff --git a/Assets/_PROJECT/Fonts/Quantico-Regular SDF.asset b/Assets/_PROJECT/Fonts/Quantico-Regular SDF.asset index 7f203143..9fe12e2c 100644 --- a/Assets/_PROJECT/Fonts/Quantico-Regular SDF.asset +++ b/Assets/_PROJECT/Fonts/Quantico-Regular SDF.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5e3d6effe83965263a7f57fc4da5b9796c6b2d25b429b0f0a22b409ef7a0d88f -size 2113086 +oid sha256:3f0236d35b185c8b3c8f70270040d7f9efdbac5383f949b3c8a60a9cc296ee55 +size 2125671 diff --git a/Assets/_PROJECT/Scripts/ModeGeneration/ReleasableButton.cs b/Assets/_PROJECT/Scripts/ModeGeneration/ReleasableButton.cs index 678eb5d9..d8f2baf0 100644 --- a/Assets/_PROJECT/Scripts/ModeGeneration/ReleasableButton.cs +++ b/Assets/_PROJECT/Scripts/ModeGeneration/ReleasableButton.cs @@ -55,15 +55,21 @@ public class ReleasableButton : MonoBehaviour private void Activate() { - movableParts.DOLocalMoveY(downPositionY, moveDuration); - isButtonDown = true; + movableParts.DOLocalMoveY(downPositionY, moveDuration).OnComplete(() => + { + isButtonDown = true; + }); + AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, gameObject); } private void Deactivate() { - movableParts.DOLocalMoveY(upPositionY, moveDuration); - isButtonDown = false; + movableParts.DOLocalMoveY(upPositionY, moveDuration).OnComplete(() => + { + isButtonDown = false; + }); + AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, gameObject); } } diff --git a/Assets/_PROJECT/Scripts/ModeGeneration/ShapeDetection/ButtonTrigger.cs b/Assets/_PROJECT/Scripts/ModeGeneration/ShapeDetection/ButtonTrigger.cs new file mode 100644 index 00000000..4aa68467 --- /dev/null +++ b/Assets/_PROJECT/Scripts/ModeGeneration/ShapeDetection/ButtonTrigger.cs @@ -0,0 +1,31 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class ButtonTrigger : MonoBehaviour +{ + public bool isEnter; + public ReleasableButton button; + + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + + } + + private void OnTriggerEnter(Collider other) + { + + } + + private void OnTriggerExit(Collider other) + { + + } +} diff --git a/Assets/_PROJECT/Scripts/ModeGeneration/ShapeDetection/ButtonTrigger.cs.meta b/Assets/_PROJECT/Scripts/ModeGeneration/ShapeDetection/ButtonTrigger.cs.meta new file mode 100644 index 00000000..9b86af2b --- /dev/null +++ b/Assets/_PROJECT/Scripts/ModeGeneration/ShapeDetection/ButtonTrigger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 26d1ade0a3771324eb46882393dce30a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: