0.3.2.14 업데이트

This commit is contained in:
NTG_Lenovo 2024-10-29 15:45:18 +09:00
parent 723c2598ac
commit 1dcd03e018
24 changed files with 277 additions and 206 deletions

View File

@ -5778,6 +5778,20 @@ Transform:
m_Children: []
m_Father: {fileID: 1360757596}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &480314625
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fc1515ab76e54f068e2f2207940fab32, type: 3}
m_Name: UI/Point
m_EditorClassIdentifier:
m_Asset: {fileID: -944628639613478452, guid: 4ed6540e2f7ce234888adf8deff1f241, type: 3}
m_ActionId: 52083aa7-62f5-41d7-b37e-4db100ef2cda
--- !u!1 &510358306
GameObject:
m_ObjectHideFlags: 0
@ -6026,6 +6040,20 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 510483949}
m_CullTransparentMesh: 1
--- !u!114 &512160919
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fc1515ab76e54f068e2f2207940fab32, type: 3}
m_Name: UI/TrackedDeviceOrientation
m_EditorClassIdentifier:
m_Asset: {fileID: -944628639613478452, guid: 4ed6540e2f7ce234888adf8deff1f241, type: 3}
m_ActionId: 7f4f45c6-67b1-47bf-9a74-fea6f6b5fde1
--- !u!1001 &515003792
PrefabInstance:
m_ObjectHideFlags: 0
@ -6628,6 +6656,20 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 547484572}
m_CullTransparentMesh: 1
--- !u!114 &561341741
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fc1515ab76e54f068e2f2207940fab32, type: 3}
m_Name: UI/ScrollWheel
m_EditorClassIdentifier:
m_Asset: {fileID: -944628639613478452, guid: 4ed6540e2f7ce234888adf8deff1f241, type: 3}
m_ActionId: 30ef3965-cc51-452e-8df9-6a3567a53f4d
--- !u!1001 &566176540
PrefabInstance:
m_ObjectHideFlags: 0
@ -11414,6 +11456,20 @@ MonoBehaviour:
m_Spacing: {x: 10, y: 10}
m_Constraint: 0
m_ConstraintCount: 2
--- !u!114 &992297820
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fc1515ab76e54f068e2f2207940fab32, type: 3}
m_Name: UI/TrackedDevicePosition
m_EditorClassIdentifier:
m_Asset: {fileID: -944628639613478452, guid: 4ed6540e2f7ce234888adf8deff1f241, type: 3}
m_ActionId: 49ed4722-bfe5-47b7-b724-008d9ca57edc
--- !u!1 &1006730364
GameObject:
m_ObjectHideFlags: 0
@ -12060,6 +12116,20 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1058006973}
m_CullTransparentMesh: 1
--- !u!114 &1063900526
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fc1515ab76e54f068e2f2207940fab32, type: 3}
m_Name: UI/Navigate
m_EditorClassIdentifier:
m_Asset: {fileID: -944628639613478452, guid: 4ed6540e2f7ce234888adf8deff1f241, type: 3}
m_ActionId: 66824a18-0819-44a4-92c2-6395511e3d0d
--- !u!1 &1070845212
GameObject:
m_ObjectHideFlags: 0
@ -18806,6 +18876,20 @@ MonoBehaviour:
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!114 &1543616885
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fc1515ab76e54f068e2f2207940fab32, type: 3}
m_Name: UI/RightClick
m_EditorClassIdentifier:
m_Asset: {fileID: -944628639613478452, guid: 4ed6540e2f7ce234888adf8deff1f241, type: 3}
m_ActionId: 4849bf4c-7b3b-43c4-8bbf-7178f536fb94
--- !u!1 &1543999676
GameObject:
m_ObjectHideFlags: 0
@ -19611,17 +19695,17 @@ MonoBehaviour:
m_MoveRepeatDelay: 0.5
m_MoveRepeatRate: 0.1
m_XRTrackingOrigin: {fileID: 0}
m_ActionsAsset: {fileID: -944628639613478452, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_PointAction: {fileID: -1654692200621890270, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_MoveAction: {fileID: -8784545083839296357, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_SubmitAction: {fileID: 392368643174621059, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_CancelAction: {fileID: 7727032971491509709, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_LeftClickAction: {fileID: 3001919216989983466, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_MiddleClickAction: {fileID: -2185481485913320682, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_RightClickAction: {fileID: -4090225696740746782, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_ScrollWheelAction: {fileID: 6240969308177333660, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_TrackedDevicePositionAction: {fileID: 6564999863303420839, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_TrackedDeviceOrientationAction: {fileID: 7970375526676320489, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_ActionsAsset: {fileID: -944628639613478452, guid: 4ed6540e2f7ce234888adf8deff1f241, type: 3}
m_PointAction: {fileID: 480314625}
m_MoveAction: {fileID: 1063900526}
m_SubmitAction: {fileID: 1861358548}
m_CancelAction: {fileID: -1967631576421560919, guid: 4ed6540e2f7ce234888adf8deff1f241, type: 3}
m_LeftClickAction: {fileID: 1688493664}
m_MiddleClickAction: {fileID: 1972034606}
m_RightClickAction: {fileID: 1543616885}
m_ScrollWheelAction: {fileID: 561341741}
m_TrackedDevicePositionAction: {fileID: 992297820}
m_TrackedDeviceOrientationAction: {fileID: 512160919}
m_DeselectOnBackgroundClick: 1
m_PointerBehavior: 0
m_CursorLockBehavior: 0
@ -21021,6 +21105,20 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1676572567}
m_CullTransparentMesh: 1
--- !u!114 &1688493664
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fc1515ab76e54f068e2f2207940fab32, type: 3}
m_Name: UI/Click
m_EditorClassIdentifier:
m_Asset: {fileID: -944628639613478452, guid: 4ed6540e2f7ce234888adf8deff1f241, type: 3}
m_ActionId: 42e6067b-0d00-4787-92d8-ddf60510de83
--- !u!1 &1688541096
GameObject:
m_ObjectHideFlags: 0
@ -24382,6 +24480,20 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1858836598}
m_CullTransparentMesh: 1
--- !u!114 &1861358548
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fc1515ab76e54f068e2f2207940fab32, type: 3}
m_Name: UI/Submit
m_EditorClassIdentifier:
m_Asset: {fileID: -944628639613478452, guid: 4ed6540e2f7ce234888adf8deff1f241, type: 3}
m_ActionId: 93ed1c14-2900-4d30-91fb-a9f2353a9540
--- !u!1 &1862417069
GameObject:
m_ObjectHideFlags: 0
@ -25791,6 +25903,20 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1966407669}
m_CullTransparentMesh: 1
--- !u!114 &1972034606
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fc1515ab76e54f068e2f2207940fab32, type: 3}
m_Name: UI/MiddleClick
m_EditorClassIdentifier:
m_Asset: {fileID: -944628639613478452, guid: 4ed6540e2f7ce234888adf8deff1f241, type: 3}
m_ActionId: b99f7e4b-30f0-4936-9e55-c383951d6f58
--- !u!1 &1978509263
GameObject:
m_ObjectHideFlags: 0
@ -29267,6 +29393,10 @@ PrefabInstance:
propertyPath: m_LocalRotation.z
value: 0.32760355
objectReference: {fileID: 0}
- target: {fileID: 6054159730444663926, guid: 9ce588004bafc1e4e9617fdaa2d77c8d, type: 3}
propertyPath: m_UIInputModule
value:
objectReference: {fileID: 1619849091}
- target: {fileID: 6110939913361161778, guid: 9ce588004bafc1e4e9617fdaa2d77c8d, type: 3}
propertyPath: m_LocalPosition.x
value: -0.01015869

View File

@ -144,7 +144,7 @@ namespace BlueWater.Players.Combat
{
if (context.performed)
{
CombatUiManager.Instance.CombatItemInventoryUi.Open(CombatUiManager.Instance.PopupUiList);
CombatUiManager.Instance.CombatItemInventoryUi.Open();
}
}
@ -162,7 +162,7 @@ namespace BlueWater.Players.Combat
{
if (context.performed)
{
CombatUiManager.Instance.CombatMenuPopupUi.Open(CombatUiManager.Instance.PopupUiList);
CombatUiManager.Instance.CombatMenuPopupUi.Open();
}
}
@ -170,7 +170,7 @@ namespace BlueWater.Players.Combat
{
if (context.performed)
{
CombatUiManager.Instance.DevelopMenuPopupUi.Open(CombatUiManager.Instance.PopupUiList);
CombatUiManager.Instance.DevelopMenuPopupUi.Open();
}
}
@ -194,7 +194,7 @@ namespace BlueWater.Players.Combat
{
if (context.performed)
{
CombatUiManager.Instance.CloseLastPopup();
PopupUiController.CloseLastPopup();
}
}

View File

@ -170,7 +170,7 @@ namespace BlueWater.Players.Combat
yield return new WaitForSeconds(1f);
Destroy(gameObject);
CombatUiManager.Instance.GameOverPopupUi.Open(CombatUiManager.Instance.PopupUiList);
CombatUiManager.Instance.GameOverPopupUi.Open();
}
public void ActivateInvincibility() => PlayerHealthPoint.ActivateInvincibility();

View File

@ -1,4 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using BlueWater.Interfaces;
using BlueWater.Tycoons;
@ -37,7 +38,7 @@ namespace BlueWater.Players.Tycoons
private void Start()
{
Initialize();
StartCoroutine(nameof(Initialize));
}
private void Update()
@ -71,11 +72,14 @@ namespace BlueWater.Players.Tycoons
_playerInput = GetComponent<PlayerInput>();
}
private void Initialize()
private IEnumerator Initialize()
{
_playerInput.enabled = true;
PlayerInputKeyManager.Instance.SetCurrentPlayerInput(_playerInput);
yield return new WaitUntil(() => _playerInput.IsInitialized());
PlayerInputKeyManager.Instance.DisableAllActionMaps();
PlayerInputKeyManager.Instance.SwitchCurrentActionMap(InputActionMaps.Tycoon);
EventManager.InvokeInitializedPlayerInput();
}
#endregion
@ -116,7 +120,7 @@ namespace BlueWater.Players.Tycoons
{
if (context.performed)
{
TycoonUiManager.Instance.ManualBook.Open(TycoonUiManager.Instance.PopupUiList);
TycoonUiManager.Instance.ManualBook.Open();
}
}
@ -125,7 +129,7 @@ namespace BlueWater.Players.Tycoons
{
if (context.performed)
{
TycoonUiManager.Instance.CloseLastPopup();
PopupUiController.CloseLastPopup();
}
}

View File

@ -4,7 +4,6 @@ using BlueWater.Npcs.Crews.Bartender;
using BlueWater.Npcs.Crews.Cleaner;
using BlueWater.Npcs.Crews.Server;
using BlueWater.Npcs.Customers;
using BlueWater.Tycoons;
using UnityEngine;
namespace BlueWater
@ -14,6 +13,12 @@ namespace BlueWater
// Global events
#region Global events
public static Action OnInitializedPlayerInput;
public static void InvokeInitializedPlayerInput()
{
OnInitializedPlayerInput?.Invoke();
}
// Ui
public static Action<float, float, Color?, float> OnFadeInOut;
public static void InvokeFadeInOut(float fadeInTime, float fadeOutTime, Color? fadeColor = null, float delayAfterFadeIn = 0f)

View File

@ -620,7 +620,7 @@
"path": "<Keyboard>/e",
"interactions": "",
"processors": "",
"groups": "",
"groups": ";Keyboard&Mouse",
"action": "Interaction",
"isComposite": false,
"isPartOfComposite": false
@ -631,7 +631,7 @@
"path": "<Keyboard>/f1",
"interactions": "",
"processors": "",
"groups": "",
"groups": ";Keyboard&Mouse",
"action": "DevelopKey01",
"isComposite": false,
"isPartOfComposite": false
@ -1055,54 +1055,6 @@
"isPartOfComposite": false
}
]
},
{
"name": "Bar",
"id": "63082564-263a-4430-8f7a-13c3cd4e93e7",
"actions": [
{
"name": "Pour",
"type": "Button",
"id": "b02d861a-39ed-4c5e-abd0-7ce3c2a44707",
"expectedControlType": "",
"processors": "",
"interactions": "Press",
"initialStateCheck": false
},
{
"name": "EscapeBar",
"type": "Button",
"id": "4752dd64-7a31-42ae-bfc9-45a01927bd07",
"expectedControlType": "",
"processors": "",
"interactions": "",
"initialStateCheck": false
}
],
"bindings": [
{
"name": "",
"id": "01fa3267-e5c0-48c1-8194-592530fbca87",
"path": "<Keyboard>/space",
"interactions": "",
"processors": "",
"groups": "",
"action": "Pour",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "646d58bf-d879-47c1-99c9-c534c83eb9f4",
"path": "<Keyboard>/escape",
"interactions": "",
"processors": "",
"groups": "",
"action": "EscapeBar",
"isComposite": false,
"isPartOfComposite": false
}
]
}
],
"controlSchemes": [

View File

@ -0,0 +1,14 @@
using UnityEngine.InputSystem;
namespace BlueWater
{
// PlayerInput 확장
public static class PlayerInputExtensions
{
public static bool IsInitialized(this PlayerInput playerInput)
{
// currentActionMap이 할당되면 초기화 완료로 간주
return playerInput.currentActionMap != null;
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: cfdd20a7e0c8ae649b5c4a6ca553133c

View File

@ -7,7 +7,7 @@ namespace BlueWater.Tycoons
public override void Interaction()
{
var tycoonUiManager = TycoonUiManager.Instance;
tycoonUiManager.TycoonManagementUi.Open(tycoonUiManager.PopupUiList);
tycoonUiManager.TycoonManagementUi.Open();
}
public override bool CanInteraction()

View File

@ -23,19 +23,20 @@ namespace BlueWater.Tycoons
private void Start()
{
EventManager.OnTycoonGameOvered += GameOver;
_tycoonManager = TycoonManager.Instance;
_dailyCustomerVisitInfos = new List<CustomerVisitInfo>();
StartStage();
EventManager.OnInitializedPlayerInput += StartStage;
}
private void OnDestroy()
{
EventManager.OnInitializedPlayerInput -= StartStage;
}
private void StartStage()
{
EventManager.OnTycoonGameOvered -= GameOver;
_dailyCustomerVisitInfos.Clear();
Utils.StartUniqueCoroutine(this, ref _startStageCoroutineInstance, StartStageCoroutine());

View File

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using Sirenix.OdinInspector;
using UnityEngine;
using UnityEngine.UI;
@ -17,9 +16,9 @@ namespace BlueWater.Uis
_moveNextStageButton = transform.Find("ClearPanel/Popup Base - Concave/Bottom/Background/Border/MoveNextStageButton").GetComponent<Button>();
}
public override void Open(List<PopupUi> popupUiList)
public override void Open()
{
base.Open(popupUiList);
base.Open();
VisualFeedbackManager.Instance.SetBaseTimeScale(1f);
PlayerInputKeyManager.Instance.DisableCurrentPlayerInput();
_moveNextStageButton.interactable = (int)DataManager.Instance.CurrentSaveStage < Enum.GetValues(typeof(SaveStage)).Length - 1;

View File

@ -1,5 +1,4 @@
using System.Collections.Generic;
using BlueWater.Items;
using BlueWater.Maps;
using DG.Tweening;
using Sirenix.OdinInspector;
@ -50,8 +49,6 @@ namespace BlueWater.Uis
[SerializeField]
private Image _fadeImage;
public List<PopupUi> PopupUiList { get; private set; }
protected override void OnAwake()
{
@ -60,8 +57,6 @@ namespace BlueWater.Uis
private void Start()
{
PopupUi.OnPopupUiOpenEvent += RegisterPopup;
PopupUi.OnPopupUiCloseEvent += UnregisterPopup;
EventManager.OnFadeInOut += FadeInOut;
Invoke(nameof(StartTutorial), 0.1f);
@ -76,8 +71,6 @@ namespace BlueWater.Uis
{
if (Quitting) return;
PopupUi.OnPopupUiOpenEvent -= RegisterPopup;
PopupUi.OnPopupUiCloseEvent -= UnregisterPopup;
EventManager.OnFadeInOut -= FadeInOut;
}
@ -97,45 +90,8 @@ namespace BlueWater.Uis
CombatTutorialUi = MainCanvas.transform.Find("CombatTutorialUi").GetComponent<CombatTutorialUi>();
DevelopMenuPopupUi = MainCanvas.transform.Find("DevelopMenuPopupUi").GetComponent<MenuPopupUi>();
_fadeImage = MainCanvas.transform.Find("FadeImage").GetComponent<Image>();
PopupUiList = new List<PopupUi>(8);
}
private void RegisterPopup(PopupUi popup)
{
if (!PopupUiList.Contains(popup))
{
PopupUiList.Add(popup);
}
}
private void UnregisterPopup(PopupUi popup)
{
if (PopupUiList.Contains(popup))
{
PopupUiList.Remove(popup);
}
}
public void CloseLastPopup()
{
if (PopupUiList.Count <= 0) return;
PopupUiList[^1].Close();
}
public void CloseAllPopup()
{
var tempList = new List<PopupUi>(PopupUiList);
foreach (var popup in tempList)
{
popup.Close();
}
PopupUiList.Clear();
}
public void FadeInOut(float fadeInTime, float fadeOutTime, Color? fadeColor = null, float delayAfterFadeIn = 0f)
{
var newColor = new Color(1f, 1f, 1f, 0f);
@ -160,19 +116,19 @@ namespace BlueWater.Uis
public void HardResetAllMaps()
{
MapManager.Instance.HardResetAllMaps();
CloseAllPopup();
PopupUiController.CloseAllPopup();
}
public void RestartCurrentStage()
{
MapManager.Instance.RestartCurrentMap();
CloseAllPopup();
PopupUiController.CloseAllPopup();
}
public void MoveSelectStage(int stage)
{
MapManager.Instance.MoveSelectStage(stage);
CloseAllPopup();
PopupUiController.CloseAllPopup();
}
public void MoveTitleScene()

View File

@ -55,7 +55,7 @@ namespace BlueWater.Uis
_countText.text = _currentCount.ToString();
_countSelectUi.SetActive(true);
Open(CombatUiManager.Instance.PopupUiList);
Open();
}
public void DiscardAllMessage(List<ItemSlotUi> selectedSlotList)
@ -65,7 +65,7 @@ namespace BlueWater.Uis
_contentText.text = "선택한 물품을 모두 버리시겠습니까?";
_countSelectUi.SetActive(false);
Open(CombatUiManager.Instance.PopupUiList);
Open();
}
public void CountDownButton()

View File

@ -4,9 +4,9 @@ namespace BlueWater.Uis
{
public class GameOverPopupUi : PopupUi
{
public override void Open(List<PopupUi> popupUiList)
public override void Open()
{
base.Open(popupUiList);
base.Open();
VisualFeedbackManager.Instance.SetBaseTimeScale(0f);
PlayerInputKeyManager.Instance.DisableCurrentPlayerInput();
}

View File

@ -1,12 +1,10 @@
using System.Collections.Generic;
namespace BlueWater.Uis
{
public class MenuPopupUi : SwitchActionPopupUi
{
public override void Open(List<PopupUi> popupUiList)
public override void Open()
{
base.Open(popupUiList);
base.Open();
VisualFeedbackManager.Instance.SetBaseTimeScale(0f);
}

View File

@ -1,29 +1,25 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace BlueWater.Uis
{
public class PopupUi : MonoBehaviour
{
public static event Action<PopupUi> OnPopupUiOpenEvent;
public static event Action<PopupUi> OnPopupUiCloseEvent;
protected List<PopupUi> PopupUiList;
public bool IsOpened { get; protected set; }
public virtual void Open(List<PopupUi> popupUiList)
public virtual void Open()
{
PopupUiList = popupUiList;
// 화면의 가장 앞으로 가져오기
transform.SetAsLastSibling();
gameObject.SetActive(true);
OnPopupUiOpenEvent?.Invoke(this);
PopupUiController.RegisterPopup(this);
IsOpened = true;
}
public virtual void Close()
{
gameObject.SetActive(false);
OnPopupUiCloseEvent?.Invoke(this);
PopupUiController.UnregisterPopup(this);
IsOpened = false;
}
}
}

View File

@ -0,0 +1,50 @@
using System.Collections.Generic;
using BlueWater.Uis;
namespace BlueWater
{
public static class PopupUiController
{
public static List<PopupUi> PopupUis { get; private set; } = new();
// Popup 등록
public static void RegisterPopup(PopupUi popup)
{
if (!PopupUis.Contains(popup))
{
PopupUis.Add(popup);
}
}
// Popup 해제
public static void UnregisterPopup(PopupUi popup)
{
if (PopupUis.Contains(popup))
{
PopupUis.Remove(popup);
}
}
// 마지막 Popup 닫기
public static void CloseLastPopup()
{
if (PopupUis.Count <= 0) return;
PopupUis[^1].Close();
}
// 모든 Popup 닫기
public static void CloseAllPopup()
{
foreach (var element in PopupUis)
{
if (!element.IsOpened) continue;
element.Close();
}
}
// Popup 목록이 비어 있는지 확인
public static bool IsPopupListEmpty() => PopupUis.Count == 0;
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: ea2b34c9f4db83a409013e9bf6bcb82a

View File

@ -11,9 +11,9 @@ namespace BlueWater.Uis
[SerializeField]
protected InputActionMaps SwitchMapsClosed;
public override void Open(List<PopupUi> popupUiList)
public override void Open()
{
base.Open(popupUiList);
base.Open();
PlayerInputKeyManager.Instance.SwitchCurrentActionMap(SwitchMapsOpened);
}
@ -22,7 +22,7 @@ namespace BlueWater.Uis
{
base.Close();
if (PopupUiList.Count > 0) return;
if (!PopupUiController.IsPopupListEmpty()) return;
PlayerInputKeyManager.Instance.SwitchCurrentActionMap(SwitchMapsClosed);
}

View File

@ -4,9 +4,9 @@ using UnityEngine;
public class Manual : SwitchActionPopupUi
{
public override void Open(List<PopupUi> popupUiList)
public override void Open()
{
base.Open(popupUiList);
base.Open();
}
public override void Close()

View File

@ -146,9 +146,9 @@ public class ManualBook : SwitchActionPopupUi
}
public override void Open(List<PopupUi> popupUiList)
public override void Open()
{
base.Open(popupUiList);
base.Open();
VisualFeedbackManager.Instance.SetBaseTimeScale(0.0f);
}

View File

@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using BlueWater.Tycoons;
using DG.Tweening;
using Sirenix.OdinInspector;
using UnityEngine;
@ -38,10 +36,10 @@ namespace BlueWater.Uis
_closeTween.Kill();
}
public override void Open(List<PopupUi> popupUiList)
public override void Open()
{
_rectTransform.anchoredPosition = new Vector2(-960f, 0f);
base.Open(popupUiList);
base.Open();
_openTween = _rectTransform.DOAnchorPosX(960f, 0.5f).SetAutoKill(false);
}

View File

@ -1,5 +1,4 @@
using System.Collections.Generic;
using BlueWater.Tycoons;
using DG.Tweening;
using Sirenix.OdinInspector;
using UnityEngine;
@ -35,10 +34,6 @@ namespace BlueWater.Uis
[SerializeField]
private Image _fadeImage;
// Variables
public List<PopupUi> PopupUiList { get; private set; }
#endregion
@ -52,8 +47,6 @@ namespace BlueWater.Uis
private void Start()
{
PopupUi.OnPopupUiOpenEvent += RegisterPopup;
PopupUi.OnPopupUiCloseEvent += UnregisterPopup;
EventManager.OnTycoonGameStarted += TycoonOpenEvent;
EventManager.OnTycoonGameOvered += TycoonClosedEvent;
EventManager.OnFadeInOut += FadeInOut;
@ -63,8 +56,6 @@ namespace BlueWater.Uis
{
if (Quitting) return;
PopupUi.OnPopupUiOpenEvent -= RegisterPopup;
PopupUi.OnPopupUiCloseEvent -= UnregisterPopup;
EventManager.OnTycoonGameStarted -= TycoonOpenEvent;
EventManager.OnTycoonGameOvered -= TycoonClosedEvent;
EventManager.OnFadeInOut -= FadeInOut;
@ -86,50 +77,12 @@ namespace BlueWater.Uis
//BrewingUi = GetComponentInChildren<BrewingUi>(true);
ManualBook = GetComponentInChildren<ManualBook>(true);
_fadeImage = MainCanvas.transform.Find("FadeImage").GetComponent<Image>();
PopupUiList = new List<PopupUi>(8);
}
#endregion
// Methods
#region Methods
private void RegisterPopup(PopupUi popup)
{
if (!PopupUiList.Contains(popup))
{
PopupUiList.Add(popup);
}
}
private void UnregisterPopup(PopupUi popup)
{
if (PopupUiList.Contains(popup))
{
PopupUiList.Remove(popup);
}
}
public void CloseLastPopup()
{
if (PopupUiList.Count <= 0) return;
PopupUiList[^1].Close();
}
public void CloseAllPopup()
{
var tempList = new List<PopupUi>(PopupUiList);
foreach (var popup in tempList)
{
popup.Close();
}
PopupUiList.Clear();
}
public bool IsPopupListEmpty() => PopupUiList.Count == 0;
private void TycoonOpenEvent()
{

View File

@ -594,8 +594,8 @@ MonoBehaviour:
<PlayerInput>k__BackingField: {fileID: 6054159730444663926}
<VisualLook>k__BackingField: {fileID: 6509241874729291456}
<SkeletonAnimation>k__BackingField: {fileID: 7125556968546628472}
<InteractionCanvas>k__BackingField: {fileID: 0}
<SpineController>k__BackingField: {fileID: 0}
<InteractionCanvas>k__BackingField: {fileID: 56698895639349130}
<SpineController>k__BackingField: {fileID: 6662554121718997272}
<PlayerHealthPoint>k__BackingField: {fileID: 3359549505901716120}
<TycoonInput>k__BackingField: {fileID: 1674052485383758547}
<TycoonMovement>k__BackingField: {fileID: 4836489897218844789}
@ -748,6 +748,17 @@ PrefabInstance:
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: a6a0d1675321b7a43b4132ca15cf7ca0, type: 3}
--- !u!114 &56698895639349130 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 8043919875794167790, guid: a6a0d1675321b7a43b4132ca15cf7ca0, type: 3}
m_PrefabInstance: {fileID: 8027897071964512356}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9ebe6250da0dfa044937230037499988, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!224 &3452808590865560956 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 4648285208244819224, guid: a6a0d1675321b7a43b4132ca15cf7ca0, type: 3}