From cd495f0a2c6151474e18ab59a7b506250ea95cf5 Mon Sep 17 00:00:00 2001 From: kimura Date: Thu, 19 May 2022 15:33:02 +0900 Subject: [PATCH] =?UTF-8?q?=E8=B2=A9=E5=A3=B2=E3=82=B7=E3=83=BC=E3=83=B3?= =?UTF-8?q?=E6=99=82=E8=A8=88=E6=8C=99=E5=8B=95=E6=94=B9=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/MyGame/Scenes/marketing/Scripts/ClockView.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ClockView.cs b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ClockView.cs index 06d26f93..9b6954d5 100644 --- a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ClockView.cs +++ b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ClockView.cs @@ -8,12 +8,14 @@ namespace MyGame.Scenes.marketing.Scripts { [SerializeField] private Transform shortNeedle; [SerializeField] private Transform longNeedle; + private readonly float timing = 60f; private void Start() { - Observable.Timer(TimeSpan.Zero, TimeSpan.FromSeconds(1f)) + Observable.Timer(TimeSpan.Zero, TimeSpan.FromSeconds(timing)) .Select(_ => DateTime.Now) .DistinctUntilChanged(x => x.Minute) + .StartWith(DateTime.Now) .Subscribe(x => { SetClock(x); @@ -22,8 +24,8 @@ namespace MyGame.Scenes.marketing.Scripts private void SetClock(DateTime dateTime) { - shortNeedle.localRotation = Quaternion.Euler(Vector3.forward * -dateTime.Hour * 30); - longNeedle.localRotation = Quaternion.Euler(Vector3.forward * -dateTime.Minute * 6); + shortNeedle.localRotation = Quaternion.Euler(Vector3.back * (dateTime.Hour * 30 + dateTime.Minute / 2)); + longNeedle.localRotation = Quaternion.Euler(Vector3.back * dateTime.Minute * 6); } } } \ No newline at end of file