diff --git a/.idea/.idea.exhaustion/.idea/indexLayout.xml b/.idea/.idea.exhaustion/.idea/indexLayout.xml new file mode 100644 index 00000000..7b08163c --- /dev/null +++ b/.idea/.idea.exhaustion/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.exhaustion/.idea/workspace.xml b/.idea/.idea.exhaustion/.idea/workspace.xml new file mode 100644 index 00000000..f8f4a5b5 --- /dev/null +++ b/.idea/.idea.exhaustion/.idea/workspace.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Assets/LIN/Prefabs/SwitchingImage.prefab b/Assets/LIN/Prefabs/SwitchingImage.prefab new file mode 100644 index 00000000..e4eba114 --- /dev/null +++ b/Assets/LIN/Prefabs/SwitchingImage.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f797bcff534783fd29d1e08550581ce53c8e270ab0456293948842f131868957 +size 9083 diff --git a/Assets/LIN/Prefabs/SwitchingImage.prefab.meta b/Assets/LIN/Prefabs/SwitchingImage.prefab.meta new file mode 100644 index 00000000..c0548dcf --- /dev/null +++ b/Assets/LIN/Prefabs/SwitchingImage.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5f886fa5087dfb04780f508410f72e46 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/LIN/Prefabs/TutorialExamplePanel.prefab b/Assets/LIN/Prefabs/TutorialExamplePanel.prefab index 5071a7c0..a6045353 100644 --- a/Assets/LIN/Prefabs/TutorialExamplePanel.prefab +++ b/Assets/LIN/Prefabs/TutorialExamplePanel.prefab @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d996355527e9a0aa940a2d0a503ba8e7c6e660cb7f0b7f9d403435862da11ee -size 44871 +oid sha256:2a205b1cb1b77da6069cc6b50bf84b6dde468c7dec7fe424d001a0d0e21062fc +size 44760 diff --git a/Assets/LIN/ReHousing Copy.unity b/Assets/LIN/ReHousing Copy.unity index e9025304..adbf96f5 100644 --- a/Assets/LIN/ReHousing Copy.unity +++ b/Assets/LIN/ReHousing Copy.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b3f305cf446df76596f25e4ba247f35283cfba1441d7b2da7bfc3dcce6811e0a -size 607385 +oid sha256:d1253abf44be4fe1896a540df113417f61f5d849f78e18b2a55cb1e34b7157d5 +size 613321 diff --git a/Assets/LIN/Scripts/PlayerStateExhaustion.cs b/Assets/LIN/Scripts/PlayerStateExhaustion.cs new file mode 100644 index 00000000..6afe756e --- /dev/null +++ b/Assets/LIN/Scripts/PlayerStateExhaustion.cs @@ -0,0 +1,25 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class PlayerStateEx : IPlayerState +{ + private PlayerController _playerController; + public void Enter(PlayerController playerController) + { + // 파라미터가 존재하는지 확인 후 처리 + _playerController.SafeSetBool("Dizzy", true); + } + + public void Update() + { + + } + + public void Exit() + { + // 파라미터가 존재하는지 확인 후 처리 + _playerController.SafeSetBool("Dizzy", false); + + } +} diff --git a/Assets/LIN/Scripts/PlayerStateExhaustion.cs.meta b/Assets/LIN/Scripts/PlayerStateExhaustion.cs.meta new file mode 100644 index 00000000..f749a4b3 --- /dev/null +++ b/Assets/LIN/Scripts/PlayerStateExhaustion.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: de272c8986ac39344a9242a82a8d7cc4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/LIN/Scripts/UI/HousingCanvasController.cs b/Assets/LIN/Scripts/UI/HousingCanvasController.cs index d93c78a0..1839b0ef 100644 --- a/Assets/LIN/Scripts/UI/HousingCanvasController.cs +++ b/Assets/LIN/Scripts/UI/HousingCanvasController.cs @@ -15,6 +15,10 @@ public class HousingCanvasController : MonoBehaviour [SerializeField] private GameObject suddenPanel; [SerializeField] private TMP_Text suddenText; [SerializeField] private GameObject[] suddenEventImages; + + [Header("로딩(스위칭) 패널")] + [SerializeField] private GameObject switchingPanel; + private SwitchingPanelController switchingPanelController; private Coroutine _autoHideCoroutine; @@ -27,6 +31,19 @@ public class HousingCanvasController : MonoBehaviour interactionButton.SetActive(false); suddenPanel.SetActive(false); } + + /// + /// 씬전환 로딩 패널 테스트용 코드.던전에서도 씬전환 할 때 해당 코드 사용하시면 됩니다. + /// + private void Update() + { + if (Input.GetKeyDown(KeyCode.A)) + { + var _switchingPanel = Instantiate(switchingPanel,this.transform); + switchingPanelController = _switchingPanel.GetComponent(); + switchingPanelController.FadeAndSceneLoad("ReDungeon"); + } + } #region NPC 상호 작용 @@ -75,7 +92,6 @@ public class HousingCanvasController : MonoBehaviour #region 돌발 이벤트 public void ShowSuddenEventPanel(string actText, Action onSuddenButtonPressed) { - Debug.Log("call evenet panel show"); suddenPanel.SetActive(true); suddenText.text = actText; OnSuddenButtonPressed += onSuddenButtonPressed; diff --git a/Assets/LIN/Scripts/UI/HousingConstants.cs b/Assets/LIN/Scripts/UI/HousingConstants.cs index 6f1e189d..931012e5 100644 --- a/Assets/LIN/Scripts/UI/HousingConstants.cs +++ b/Assets/LIN/Scripts/UI/HousingConstants.cs @@ -16,6 +16,8 @@ public static class HousingConstants public static int AFTER_WORK_DENOMINATOR = 2; //돌발 이벤트 보여줄 시간 public static float SUDDENEVENT_IAMGE_SHOW_TIME = 4.0f; + //전환효과(Switching) 패널 애니메이션 시간 + public static float SWITCH_PANEL_AINIM_DURATION = 2.0f; #region 상호작용 멘트 diff --git a/Assets/LIN/Scripts/UI/SwitchingPanelController.cs b/Assets/LIN/Scripts/UI/SwitchingPanelController.cs new file mode 100644 index 00000000..a7da2979 --- /dev/null +++ b/Assets/LIN/Scripts/UI/SwitchingPanelController.cs @@ -0,0 +1,60 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; +using DG.Tweening; +using TMPro; +using UnityEngine.SceneManagement; + +public class SwitchingPanelController : MonoBehaviour +{ + [SerializeField] private GameObject Loading_UI; + [SerializeField] TMP_Text Loading_text; + + private CanvasGroup canvasGroup; + + private void Awake() + { + canvasGroup = this.GetComponent(); + canvasGroup.alpha = 0; + } + + IEnumerator LoadScene(string sceneName){ + Loading_UI.SetActive(true); + + AsyncOperation async = SceneManager.LoadSceneAsync(sceneName); + async.allowSceneActivation = false; //퍼센트 딜레이용 + + float past_time = 0; + float percentage = 0; + + while(!(async.isDone)){ + yield return null; + + past_time += Time.deltaTime; + + if(percentage >= 90){ + percentage = Mathf.Lerp(percentage, 100, past_time); + + if(percentage == 100){ + async.allowSceneActivation = true; //씬 전환 준비 완료 + } + } + else{ + percentage = Mathf.Lerp(percentage, async.progress * 100f, past_time); + if(percentage >= 90) past_time = 0; + } + Loading_text.text = percentage.ToString("0") + "%"; //로딩 퍼센트 표기 + } + } + + public void FadeAndSceneLoad(string sceneName) + { + if (canvasGroup == null) return; + + canvasGroup.DOFade(1.0f, HousingConstants.SWITCH_PANEL_AINIM_DURATION).OnComplete(() => + { + StartCoroutine(LoadScene(sceneName)); + }); + } +} diff --git a/Assets/LIN/Scripts/UI/SwitchingPanelController.cs.meta b/Assets/LIN/Scripts/UI/SwitchingPanelController.cs.meta new file mode 100644 index 00000000..12e637a9 --- /dev/null +++ b/Assets/LIN/Scripts/UI/SwitchingPanelController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b102a2215342ff14ea8214afcdf02dfe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: