전투 씬 Ui 추가

수정 내역
1. 아이템 인벤토리 씬별로 스크립트 구분
2. 전투씬에 GameOver, Clear, Menu Ui 추가

버그 수정 내역
1. 팝업UI 간의 충돌 버그 수정
This commit is contained in:
NTG 2024-05-12 19:47:18 +09:00
parent 756cb4b212
commit 25ce12515e
30 changed files with 5116 additions and 593 deletions

File diff suppressed because it is too large Load Diff

View File

@ -49167,6 +49167,26 @@ PrefabInstance:
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1271729315598528976, guid: d96bf988529067d4383a3a91281636c7,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 834995731}
- target: {fileID: 1271729315598528976, guid: d96bf988529067d4383a3a91281636c7,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: DeselectAll
objectReference: {fileID: 0}
- target: {fileID: 1979490390397025898, guid: d96bf988529067d4383a3a91281636c7,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 834995731}
- target: {fileID: 1979490390397025898, guid: d96bf988529067d4383a3a91281636c7,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: SelectAll
objectReference: {fileID: 0}
- target: {fileID: 4750452470218991809, guid: d96bf988529067d4383a3a91281636c7,
type: 3}
propertyPath: inventoryType
@ -49307,21 +49327,60 @@ PrefabInstance:
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7031908084443481545, guid: d96bf988529067d4383a3a91281636c7,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 834995731}
- target: {fileID: 7031908084443481545, guid: d96bf988529067d4383a3a91281636c7,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: Close
objectReference: {fileID: 0}
- target: {fileID: 7031908084443481545, guid: d96bf988529067d4383a3a91281636c7,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName
value: BlueWaterProject.OceanItemInventoryUi, Assembly-CSharp
objectReference: {fileID: 0}
- target: {fileID: 7061523539934470095, guid: d96bf988529067d4383a3a91281636c7,
type: 3}
propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 834995731}
- target: {fileID: 7061523539934470095, guid: d96bf988529067d4383a3a91281636c7,
type: 3}
propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: SortButton
objectReference: {fileID: 0}
- target: {fileID: 7444815075962528362, guid: d96bf988529067d4383a3a91281636c7,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 834995731}
- target: {fileID: 7444815075962528362, guid: d96bf988529067d4383a3a91281636c7,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: DiscardButton
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 1209805552654335050, guid: d96bf988529067d4383a3a91281636c7,
type: 3}
insertIndex: -1
addedObject: {fileID: 834995731}
m_SourcePrefab: {fileID: 100100000, guid: d96bf988529067d4383a3a91281636c7, type: 3}
--- !u!114 &834995725 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 4750452470218991809, guid: d96bf988529067d4383a3a91281636c7,
m_CorrespondingSourceObject: {fileID: 1409092616064810731, guid: d96bf988529067d4383a3a91281636c7,
type: 3}
m_PrefabInstance: {fileID: 834995724}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b87a52e3ff43cf147b64090e904d8797, type: 3}
m_Script: {fileID: 11500000, guid: ff0b44300107a9b4ca017d7805271ac4, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!224 &834995726 stripped
@ -49330,6 +49389,61 @@ RectTransform:
type: 3}
m_PrefabInstance: {fileID: 834995724}
m_PrefabAsset: {fileID: 0}
--- !u!224 &834995727 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 1084418967924843700, guid: d96bf988529067d4383a3a91281636c7,
type: 3}
m_PrefabInstance: {fileID: 834995724}
m_PrefabAsset: {fileID: 0}
--- !u!114 &834995728 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 7145171424784618823, guid: d96bf988529067d4383a3a91281636c7,
type: 3}
m_PrefabInstance: {fileID: 834995724}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &834995729 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 7061523539934470095, guid: d96bf988529067d4383a3a91281636c7,
type: 3}
m_PrefabInstance: {fileID: 834995724}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7b743370ac3e4ec2a1668f5455a8ef8a, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &834995730 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1209805552654335050, guid: d96bf988529067d4383a3a91281636c7,
type: 3}
m_PrefabInstance: {fileID: 834995724}
m_PrefabAsset: {fileID: 0}
--- !u!114 &834995731
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 834995730}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 32263e8866c91d843b662b6deaf45c5e, type: 3}
m_Name:
m_EditorClassIdentifier:
sortingDropdown: {fileID: 834995729}
currentWeight: {fileID: 834995728}
itemSlotUiPrefab: {fileID: 2871646676280082070, guid: 9a52cdb9161f87943b721aeba961ac50,
type: 3}
instantiateLocation: {fileID: 834995727}
discardPopupUi: {fileID: 834995725}
<ItemSlotUiList>k__BackingField: []
--- !u!1001 &836300913
PrefabInstance:
m_ObjectHideFlags: 0
@ -91918,10 +92032,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
_persistent: 0
<IslandPlayerMode>k__BackingField: 0
<InIslandPlayerPrefab>k__BackingField: {fileID: 0}
<CrewmatePrefabList>k__BackingField: []
<CurrentCrewmateList>k__BackingField: []
combatPlayerPrefab: {fileID: 0}
<IsOnFollowCamera>k__BackingField: 0
slowSpeed: 0.1
--- !u!4 &1540310984
@ -124623,7 +124734,6 @@ GameObject:
- component: {fileID: 2105062289}
- component: {fileID: 2105062288}
- component: {fileID: 2105062293}
- component: {fileID: 2105062292}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
@ -124722,19 +124832,6 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!114 &2105062292
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2105062287}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 06c19c0e062e84c169aca3af92060883, type: 3}
m_Name:
m_EditorClassIdentifier:
_persistent: 0
--- !u!114 &2105062293
MonoBehaviour:
m_ObjectHideFlags: 0
@ -124760,7 +124857,7 @@ MonoBehaviour:
<SpeedLines>k__BackingField: {fileID: 2014893524}
<DropItemGroupController>k__BackingField: {fileID: 805316001}
<WeatherUi>k__BackingField: {fileID: 2977125648263133580}
<OceanItemInventoryUi>k__BackingField: {fileID: 834995725}
<OceanItemInventoryUi>k__BackingField: {fileID: 834995731}
popupUiList: []
--- !u!1001 &2105322227
PrefabInstance:
@ -128489,12 +128586,12 @@ PrefabInstance:
- target: {fileID: 5290961994918313947, guid: be1d50d0f9a83864698b17f9e155db2d,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.9516782
value: 0.99691075
objectReference: {fileID: 0}
- target: {fileID: 5290961994918313947, guid: be1d50d0f9a83864698b17f9e155db2d,
type: 3}
propertyPath: m_LocalRotation.y
value: 0.307097
value: -0.078543134
objectReference: {fileID: 0}
- target: {fileID: 5465818858273453228, guid: be1d50d0f9a83864698b17f9e155db2d,
type: 3}
@ -128544,17 +128641,17 @@ PrefabInstance:
- target: {fileID: 6474911501201492956, guid: be1d50d0f9a83864698b17f9e155db2d,
type: 3}
propertyPath: m_LocalPosition.x
value: -37.29999
value: 187.6475
objectReference: {fileID: 0}
- target: {fileID: 6474911501201492956, guid: be1d50d0f9a83864698b17f9e155db2d,
type: 3}
propertyPath: m_LocalPosition.y
value: 27.144754
value: 8.820337
objectReference: {fileID: 0}
- target: {fileID: 6474911501201492956, guid: be1d50d0f9a83864698b17f9e155db2d,
type: 3}
propertyPath: m_LocalPosition.z
value: -42.87467
value: -5.1267295
objectReference: {fileID: 0}
- target: {fileID: 6474911501201492956, guid: be1d50d0f9a83864698b17f9e155db2d,
type: 3}
@ -128619,17 +128716,17 @@ PrefabInstance:
- target: {fileID: 7878254740279761662, guid: be1d50d0f9a83864698b17f9e155db2d,
type: 3}
propertyPath: m_LocalScale.x
value: 0.5
value: 2.0835958
objectReference: {fileID: 0}
- target: {fileID: 7878254740279761662, guid: be1d50d0f9a83864698b17f9e155db2d,
type: 3}
propertyPath: m_LocalScale.y
value: 0.5
value: 2.0835958
objectReference: {fileID: 0}
- target: {fileID: 7878254740279761662, guid: be1d50d0f9a83864698b17f9e155db2d,
type: 3}
propertyPath: m_LocalScale.z
value: 0.5
value: 2.0835958
objectReference: {fileID: 0}
- target: {fileID: 8211506079654505266, guid: be1d50d0f9a83864698b17f9e155db2d,
type: 3}

View File

@ -685,6 +685,15 @@ public partial class @BlueWater: IInputActionCollection2, IDisposable
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""OpenMenu"",
""type"": ""Button"",
""id"": ""be2734fa-1283-41ff-8cba-f1160933011a"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""OpenItemInventory"",
""type"": ""Button"",
@ -805,6 +814,17 @@ public partial class @BlueWater: IInputActionCollection2, IDisposable
""action"": ""OpenItemInventory"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""ef35184a-bd13-4850-b2a7-b95df05930f2"",
""path"": ""<Keyboard>/escape"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard&Mouse"",
""action"": ""OpenMenu"",
""isComposite"": false,
""isPartOfComposite"": false
}
]
},
@ -925,6 +945,7 @@ public partial class @BlueWater: IInputActionCollection2, IDisposable
m_Combat_Attack = m_Combat.FindAction("Attack", throwIfNotFound: true);
m_Combat_Dash = m_Combat.FindAction("Dash", throwIfNotFound: true);
m_Combat_ActivateMainSkill = m_Combat.FindAction("ActivateMainSkill", throwIfNotFound: true);
m_Combat_OpenMenu = m_Combat.FindAction("OpenMenu", throwIfNotFound: true);
m_Combat_OpenItemInventory = m_Combat.FindAction("OpenItemInventory", throwIfNotFound: true);
// CombatUi
m_CombatUi = asset.FindActionMap("CombatUi", throwIfNotFound: true);
@ -1339,6 +1360,7 @@ public partial class @BlueWater: IInputActionCollection2, IDisposable
private readonly InputAction m_Combat_Attack;
private readonly InputAction m_Combat_Dash;
private readonly InputAction m_Combat_ActivateMainSkill;
private readonly InputAction m_Combat_OpenMenu;
private readonly InputAction m_Combat_OpenItemInventory;
public struct CombatActions
{
@ -1348,6 +1370,7 @@ public partial class @BlueWater: IInputActionCollection2, IDisposable
public InputAction @Attack => m_Wrapper.m_Combat_Attack;
public InputAction @Dash => m_Wrapper.m_Combat_Dash;
public InputAction @ActivateMainSkill => m_Wrapper.m_Combat_ActivateMainSkill;
public InputAction @OpenMenu => m_Wrapper.m_Combat_OpenMenu;
public InputAction @OpenItemInventory => m_Wrapper.m_Combat_OpenItemInventory;
public InputActionMap Get() { return m_Wrapper.m_Combat; }
public void Enable() { Get().Enable(); }
@ -1370,6 +1393,9 @@ public partial class @BlueWater: IInputActionCollection2, IDisposable
@ActivateMainSkill.started += instance.OnActivateMainSkill;
@ActivateMainSkill.performed += instance.OnActivateMainSkill;
@ActivateMainSkill.canceled += instance.OnActivateMainSkill;
@OpenMenu.started += instance.OnOpenMenu;
@OpenMenu.performed += instance.OnOpenMenu;
@OpenMenu.canceled += instance.OnOpenMenu;
@OpenItemInventory.started += instance.OnOpenItemInventory;
@OpenItemInventory.performed += instance.OnOpenItemInventory;
@OpenItemInventory.canceled += instance.OnOpenItemInventory;
@ -1389,6 +1415,9 @@ public partial class @BlueWater: IInputActionCollection2, IDisposable
@ActivateMainSkill.started -= instance.OnActivateMainSkill;
@ActivateMainSkill.performed -= instance.OnActivateMainSkill;
@ActivateMainSkill.canceled -= instance.OnActivateMainSkill;
@OpenMenu.started -= instance.OnOpenMenu;
@OpenMenu.performed -= instance.OnOpenMenu;
@OpenMenu.canceled -= instance.OnOpenMenu;
@OpenItemInventory.started -= instance.OnOpenItemInventory;
@OpenItemInventory.performed -= instance.OnOpenItemInventory;
@OpenItemInventory.canceled -= instance.OnOpenItemInventory;
@ -1523,6 +1552,7 @@ public partial class @BlueWater: IInputActionCollection2, IDisposable
void OnAttack(InputAction.CallbackContext context);
void OnDash(InputAction.CallbackContext context);
void OnActivateMainSkill(InputAction.CallbackContext context);
void OnOpenMenu(InputAction.CallbackContext context);
void OnOpenItemInventory(InputAction.CallbackContext context);
}
public interface ICombatUiActions

