From aa58935fecfed1420399b37cd9fa6aed5e342820 Mon Sep 17 00:00:00 2001 From: kimura Date: Mon, 5 Jul 2021 14:23:46 +0900 Subject: [PATCH] =?UTF-8?q?namespace=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyGame/Scenes/Cooking/Scripts/Pan.cs | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/Pan.cs b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/Pan.cs index 778ba87c..7aa5848b 100644 --- a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/Pan.cs +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/Pan.cs @@ -1,21 +1,18 @@ using System; using UnityEngine; -namespace MyGame.Scenes.Main +public class Pan : MonoBehaviour { - public class Pan : MonoBehaviour - { - [SerializeField] private PanController controller; - [SerializeField] private float thrust; + [SerializeField] private PanController controller; + [SerializeField] private float thrust; - private void OnTriggerStay2D(Collider2D other) - { - // Debug.Log(controller.Direction); - // 移動量が少ないときは動かない - // if (controller.Delta.magnitude >= 1f) Debug.Log(controller.Delta.magnitude); - var direct = 1f; - direct = controller.Delta.magnitude < 0.1f ? 0 : 1; - other.attachedRigidbody.AddForce(controller.Delta * thrust * direct, ForceMode2D.Impulse); - } + private void OnTriggerStay2D(Collider2D other) + { + // Debug.Log(controller.Direction); + // 移動量が少ないときは動かない + // if (controller.Delta.magnitude >= 1f) Debug.Log(controller.Delta.magnitude); + var direct = 1f; + direct = controller.Delta.magnitude < 0.1f ? 0 : 1; + other.attachedRigidbody.AddForce(controller.Delta * thrust * direct, ForceMode2D.Impulse); } } \ No newline at end of file