DEG-144-체력0탈진-연출-추가이전에 로딩패널 구현 #39
8
.idea/.idea.exhaustion/.idea/indexLayout.xml
generated
Normal file
8
.idea/.idea.exhaustion/.idea/indexLayout.xml
generated
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="UserContentModel">
|
||||||
|
<attachedFolders />
|
||||||
|
<explicitIncludes />
|
||||||
|
<explicitExcludes />
|
||||||
|
</component>
|
||||||
|
</project>
|
46
.idea/.idea.exhaustion/.idea/workspace.xml
generated
Normal file
46
.idea/.idea.exhaustion/.idea/workspace.xml
generated
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="AutoImportSettings">
|
||||||
|
<option name="autoReloadType" value="SELECTIVE" />
|
||||||
|
</component>
|
||||||
|
<component name="ChangeListManager">
|
||||||
|
<list default="true" id="c3b8a67e-61ad-4d5a-9de5-dce8e18c1710" name="변경" comment="" />
|
||||||
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||||
|
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||||
|
</component>
|
||||||
|
<component name="HighlightingSettingsPerFile">
|
||||||
|
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/d6bbda9f0f5a4a7b944aefffbac6e8501fe00/57/cd48a3dd/CharacterController.cs" root0="FORCE_HIGHLIGHTING" />
|
||||||
|
<setting file="file://$PROJECT_DIR$/Assets/LIN/Scripts/PlayerStateExhaustion.cs" root0="FORCE_HIGHLIGHTING" />
|
||||||
|
<setting file="file://$PROJECT_DIR$/Assets/LIN/Scripts/UI/SwitchingPanelController.cs" root0="FORCE_HIGHLIGHTING" />
|
||||||
|
</component>
|
||||||
|
<component name="PropertiesComponent"><![CDATA[{
|
||||||
|
"keyToString": {
|
||||||
|
"node.js.selected.package.tslint": "(autodetect)"
|
||||||
|
}
|
||||||
|
}]]></component>
|
||||||
|
<component name="RunManager">
|
||||||
|
<configuration name="유닛 테스트(배치 모드)" type="RunUnityExe" factoryName="Unity Executable">
|
||||||
|
<option name="EXE_PATH" value="C:\Program Files\Unity\Hub\Editor\2022.3.60f1\Editor\Unity.exe" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="-runTests -batchmode -projectPath D:\LikeLion\TeamProject\TEAFridge\exhaustion -testResults Logs/results.xml -logFile Logs/Editor.log -testPlatform EditMode -debugCodeOptimization" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="D:\LikeLion\TeamProject\TEAFridge\exhaustion" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="1" />
|
||||||
|
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
<configuration name="Unity 시작" type="RunUnityExe" factoryName="Unity Executable">
|
||||||
|
<option name="EXE_PATH" value="C:\Program Files\Unity\Hub\Editor\2022.3.60f1\Editor\Unity.exe" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="-projectPath D:\LikeLion\TeamProject\TEAFridge\exhaustion -debugCodeOptimization" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="D:\LikeLion\TeamProject\TEAFridge\exhaustion" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="1" />
|
||||||
|
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
|
<component name="TaskManager">
|
||||||
|
<servers />
|
||||||
|
</component>
|
||||||
|
<component name="UnityProjectConfiguration" hasMinimizedUI="true" />
|
||||||
|
<component name="UnityUnitTestConfiguration" currentTestLauncher="Both" />
|
||||||
|
</project>
|
BIN
Assets/LIN/Prefabs/SwitchingImage.prefab
(Stored with Git LFS)
Normal file
BIN
Assets/LIN/Prefabs/SwitchingImage.prefab
(Stored with Git LFS)
Normal file
Binary file not shown.
7
Assets/LIN/Prefabs/SwitchingImage.prefab.meta
Normal file
7
Assets/LIN/Prefabs/SwitchingImage.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5f886fa5087dfb04780f508410f72e46
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/LIN/Prefabs/TutorialExamplePanel.prefab
(Stored with Git LFS)
BIN
Assets/LIN/Prefabs/TutorialExamplePanel.prefab
(Stored with Git LFS)
Binary file not shown.
BIN
Assets/LIN/ReHousing Copy.unity
(Stored with Git LFS)
BIN
Assets/LIN/ReHousing Copy.unity
(Stored with Git LFS)
Binary file not shown.
25
Assets/LIN/Scripts/PlayerStateExhaustion.cs
Normal file
25
Assets/LIN/Scripts/PlayerStateExhaustion.cs
Normal file
@ -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);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
11
Assets/LIN/Scripts/PlayerStateExhaustion.cs.meta
Normal file
11
Assets/LIN/Scripts/PlayerStateExhaustion.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: de272c8986ac39344a9242a82a8d7cc4
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -15,6 +15,10 @@ public class HousingCanvasController : MonoBehaviour
|
|||||||
[SerializeField] private GameObject suddenPanel;
|
[SerializeField] private GameObject suddenPanel;
|
||||||
[SerializeField] private TMP_Text suddenText;
|
[SerializeField] private TMP_Text suddenText;
|
||||||
[SerializeField] private GameObject[] suddenEventImages;
|
[SerializeField] private GameObject[] suddenEventImages;
|
||||||
|
|
||||||
|
[Header("로딩(스위칭) 패널")]
|
||||||
|
[SerializeField] private GameObject switchingPanel;
|
||||||
|
private SwitchingPanelController switchingPanelController;
|
||||||
|
|
||||||
private Coroutine _autoHideCoroutine;
|
private Coroutine _autoHideCoroutine;
|
||||||
|
|
||||||
@ -27,6 +31,19 @@ public class HousingCanvasController : MonoBehaviour
|
|||||||
interactionButton.SetActive(false);
|
interactionButton.SetActive(false);
|
||||||
suddenPanel.SetActive(false);
|
suddenPanel.SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 씬전환 로딩 패널 테스트용 코드.던전에서도 씬전환 할 때 해당 코드 사용하시면 됩니다.
|
||||||
|
/// </summary>
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
if (Input.GetKeyDown(KeyCode.A))
|
||||||
|
{
|
||||||
|
var _switchingPanel = Instantiate(switchingPanel,this.transform);
|
||||||
|
switchingPanelController = _switchingPanel.GetComponent<SwitchingPanelController>();
|
||||||
|
switchingPanelController.FadeAndSceneLoad("ReDungeon");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#region NPC 상호 작용
|
#region NPC 상호 작용
|
||||||
|
|
||||||
@ -75,7 +92,6 @@ public class HousingCanvasController : MonoBehaviour
|
|||||||
#region 돌발 이벤트
|
#region 돌발 이벤트
|
||||||
public void ShowSuddenEventPanel(string actText, Action onSuddenButtonPressed)
|
public void ShowSuddenEventPanel(string actText, Action onSuddenButtonPressed)
|
||||||
{
|
{
|
||||||
Debug.Log("call evenet panel show");
|
|
||||||
suddenPanel.SetActive(true);
|
suddenPanel.SetActive(true);
|
||||||
suddenText.text = actText;
|
suddenText.text = actText;
|
||||||
OnSuddenButtonPressed += onSuddenButtonPressed;
|
OnSuddenButtonPressed += onSuddenButtonPressed;
|
||||||
|
@ -16,6 +16,8 @@ public static class HousingConstants
|
|||||||
public static int AFTER_WORK_DENOMINATOR = 2;
|
public static int AFTER_WORK_DENOMINATOR = 2;
|
||||||
//돌발 이벤트 보여줄 시간
|
//돌발 이벤트 보여줄 시간
|
||||||
public static float SUDDENEVENT_IAMGE_SHOW_TIME = 4.0f;
|
public static float SUDDENEVENT_IAMGE_SHOW_TIME = 4.0f;
|
||||||
|
//전환효과(Switching) 패널 애니메이션 시간
|
||||||
|
public static float SWITCH_PANEL_AINIM_DURATION = 2.0f;
|
||||||
|
|
||||||
|
|
||||||
#region 상호작용 멘트
|
#region 상호작용 멘트
|
||||||
|
60
Assets/LIN/Scripts/UI/SwitchingPanelController.cs
Normal file
60
Assets/LIN/Scripts/UI/SwitchingPanelController.cs
Normal file
@ -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>();
|
||||||
|
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));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
11
Assets/LIN/Scripts/UI/SwitchingPanelController.cs.meta
Normal file
11
Assets/LIN/Scripts/UI/SwitchingPanelController.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b102a2215342ff14ea8214afcdf02dfe
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Loading…
x
Reference in New Issue
Block a user
이 변수는 현재 사용하지 않는 것 같은데, 어디에 사용할 예정이신가요?
ReHousing 씬은 가능하다면 현재(프리팹화 된) 씬 기준으로 하시는 게 나을 것 같습니다..!
구현 방법이 바뀌면서 필요없어진 변수 입니다. 삭제 했습니다.