View File

@ -663,6 +663,15 @@
"interactions": "",
"initialStateCheck": false
},
{
"name": "OpenMenu",
"type": "Button",
"id": "be2734fa-1283-41ff-8cba-f1160933011a",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "OpenItemInventory",
"type": "Button",
@ -783,6 +792,17 @@
"action": "OpenItemInventory",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "ef35184a-bd13-4850-b2a7-b95df05930f2",
"path": "<Keyboard>/escape",
"interactions": "",
"processors": "",
"groups": "Keyboard&Mouse",
"action": "OpenMenu",
"isComposite": false,
"isPartOfComposite": false
}
]
},

View File

@ -18,7 +18,6 @@ public class BossMapController : MonoBehaviour
public virtual void InitBossMap()
{
DataManager.Inst.CurrentSaveStage = SaveStage.SLIME;
AllDestroyObjects();
bossInstanceList = new List<GameObject>(10);

View File

@ -29,7 +29,6 @@ namespace BlueWaterProject
private void Start()
{
OnChangedCurrentHp += CombatUiManager.Inst.HeartHpUi.SetCurrentHp;
CombatUiManager.Inst.GameOverPopupUi.OnRestartEvent += SetMaxHp;
flashWhiteWaitTime = new WaitForSeconds(takeDamageCoolDown * 0.1f);
SetCurrentHp(maxHp);
@ -40,7 +39,6 @@ namespace BlueWaterProject
if (CombatUiManager.Inst)
{
OnChangedCurrentHp -= CombatUiManager.Inst.HeartHpUi.SetCurrentHp;
CombatUiManager.Inst.GameOverPopupUi.OnRestartEvent -= SetMaxHp;
}
}

View File

@ -10,8 +10,8 @@ namespace BlueWaterProject
private PlayerInput playerInput;
// Const
private const string COMBAT = "Combat";
private const string COMBAT_UI = "CombatUi";
public const string COMBAT = "Combat";
public const string COMBAT_UI = "CombatUi";
// Events
public delegate void MoveInput(Vector2 movementInput);
@ -91,11 +91,23 @@ namespace BlueWaterProject
{
if (context.started)
{
if (!CombatUiManager.Inst.CombatItemInventoryUi.gameObject.activeSelf) return;
CombatUiManager.Inst.CombatItemInventoryUi.Close();
SwitchCurrentActionMap(COMBAT);
}
}
public void OnOpenMenu(InputAction.CallbackContext context)
{
if (context.started)
{
CombatUiManager.Inst.CombatMenuPopupUi.Open();
SwitchCurrentActionMap(COMBAT_UI);
}
}
public void OnCancel(InputAction.CallbackContext context)
{

View File

@ -28,7 +28,7 @@ namespace BlueWaterProject
// 보스 스탯
[field: Title("보스 스탯")]
[field: SerializeField] public string Name { get; private set; }
[field: SerializeField] public string BossName { get; private set; }
[field: SerializeField] public float MaxHp { get; private set; } = 500f;
[SerializeField] protected float moveSpeed = 3f;
[SerializeField] protected LayerMask targetLayer;

View File

@ -144,8 +144,8 @@ namespace BlueWaterProject
private Vector3 inputMoveDirection = Vector3.forward;
// Const
private const string OCEAN = "Ocean";
private const string OCEAN_UI = "OceanUi";
public const string OCEAN = "Ocean";
public const string OCEAN_UI = "OceanUi";
#endregion
@ -226,7 +226,7 @@ namespace BlueWaterProject
{
if (context.started)
{
OceanUiManager.Inst.CloseAndRemoveLastPopup();
OceanUiManager.Inst.CloseLastPopup();
if (!OceanUiManager.Inst.IsPopupListEmpty()) return;

View File

@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Sirenix.OdinInspector;
@ -16,9 +17,10 @@ namespace BlueWaterProject
[field: SerializeField] public FieldBossHpSlider FieldBossHpSlider { get; private set; }
[field: SerializeField] public HeartHpUi HeartHpUi { get; private set; }
[field: SerializeField] public DropItemGroupController DropItemGroupController { get; private set; }
[field: SerializeField] public ItemInventoryUi OceanItemInventoryUi { get; private set; }
[field: SerializeField] public ItemInventoryUi CombatItemInventoryUi { get; private set; }
[field: SerializeField] public CombatItemInventoryUi CombatItemInventoryUi { get; private set; }
[field: SerializeField] public GameOverPopupUi GameOverPopupUi { get; private set; }
[field: SerializeField] public ClearPopupUi ClearPopupUi { get; private set; }
[field: SerializeField] public CombatMenuPopupUi CombatMenuPopupUi { get; private set; }
[Title("효과")]
[SerializeField] private Image fadeUi;
@ -58,9 +60,10 @@ namespace BlueWaterProject
FieldBossHpSlider = MainCanvas.transform.Find("FieldBossHpSlider").GetComponent<FieldBossHpSlider>();
HeartHpUi = MainCanvas.transform.Find("HeartHpUi").GetComponent<HeartHpUi>();
DropItemGroupController = MainCanvas.transform.Find("DropItemGroup").GetComponent<DropItemGroupController>();
OceanItemInventoryUi = MainCanvas.transform.Find("OceanItemInventoryUi").GetComponent<ItemInventoryUi>();
CombatItemInventoryUi = MainCanvas.transform.Find("CombatItemInventoryUi").GetComponent<ItemInventoryUi>();
CombatItemInventoryUi = MainCanvas.transform.Find("CombatItemInventoryUi").GetComponent<CombatItemInventoryUi>();
GameOverPopupUi = MainCanvas.transform.Find("GameOverPopupUi").GetComponent<GameOverPopupUi>();
ClearPopupUi = MainCanvas.transform.Find("ClearPopupUi").GetComponent<ClearPopupUi>();
CombatMenuPopupUi = MainCanvas.transform.Find("CombatMenuPopupUi").GetComponent<CombatMenuPopupUi>();
fadeUi = MainCanvas.transform.Find("FadeUi").GetComponent<Image>();
popupUiList = new List<PopupUi>(8);
@ -136,5 +139,47 @@ namespace BlueWaterProject
fadeUi.color = new Color(fadeUi.color.r, fadeUi.color.g, fadeUi.color.b, 0f);
fadeUi.enabled = false;
}
public void RestartCurrentStage()
{
switch (DataManager.Inst.CurrentSaveStage)
{
case SaveStage.TUTORIAL:
break;
case SaveStage.SLIME:
FindAnyObjectByType<SlimeBossMapController>().InitBossMap();
break;
case SaveStage.RHINOCEROS:
FindAnyObjectByType<RhinocerosBossMapController>().InitBossMap();
break;
default:
throw new ArgumentOutOfRangeException();
}
CloseAllPopup();
}
public void MoveNextStage()
{
DataManager.Inst.CurrentSaveStage++;
RestartCurrentStage();
}
public void MoveSelectStage(int stage)
{
DataManager.Inst.CurrentSaveStage = (SaveStage)stage;
RestartCurrentStage();
}
public void QuitGame()
{
#if UNITY_EDITOR
UnityEditor.EditorApplication.isPlaying = false;
#else
Application.Quit();
#endif
}
}
}

View File

@ -0,0 +1,22 @@
using UnityEngine.InputSystem;
// ReSharper disable once CheckNamespace
namespace BlueWaterProject
{
public class CombatItemInventoryUi : ItemInventoryUi
{
public override void Close()
{
base.Close();
FindAnyObjectByType<PlayerInput>().SwitchCurrentActionMap(CombatInput.COMBAT);
}
protected override void InitAndUpdateInventory()
{
inventory = DataManager.Inst.CombatInventory;
base.InitAndUpdateInventory();
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 3c081a2936b06994087d93600839e8f1

View File

@ -7,27 +7,18 @@ using UnityEngine;
// ReSharper disable once CheckNamespace
namespace BlueWaterProject
{
public class ItemInventoryUi : PopupUi
public abstract class ItemInventoryUi : PopupUi
{
private enum InventoryType
{
NONE = 0,
OCEAN_INVENTORY_IN_OCEAN,
OCEAN_INVENTORY_IN_COMBAT,
COMBAT_INVENTORY_IN_COMBAT,
}
[SerializeField] private InventoryType inventoryType;
[SerializeField, Required] private TMP_Dropdown sortingDropdown;
[SerializeField, Required] private TMP_Text currentWeight;
[SerializeField, Required] private GameObject itemSlotUiPrefab;
[SerializeField, Required] private Transform instantiateLocation;
[SerializeField, Required] private DiscardPopupUi discardPopupUi;
[SerializeField, Required] protected TMP_Dropdown sortingDropdown;
[SerializeField, Required] protected TMP_Text currentWeight;
[SerializeField, Required] protected GameObject itemSlotUiPrefab;
[SerializeField, Required] protected Transform instantiateLocation;
[SerializeField, Required] protected DiscardPopupUi discardPopupUi;
[field: SerializeField] public List<ItemSlotUi> ItemSlotUiList { get; set; } = new();
private PlayerInventory inventory;
private List<ItemSlotUi> selectedList = new();
protected PlayerInventory inventory;
protected List<ItemSlotUi> selectedList = new();
private void OnEnable()
{
@ -56,31 +47,13 @@ namespace BlueWaterProject
base.Close();
}
public void InitAndUpdateInventory()
protected virtual void InitAndUpdateInventory()
{
inventory ??= GetPlayerInventory();
InitInventory();
InventorySynchronization();
InitWeight();
}
private PlayerInventory GetPlayerInventory()
{
switch (inventoryType)
{
case InventoryType.NONE:
return null;
case InventoryType.OCEAN_INVENTORY_IN_OCEAN:
case InventoryType.OCEAN_INVENTORY_IN_COMBAT:
return DataManager.Inst.OceanInventory;
case InventoryType.COMBAT_INVENTORY_IN_COMBAT:
return DataManager.Inst.CombatInventory;
default:
throw new ArgumentOutOfRangeException();
}
}
private void InitInventory()
{
ItemSlotUiList.Clear();

View File

@ -0,0 +1,22 @@
using UnityEngine.InputSystem;
// ReSharper disable once CheckNamespace
namespace BlueWaterProject
{
public class OceanItemInventoryUi : ItemInventoryUi
{
public override void Close()
{
base.Close();
FindAnyObjectByType<PlayerInput>().SwitchCurrentActionMap(ShipPlayer.OCEAN);
}
protected override void InitAndUpdateInventory()
{
inventory = DataManager.Inst.OceanInventory;
base.InitAndUpdateInventory();
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 32263e8866c91d843b662b6deaf45c5e

View File

@ -18,7 +18,7 @@ namespace BlueWaterProject
[field: SerializeField] public DropItemGroupController DropItemGroupController { get; set; }
[field: SerializeField] public WeatherUi WeatherUi { get; private set; }
[field: SerializeField] public ItemInventoryUi OceanItemInventoryUi { get; set; }
[field: SerializeField] public OceanItemInventoryUi OceanItemInventoryUi { get; set; }
public Canvas MainCanvas { get; private set; }
@ -35,6 +35,12 @@ namespace BlueWaterProject
ProcessBar.SetActive(false);
}
private void OnEnable()
{
PopupUi.OnPopupUiOpenEvent += RegisterPopup;
PopupUi.OnPopupUiCloseEvent += UnregisterPopup;
}
private void Update()
{
@ -46,6 +52,12 @@ namespace BlueWaterProject
}
}
private void OnDisable()
{
PopupUi.OnPopupUiOpenEvent -= RegisterPopup;
PopupUi.OnPopupUiCloseEvent -= UnregisterPopup;
}
[Button("셋팅 초기화")]
private void Init()
{
@ -71,7 +83,7 @@ namespace BlueWaterProject
DropItemGroupController = MainCanvas.transform.Find("DropItemGroup").GetComponent<DropItemGroupController>();
WeatherUi = MainCanvas.transform.Find("WeatherUi").GetComponent<WeatherUi>();
OceanItemInventoryUi = MainCanvas.transform.Find("OceanItemInventoryUi").GetComponent<ItemInventoryUi>();
OceanItemInventoryUi = MainCanvas.transform.Find("OceanItemInventoryUi").GetComponent<OceanItemInventoryUi>();
InstantiateUi = MainCanvas.transform.Find("InstantiateUi");
if (!InstantiateUi)
@ -106,13 +118,23 @@ namespace BlueWaterProject
}
}
public void CloseAndRemoveLastPopup()
public void CloseLastPopup()
{
if (popupUiList.Count <= 0) return;
popupUiList[^1].Close();
}
var lastIndex = popupUiList.Count - 1;
popupUiList[lastIndex].Close();
popupUiList.RemoveAt(lastIndex);
public void CloseAllPopup()
{
var tempList = new List<PopupUi>(popupUiList);
foreach (var popup in tempList)
{
popup.Close();
}
popupUiList.Clear();
}
public bool IsPopupListEmpty() => popupUiList.Count == 0;

View File

@ -8,21 +8,18 @@ public class RhinocerosBossMapController : BossMapController
// 추가 설정
[Title("추가 설정")]
public override void InitBossMap()
{
base.InitBossMap();
DataManager.Inst.CurrentSaveStage = SaveStage.RHINOCEROS;
InstantiateRhinoceros(bossSpawnTransform.position);
}
private Rhinoceros InstantiateRhinoceros(Vector3 instantiatePosition)
{
var instantiateBoss = Instantiate(bossPrefab, instantiatePosition, Quaternion.identity, bossInstantiateTransform).GetComponent<Rhinoceros>();
//instantiateBoss.Init(slimeState, hasRabbit);
//CombatUiManager.Inst.FieldBossHpSlider.SetHpSlider(instantiateBoss.MaxHp, instantiateBoss.BossName);
CombatUiManager.Inst.FieldBossHpSlider.SetHpSlider(instantiateBoss.MaxHp, instantiateBoss.BossName);
bossInstanceList.Add(instantiateBoss.gameObject);
return instantiateBoss;

View File

@ -16,7 +16,7 @@ public class SlimeBossMapController : BossMapController
public override void InitBossMap()
{
base.InitBossMap();
DataManager.Inst.CurrentSaveStage = SaveStage.SLIME;
InstantiateSlime(bossSpawnTransform.position, 1, true);
}
@ -60,5 +60,14 @@ public class SlimeBossMapController : BossMapController
yield return null;
}
GameManager.Inst.DefaultSpeedMode();
elapsedTime = 0f;
while (elapsedTime <= 2f)
{
elapsedTime += Time.unscaledDeltaTime;
yield return null;
}
CombatUiManager.Inst.ClearPopupUi.Open();
}
}

View File

@ -0,0 +1,23 @@
using UnityEngine;
using UnityEngine.InputSystem;
// ReSharper disable once CheckNamespace
namespace BlueWaterProject
{
public class ClearPopupUi : PopupUi
{
public override void Open()
{
Time.timeScale = 0f;
FindAnyObjectByType<PlayerInput>().enabled = false;
base.Open();
}
public override void Close()
{
Time.timeScale = 1f;
FindAnyObjectByType<PlayerInput>().enabled = true;
base.Close();
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4bf8fa74e73b73d418a518bedb7b8bcb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,17 @@
using UnityEngine.InputSystem;
// ReSharper disable once CheckNamespace
namespace BlueWaterProject
{
public class CombatMenuPopupUi : MenuPopupUi
{
public override void Close()
{
base.Close();
if (!CombatUiManager.Inst.IsPopupListEmpty()) return;
FindAnyObjectByType<PlayerInput>().SwitchCurrentActionMap(CombatInput.COMBAT);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3f5af0d4aca43444d8ea1d6046baa295
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,4 +1,3 @@
using System;
using UnityEngine;
using UnityEngine.InputSystem;
@ -7,8 +6,6 @@ namespace BlueWaterProject
{
public class GameOverPopupUi : PopupUi
{
public event Action OnRestartEvent;
public override void Open()
{
Time.timeScale = 0f;
@ -22,34 +19,5 @@ namespace BlueWaterProject
FindAnyObjectByType<PlayerInput>().enabled = true;
base.Close();
}
public void RestartCurrentStage()
{
OnRestartEvent?.Invoke();
switch (DataManager.Inst.CurrentSaveStage)
{
case SaveStage.TUTORIAL:
break;
case SaveStage.SLIME:
FindAnyObjectByType<SlimeBossMapController>().InitBossMap();
break;
case SaveStage.RHINOCEROS:
break;
default:
throw new ArgumentOutOfRangeException();
}
CombatUiManager.Inst.CloseAllPopup();
}
public void QuitGame()
{
#if UNITY_EDITOR
UnityEditor.EditorApplication.isPlaying = false;
#else
Application.Quit();
#endif
}
}
}

View File

@ -0,0 +1,20 @@
using UnityEngine;
// ReSharper disable once CheckNamespace
namespace BlueWaterProject
{
public class MenuPopupUi : PopupUi
{
public override void Open()
{
Time.timeScale = 0f;
base.Open();
}
public override void Close()
{
Time.timeScale = 1f;
base.Close();
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 77db27d2341c3e54f8a950f010275b5c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -10130,6 +10130,22 @@ MonoBehaviour:
m_Calls: []
m_ActionId: 093627e8-52f3-4c7e-ab67-077d16b7e665
m_ActionName: 'OceanUi/CloseItemInventory[/Keyboard/i]'
- m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 3317689373515734248}
m_TargetAssemblyTypeName: BlueWaterProject.CombatInput, Assembly-CSharp
m_MethodName: OnOpenMenu
m_Mode: 0
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_ActionId: be2734fa-1283-41ff-8cba-f1160933011a
m_ActionName: 'Combat/OpenMenu[/Keyboard/escape]'
m_NeverAutoSwitchControlSchemes: 0
m_DefaultControlScheme:
m_DefaultActionMap: Combat
@ -10159,7 +10175,7 @@ MonoBehaviour:
attacker: {fileID: 5724199633221144888}
health: {fileID: 7202455576463282972}
skillController: {fileID: 2724035861422592656}
combatStatus: {fileID: 8108333793341677795}
status: {fileID: 8108333793341677795}
--- !u!114 &3317689373515734248
MonoBehaviour:
m_ObjectHideFlags: 0

View File

@ -1994,7 +1994,7 @@ MonoBehaviour:
m_Calls:
- m_Target: {fileID: 2819079776940216040}
m_TargetAssemblyTypeName: BlueWaterProject.DiscardPopupUi, Assembly-CSharp
m_MethodName: CancelButton
m_MethodName: Close
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}

View File

@ -630,7 +630,7 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 4750452470218991809}
- m_Target: {fileID: 0}
m_TargetAssemblyTypeName: BlueWaterProject.ItemInventoryUi, Assembly-CSharp
m_MethodName: DiscardButton
m_Mode: 1
@ -1434,7 +1434,6 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 6057102563371345699}
- component: {fileID: 4750452470218991809}
m_Layer: 5
m_Name: ItemInventoryUi
m_TagString: Untagged
@ -1464,26 +1463,6 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &4750452470218991809
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1209805552654335050}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b87a52e3ff43cf147b64090e904d8797, type: 3}
m_Name:
m_EditorClassIdentifier:
inventoryType: 0
sortingDropdown: {fileID: 7061523539934470095}
currentWeight: {fileID: 7145171424784618823}
itemSlotUiPrefab: {fileID: 2871646676280082070, guid: 9a52cdb9161f87943b721aeba961ac50,
type: 3}
instantiateLocation: {fileID: 1084418967924843700}
discardPopupUi: {fileID: 1409092616064810731}
<ItemSlotUiList>k__BackingField: []
--- !u!1 &1264451192328266368
GameObject:
m_ObjectHideFlags: 0
@ -5135,7 +5114,7 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 4750452470218991809}
- m_Target: {fileID: 0}
m_TargetAssemblyTypeName: BlueWaterProject.ItemInventoryUi, Assembly-CSharp
m_MethodName: SelectAll
m_Mode: 1
@ -6988,7 +6967,7 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 4750452470218991809}
- m_Target: {fileID: 0}
m_TargetAssemblyTypeName: BlueWaterProject.ItemInventoryUi, Assembly-CSharp
m_MethodName: DeselectAll
m_Mode: 1
@ -7845,7 +7824,7 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 4750452470218991809}
- m_Target: {fileID: 0}
m_TargetAssemblyTypeName: BlueWaterProject.PopupUi, Assembly-CSharp
m_MethodName: Close
m_Mode: 1
@ -8339,7 +8318,7 @@ MonoBehaviour:
m_OnValueChanged:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 4750452470218991809}
- m_Target: {fileID: 0}
m_TargetAssemblyTypeName: BlueWaterProject.ItemInventoryUi, Assembly-CSharp
m_MethodName: SortButton
m_Mode: 1

View File

@ -0,0 +1,31 @@
using Graph;
namespace Unity.Muse.Behavior
{
sealed class MuseBehaviorTypes
{
private MuseBehaviorTypes() { }
TypedVariableModel<UnityEngine.GameObject> m_TypedVariableModelUnityEngineGameObject;
TypedVariableModel<System.String> m_TypedVariableModelSystemString;
TypedVariableModel<System.Int32> m_TypedVariableModelSystemInt32;
TypedVariableModel<System.Single> m_TypedVariableModelSystemSingle;
TypedVariableModel<System.Double> m_TypedVariableModelSystemDouble;
TypedVariableModel<System.Boolean> m_TypedVariableModelSystemBoolean;
TypedVariableModel<UnityEngine.Vector2> m_TypedVariableModelUnityEngineVector2;
TypedVariableModel<UnityEngine.Vector3> m_TypedVariableModelUnityEngineVector3;
TypedVariableModel<UnityEngine.Vector4> m_TypedVariableModelUnityEngineVector4;
TypedVariableModel<UnityEngine.Color> m_TypedVariableModelUnityEngineColor;
TypedVariableModel<System.Collections.Generic.List<System.Int32>> m_TypedVariableModelSystemCollectionsGenericList1SystemInt32mscorlibVersion4000CultureneutralPublicKeyTokenb77a5c561934e089;
TypedVariableModel<System.Collections.Generic.List<System.Single>> m_TypedVariableModelSystemCollectionsGenericList1SystemSinglemscorlibVersion4000CultureneutralPublicKeyTokenb77a5c561934e089;
TypedVariableModel<System.Collections.Generic.List<System.Double>> m_TypedVariableModelSystemCollectionsGenericList1SystemDoublemscorlibVersion4000CultureneutralPublicKeyTokenb77a5c561934e089;
TypedVariableModel<System.Collections.Generic.List<System.Boolean>> m_TypedVariableModelSystemCollectionsGenericList1SystemBooleanmscorlibVersion4000CultureneutralPublicKeyTokenb77a5c561934e089;
TypedVariableModel<System.Collections.Generic.List<System.String>> m_TypedVariableModelSystemCollectionsGenericList1SystemStringmscorlibVersion4000CultureneutralPublicKeyTokenb77a5c561934e089;
TypedVariableModel<System.Collections.Generic.List<UnityEngine.GameObject>> m_TypedVariableModelSystemCollectionsGenericList1UnityEngineGameObjectUnityEngineCoreModuleVersion0000CultureneutralPublicKeyTokennull;
TypedVariableModel<System.Collections.Generic.List<UnityEngine.Vector2>> m_TypedVariableModelSystemCollectionsGenericList1UnityEngineVector2UnityEngineCoreModuleVersion0000CultureneutralPublicKeyTokennull;
TypedVariableModel<System.Collections.Generic.List<UnityEngine.Vector3>> m_TypedVariableModelSystemCollectionsGenericList1UnityEngineVector3UnityEngineCoreModuleVersion0000CultureneutralPublicKeyTokennull;
TypedVariableModel<System.Collections.Generic.List<UnityEngine.Vector4>> m_TypedVariableModelSystemCollectionsGenericList1UnityEngineVector4UnityEngineCoreModuleVersion0000CultureneutralPublicKeyTokennull;
TypedVariableModel<System.Collections.Generic.List<UnityEngine.Color>> m_TypedVariableModelSystemCollectionsGenericList1UnityEngineColorUnityEngineCoreModuleVersion0000CultureneutralPublicKeyTokennull;
}
}

View File

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