From 3212ae212d800f01f79857b8f81a07f1406699dc Mon Sep 17 00:00:00 2001 From: kimura Date: Fri, 30 Sep 2022 12:15:48 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=AD=E3=83=83=E3=83=81=E3=83=B3=E3=81=AE?= =?UTF-8?q?=E3=83=90=E3=82=A4=E3=83=88=E3=82=A2=E3=83=8B=E3=83=A1=E3=83=BC?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=B3=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Resource/Animation/NormalBody.controller | 4 ++-- popcorn/Assets/MyGame/Scenes/Main/Main.unity | 11 +++++++++-- .../Scenes/Main/Scripts/KitchenManager.cs | 4 ++-- .../MyGame/Scenes/Main/Scripts/KitchenView.cs | 18 ++++++++++++++++-- popcorn/Assets/MyGame/Scripts/GameDataUtils.cs | 7 +++++++ 5 files changed, 36 insertions(+), 8 deletions(-) diff --git a/popcorn/Assets/MyGame/Resource/Animation/NormalBody.controller b/popcorn/Assets/MyGame/Resource/Animation/NormalBody.controller index 07de2898..3649af3d 100644 --- a/popcorn/Assets/MyGame/Resource/Animation/NormalBody.controller +++ b/popcorn/Assets/MyGame/Resource/Animation/NormalBody.controller @@ -178,7 +178,7 @@ AnimatorState: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: customer_Employment_stay_front + m_Name: customer_Employment_stay_front_Flyer m_Speed: 1 m_CycleOffset: 0 m_Transitions: [] @@ -516,7 +516,7 @@ AnimatorState: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: customer_Employment_stay_front 0 + m_Name: customer_Employment_stay_front m_Speed: 1 m_CycleOffset: 0 m_Transitions: [] diff --git a/popcorn/Assets/MyGame/Scenes/Main/Main.unity b/popcorn/Assets/MyGame/Scenes/Main/Main.unity index a616cf34..c76e997e 100644 --- a/popcorn/Assets/MyGame/Scenes/Main/Main.unity +++ b/popcorn/Assets/MyGame/Scenes/Main/Main.unity @@ -5398,6 +5398,12 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!95 &1555295522 stripped +Animator: + m_CorrespondingSourceObject: {fileID: 3318268871473007409, guid: 00e0cbb85389d424f9f75bbd5db123a8, + type: 3} + m_PrefabInstance: {fileID: 460559075} + m_PrefabAsset: {fileID: 0} --- !u!1 &1592053832 GameObject: m_ObjectHideFlags: 0 @@ -6467,7 +6473,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!4 &1823553375 Transform: m_ObjectHideFlags: 0 @@ -6814,6 +6820,7 @@ MonoBehaviour: m_EditorClassIdentifier: blueBrotherAnimator: {fileID: 1124341218} pinkBrotherAnimator: {fileID: 519190656} + partTimerAnimator: {fileID: 1555295522} pinkTransform: {fileID: 519190655} pinkWalkSpeed: 0.8 pinkLivelySpeed: 1 @@ -8130,7 +8137,7 @@ PrefabInstance: - target: {fileID: 1408184404978035950, guid: caaa748dbeed576499e8cae74d33f689, type: 3} propertyPath: m_RootOrder - value: 9 + value: 10 objectReference: {fileID: 0} - target: {fileID: 1750965193008879782, guid: caaa748dbeed576499e8cae74d33f689, type: 3} diff --git a/popcorn/Assets/MyGame/Scenes/Main/Scripts/KitchenManager.cs b/popcorn/Assets/MyGame/Scenes/Main/Scripts/KitchenManager.cs index 9c5394e1..6614bf63 100644 --- a/popcorn/Assets/MyGame/Scenes/Main/Scripts/KitchenManager.cs +++ b/popcorn/Assets/MyGame/Scenes/Main/Scripts/KitchenManager.cs @@ -51,7 +51,7 @@ public class KitchenManager : MonoBehaviour * バイト表示 * バイト開放の条件は最新店舗ではない都市(最新店舗以外はバイトが居る) */ - var isPartTimer = !GameDataUtils.CheckLatestCity(globalGameData.CurrentCityId); + var isPartTimer = GameDataUtils.IsPartTimerCurrentCity(); if (isPartTimer) { var partTimersData = SpreadsheetDataManager.Instance.GetBaseDataList(Const.PartTimerDataSheet); @@ -282,7 +282,7 @@ public class KitchenManager : MonoBehaviour SoundManager.Instance.StopSE("se_Main_phone_sound"); }).AddTo(this); - kitchenView.Initialize(); + kitchenView.Initialize(isPartTimer); adButton.OnClickAsObservable() .Merge(showAdDialogSubject) .ThrottleFirst(TimeSpan.FromSeconds(.3f)).Subscribe(_ => diff --git a/popcorn/Assets/MyGame/Scenes/Main/Scripts/KitchenView.cs b/popcorn/Assets/MyGame/Scenes/Main/Scripts/KitchenView.cs index fb898ac6..f1be4aaa 100644 --- a/popcorn/Assets/MyGame/Scenes/Main/Scripts/KitchenView.cs +++ b/popcorn/Assets/MyGame/Scenes/Main/Scripts/KitchenView.cs @@ -16,6 +16,7 @@ public class KitchenView : MonoBehaviour private static readonly int Vitality = Animator.StringToHash("Vitality"); [SerializeField] private Animator blueBrotherAnimator; [SerializeField] private Animator pinkBrotherAnimator; + [SerializeField] private Animator partTimerAnimator; [SerializeField] private Transform pinkTransform; [SerializeField] private float pinkWalkSpeed = .8f; [SerializeField] private float pinkLivelySpeed = .8f; @@ -43,10 +44,11 @@ public class KitchenView : MonoBehaviour private float completedDuration; private bool isLively; private (int trigger, Vector2 wayPoint, float wait)[] selectedMoves; + private bool partTimerActive; private void Start() { - this.UpdateAsObservable().Subscribe(_ => + this.UpdateAsObservable().Where(_ => !partTimerActive).Subscribe(_ => { var pinkSpeed = isLively ? pinkLivelySpeed : pinkWalkSpeed; var localPosition = pinkTransform.localPosition; @@ -70,9 +72,15 @@ public class KitchenView : MonoBehaviour }).AddTo(this); } - public void Initialize() + public void Initialize(bool isPartTimer) { moveIndex = 0; + partTimerActive = isPartTimer; + SetActive(true); + if (isPartTimer) + { + partTimerAnimator.Play("customer_Employment_stay_front"); + } } private void ChangeAnimation() @@ -117,6 +125,12 @@ public class KitchenView : MonoBehaviour } public void SetActive(bool active) + { + partTimerAnimator.transform.SetLocalScale(partTimerActive && active ? 1f : 0f); + SetBrotherActive(!partTimerActive && active); + } + + private void SetBrotherActive(bool active) { blueBrotherAnimator.transform.SetLocalScale(active ? 1f : 0f); pinkBrotherAnimator.transform.SetLocalScale(active ? 1f : 0f); diff --git a/popcorn/Assets/MyGame/Scripts/GameDataUtils.cs b/popcorn/Assets/MyGame/Scripts/GameDataUtils.cs index 7c8d4662..b3328ccf 100644 --- a/popcorn/Assets/MyGame/Scripts/GameDataUtils.cs +++ b/popcorn/Assets/MyGame/Scripts/GameDataUtils.cs @@ -4,6 +4,11 @@ namespace MyGame.Scripts { public static class GameDataUtils { + /// + /// 指定した都市が開放されてから兄弟が働いて獲得したハートの数 + /// + /// + /// public static int GetPartTimerHeart(int cityId) { var cityDataList = GameDataManager.GameData.CityGameDataDict.Values; @@ -57,5 +62,7 @@ namespace MyGame.Scripts dict.Add(cityId, newCityData); return dict[cityId]; } + + public static bool IsPartTimerCurrentCity() => !CheckLatestCity(GameDataManager.GameData.CurrentCityId); } } \ No newline at end of file