From 8ccbe52a1821a8f7452f736ad4afd363f136bf8f Mon Sep 17 00:00:00 2001 From: kimura Date: Thu, 13 Oct 2022 19:13:46 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=90=E3=82=A4=E3=83=88=E5=90=9BScale?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scenes/marketing/Scripts/PartTimerView.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/PartTimerView.cs b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/PartTimerView.cs index d6da0729..344d4f5f 100644 --- a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/PartTimerView.cs +++ b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/PartTimerView.cs @@ -8,23 +8,30 @@ namespace MyGame.Scenes.marketing.Scripts [SerializeField] private Transform frontPos; [SerializeField] private Transform shopPos; private bool isPartTimer; + private float orgScale; + + private void Awake() + { + orgScale = partTimerAnimator.transform.localScale.x; + } public void SetActive(bool active) { partTimerAnimator.speed = active ? 1f : 0f; - partTimerAnimator.transform.SetLocalScale(active ? 1f : 0f); + partTimerAnimator.transform.SetLocalScale(active ? orgScale : 0f); } public void StartAnimation(bool isPartTimerMode) { isPartTimer = isPartTimerMode; + var animatorTransform = partTimerAnimator.transform; + animatorTransform.SetParent(isPartTimerMode ? shopPos : frontPos); + animatorTransform.localPosition = Vector3.zero; if (isPartTimerMode) { - partTimerAnimator.transform.SetParent(shopPos, false); partTimerAnimator.Play("customer_Employment_stay_front"); return; } - partTimerAnimator.transform.SetParent(frontPos, false); partTimerAnimator.Play("customer_Employment_stay_front_Flyer"); }