diff --git a/popcorn/Assets/MyGame/Resources/CookingCityBackground/egg.prefab b/popcorn/Assets/MyGame/Resources/CookingCityBackground/egg.prefab index 7d7f3db9..91ba80d0 100644 --- a/popcorn/Assets/MyGame/Resources/CookingCityBackground/egg.prefab +++ b/popcorn/Assets/MyGame/Resources/CookingCityBackground/egg.prefab @@ -42,6 +42,7 @@ Transform: - {fileID: 8226655027800397041} - {fileID: 8226655027727252960} - {fileID: 8226655027527329895} + - {fileID: 3858276765338416229} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -1221,3 +1222,78 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!1001 &5516294652368967858 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 8226655026795209300} + m_Modifications: + - target: {fileID: 8720810031579491540, guid: 212311f8f2d546440b617b17fd52e2c7, + type: 3} + propertyPath: m_Name + value: Stove_egg + objectReference: {fileID: 0} + - target: {fileID: 8720810031579491543, guid: 212311f8f2d546440b617b17fd52e2c7, + type: 3} + propertyPath: m_RootOrder + value: 14 + objectReference: {fileID: 0} + - target: {fileID: 8720810031579491543, guid: 212311f8f2d546440b617b17fd52e2c7, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8720810031579491543, guid: 212311f8f2d546440b617b17fd52e2c7, + type: 3} + propertyPath: m_LocalPosition.y + value: -0.7 + objectReference: {fileID: 0} + - target: {fileID: 8720810031579491543, guid: 212311f8f2d546440b617b17fd52e2c7, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8720810031579491543, guid: 212311f8f2d546440b617b17fd52e2c7, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8720810031579491543, guid: 212311f8f2d546440b617b17fd52e2c7, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8720810031579491543, guid: 212311f8f2d546440b617b17fd52e2c7, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8720810031579491543, guid: 212311f8f2d546440b617b17fd52e2c7, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8720810031579491543, guid: 212311f8f2d546440b617b17fd52e2c7, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8720810031579491543, guid: 212311f8f2d546440b617b17fd52e2c7, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8720810031579491543, guid: 212311f8f2d546440b617b17fd52e2c7, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 212311f8f2d546440b617b17fd52e2c7, type: 3} +--- !u!4 &3858276765338416229 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 8720810031579491543, guid: 212311f8f2d546440b617b17fd52e2c7, + type: 3} + m_PrefabInstance: {fileID: 5516294652368967858} + m_PrefabAsset: {fileID: 0} diff --git a/popcorn/Assets/MyGame/Resources/CookingCityBackground/san_francisco.prefab b/popcorn/Assets/MyGame/Resources/CookingCityBackground/san_francisco.prefab index 70cc6d1d..5c08f575 100644 --- a/popcorn/Assets/MyGame/Resources/CookingCityBackground/san_francisco.prefab +++ b/popcorn/Assets/MyGame/Resources/CookingCityBackground/san_francisco.prefab @@ -208,6 +208,7 @@ Transform: - {fileID: 1280009694920302953} - {fileID: 1280009695515271182} - {fileID: 1280009695203480318} + - {fileID: 2512874792905478130} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -1221,3 +1222,78 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!1001 &3724086993657915414 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1280009694730620268} + m_Modifications: + - target: {fileID: 1256815649851434980, guid: 3a33d8d7453033b41b99825ebfbe2eb8, + type: 3} + propertyPath: m_RootOrder + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 1256815649851434980, guid: 3a33d8d7453033b41b99825ebfbe2eb8, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1256815649851434980, guid: 3a33d8d7453033b41b99825ebfbe2eb8, + type: 3} + propertyPath: m_LocalPosition.y + value: -0.7 + objectReference: {fileID: 0} + - target: {fileID: 1256815649851434980, guid: 3a33d8d7453033b41b99825ebfbe2eb8, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1256815649851434980, guid: 3a33d8d7453033b41b99825ebfbe2eb8, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1256815649851434980, guid: 3a33d8d7453033b41b99825ebfbe2eb8, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1256815649851434980, guid: 3a33d8d7453033b41b99825ebfbe2eb8, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1256815649851434980, guid: 3a33d8d7453033b41b99825ebfbe2eb8, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1256815649851434980, guid: 3a33d8d7453033b41b99825ebfbe2eb8, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1256815649851434980, guid: 3a33d8d7453033b41b99825ebfbe2eb8, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1256815649851434980, guid: 3a33d8d7453033b41b99825ebfbe2eb8, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1256815649851434983, guid: 3a33d8d7453033b41b99825ebfbe2eb8, + type: 3} + propertyPath: m_Name + value: Stove_san_francisco + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3a33d8d7453033b41b99825ebfbe2eb8, type: 3} +--- !u!4 &2512874792905478130 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1256815649851434980, guid: 3a33d8d7453033b41b99825ebfbe2eb8, + type: 3} + m_PrefabInstance: {fileID: 3724086993657915414} + m_PrefabAsset: {fileID: 0} diff --git a/popcorn/Assets/MyGame/Resources/Stove/Stove_egg.prefab b/popcorn/Assets/MyGame/Resources/Stove/Stove_egg.prefab index 98a3b970..cf9c0674 100644 --- a/popcorn/Assets/MyGame/Resources/Stove/Stove_egg.prefab +++ b/popcorn/Assets/MyGame/Resources/Stove/Stove_egg.prefab @@ -94,6 +94,7 @@ GameObject: m_Component: - component: {fileID: 8720810031579491543} - component: {fileID: 8720810031579491542} + - component: {fileID: 766889419793699269} m_Layer: 0 m_Name: Stove_egg m_TagString: Untagged @@ -169,6 +170,20 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!114 &766889419793699269 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8720810031579491540} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: df605f081cca4290bda5813fa3afa182, type: 3} + m_Name: + m_EditorClassIdentifier: + onToggle: {fileID: 8720810030160828339} + offToggle: {fileID: 8720810032052751358} --- !u!1 &8720810032052751358 GameObject: m_ObjectHideFlags: 0 diff --git a/popcorn/Assets/MyGame/Resources/Stove/Stove_san_francisco.prefab b/popcorn/Assets/MyGame/Resources/Stove/Stove_san_francisco.prefab index b93cb42a..6fb623c2 100644 --- a/popcorn/Assets/MyGame/Resources/Stove/Stove_san_francisco.prefab +++ b/popcorn/Assets/MyGame/Resources/Stove/Stove_san_francisco.prefab @@ -127,6 +127,7 @@ GameObject: m_Component: - component: {fileID: 1256815649851434980} - component: {fileID: 1256815649851434981} + - component: {fileID: 7462659463865863865} m_Layer: 0 m_Name: Stove_san_francisco m_TagString: Untagged @@ -202,6 +203,20 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!114 &7462659463865863865 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1256815649851434983} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: df605f081cca4290bda5813fa3afa182, type: 3} + m_Name: + m_EditorClassIdentifier: + onToggle: {fileID: 1256815650582092928} + offToggle: {fileID: 1256815649260585165} --- !u!1 &1256815650582092928 GameObject: m_ObjectHideFlags: 0 diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/PopcornGameManager.cs b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/PopcornGameManager.cs index c2ff6768..51b56e19 100644 --- a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/PopcornGameManager.cs +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/PopcornGameManager.cs @@ -53,7 +53,9 @@ public class PopcornGameManager : MonoBehaviour var cityDataList = SpreadsheetDataManager.Instance.GetBaseDataList(Const.CityDataSheet); var cityData = cityDataList.First(data => data.id == GameDataManager.GameData.CurrentCityId); cityBackGroundTarget.DestroyAllChildrens(); - Instantiate(cityData.GetCornFieldBgPrefab(), cityBackGroundTarget); + var stoveView = Instantiate(cityData.GetCookingBgPrefab(), cityBackGroundTarget).GetComponentInChildren(); + gameView.FireState.SkipLatestValueOnSubscribe().Subscribe(x => stoveView.SetActive(x)).AddTo(this); + thermalControl.Condition.Subscribe(x => { diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/PopcornGameView.cs b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/PopcornGameView.cs index 73b8d2ff..8fa8e3c6 100644 --- a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/PopcornGameView.cs +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/PopcornGameView.cs @@ -1,17 +1,23 @@ using System; +using UniRx; using UnityEngine; public class PopcornGameView : MonoBehaviour { [SerializeField] private GameObject startingGuide; - [SerializeField] private GameObject onToggle; - [SerializeField] private GameObject offToggle; [SerializeField] private GameObject fire; [SerializeField] private GameObject oilEffect; [SerializeField] private GameObject streamEffect; [SerializeField] private GameObject characterSweat; [SerializeField] private GameObject characterFlower; [SerializeField] private Transform panImageTarget; + private readonly BoolReactiveProperty fireState = new(); + public IReadOnlyReactiveProperty FireState => fireState; + + private void Start() + { + fireState.AddTo(this); + } public void ChangeUI(GameState state) { @@ -54,12 +60,11 @@ public class PopcornGameView : MonoBehaviour private void ChangeFireState(bool isActive) { + fireState.Value = isActive; if (isActive) { SoundManager.Instance.PlaySE("se_cooking_switch"); } - onToggle.SetActive(isActive); - offToggle.SetActive(!isActive); fire.SetActive(isActive); oilEffect.SetActive(isActive); } diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/StoveView.cs b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/StoveView.cs new file mode 100644 index 00000000..6d53a9f3 --- /dev/null +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/StoveView.cs @@ -0,0 +1,16 @@ +using UnityEngine; + +namespace MyGame.Scenes.Cooking.Scripts +{ + public class StoveView : MonoBehaviour + { + [SerializeField] private GameObject onToggle; + [SerializeField] private GameObject offToggle; + + public void SetActive(bool active) + { + onToggle.SetActive(active); + offToggle.SetActive(!active); + } + } +} \ No newline at end of file diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/StoveView.cs.meta b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/StoveView.cs.meta new file mode 100644 index 00000000..c20d70b0 --- /dev/null +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/StoveView.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: df605f081cca4290bda5813fa3afa182 +timeCreated: 1667293474 \ No newline at end of file diff --git a/popcorn/Assets/MyGame/Scripts/SpreadsheetData.cs b/popcorn/Assets/MyGame/Scripts/SpreadsheetData.cs index d7ede451..756f6b08 100644 --- a/popcorn/Assets/MyGame/Scripts/SpreadsheetData.cs +++ b/popcorn/Assets/MyGame/Scripts/SpreadsheetData.cs @@ -648,6 +648,11 @@ public sealed class CityData { return Resources.Load($"CornFieldCityBackground/{prefabName}"); } + + public Transform GetCookingBgPrefab() + { + return Resources.Load($"CookingCityBackground/{prefabName}"); + } } [Serializable]