scriptableObject 메모리 누수 방지
This commit is contained in:
parent
8bfb378818
commit
851e95cdcc
@ -10,5 +10,11 @@ private void OnEnable()
|
|||||||
LevelState = CreateInstance<GameLevelState>();
|
LevelState = CreateInstance<GameLevelState>();
|
||||||
UiState = CreateInstance<UiState>();
|
UiState = CreateInstance<UiState>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnDisable()
|
||||||
|
{
|
||||||
|
if (LevelState) DestroyImmediate(LevelState);
|
||||||
|
if (UiState) DestroyImmediate(UiState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -11,8 +11,8 @@ public bool ExecuteInteractionSubsystem(IInteractor interactor, IInteractable in
|
|||||||
var cookwareTypePayload = targetPayloadSo as CookwareTypePayload;
|
var cookwareTypePayload = targetPayloadSo as CookwareTypePayload;
|
||||||
|
|
||||||
var evt = GameEvents.OpenPopupUiEvent;
|
var evt = GameEvents.OpenPopupUiEvent;
|
||||||
//evt.UiType = typeof(CookUi);
|
evt.UiType = typeof(CookUi);
|
||||||
//evt.Payload = cookwareTypePayload.CookwareType;
|
evt.Payload = cookwareTypePayload.CookwareType;
|
||||||
EventBus.Broadcast(evt);
|
EventBus.Broadcast(evt);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace DDD
|
namespace DDD
|
||||||
{
|
{
|
||||||
public class RestaurantState : ScriptSingleton<RestaurantState>
|
public class RestaurantState : ScriptSingleton<RestaurantState>
|
||||||
@ -18,5 +16,14 @@ private void OnEnable()
|
|||||||
PlayerState = CreateInstance<RestaurantPlayerState>();
|
PlayerState = CreateInstance<RestaurantPlayerState>();
|
||||||
CustomerState = CreateInstance<RestaurantCustomerState>();
|
CustomerState = CreateInstance<RestaurantCustomerState>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnDisable()
|
||||||
|
{
|
||||||
|
if (ManagementState) DestroyImmediate(ManagementState);
|
||||||
|
if (RunState) DestroyImmediate(RunState);
|
||||||
|
if (EnvironmentState) DestroyImmediate(EnvironmentState);
|
||||||
|
if (PlayerState) DestroyImmediate(PlayerState);
|
||||||
|
if (CustomerState) DestroyImmediate(CustomerState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user