[Style] 퇴근 돌발이벤트 호출 위치 변경, 안쓰는 변수 삭제
This commit is contained in:
parent
d2d474a84b
commit
db5e0923c7
@ -14,7 +14,12 @@ public class InteractionController : MonoBehaviour
|
||||
[SerializeField] HousingCanvasController housingCanvasController;
|
||||
|
||||
private SuddenEventController _suddenEventController = new SuddenEventController();
|
||||
|
||||
|
||||
private void Start()
|
||||
{
|
||||
playerStats.OnWorked += SuddenAfterWorkEventHappen();
|
||||
}
|
||||
|
||||
// 상호작용 가능한 사물 범위에 들어올 때
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
@ -46,9 +51,6 @@ public class InteractionController : MonoBehaviour
|
||||
if (playerStats.CanPerformByHealth(interactionType))
|
||||
{
|
||||
playerStats.PerformAction(interactionType);
|
||||
// 출퇴근에 해당하는 돌발 이벤트 호출
|
||||
if (interactionType != ActionType.Work) return;
|
||||
playerStats.OnWorked += SuddenAfterWorkEventHappen();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -65,6 +67,7 @@ public class InteractionController : MonoBehaviour
|
||||
|
||||
public Action SuddenAfterWorkEventHappen()
|
||||
{
|
||||
Debug.Log("돌발이벤트 발생");
|
||||
AfterWorkEvent afterWorkEvent = _suddenEventController.SuddenEventCalculator();
|
||||
if (afterWorkEvent == AfterWorkEvent.None)
|
||||
return null;
|
||||
|
BIN
Assets/LIN/Housing Copy.unity
(Stored with Git LFS)
BIN
Assets/LIN/Housing Copy.unity
(Stored with Git LFS)
Binary file not shown.
@ -84,6 +84,7 @@ public class HousingCanvasController : MonoBehaviour
|
||||
suddenPanel.SetActive(false);
|
||||
suddenText.text = "";
|
||||
OnSuddenButtonPressed -= OnSuddenButtonPressed;
|
||||
Debug.Log(OnSuddenButtonPressed);
|
||||
}
|
||||
public void OnSuddenConfirmButton()
|
||||
{
|
||||
|
@ -12,7 +12,6 @@ public enum AfterWorkEvent
|
||||
public static class HousingConstants
|
||||
{
|
||||
//돌발 이벤트 확률 계산
|
||||
public static int SUDDEN_EVENT_DENOMINATOR = 5;
|
||||
public static int AFTER_WORK_DENOMINATOR = 4;
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user