scriptableObject 메모리 누수 방지
This commit is contained in:
parent
8bfb378818
commit
851e95cdcc
@ -10,5 +10,11 @@ private void OnEnable()
|
||||
LevelState = CreateInstance<GameLevelState>();
|
||||
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 evt = GameEvents.OpenPopupUiEvent;
|
||||
//evt.UiType = typeof(CookUi);
|
||||
//evt.Payload = cookwareTypePayload.CookwareType;
|
||||
evt.UiType = typeof(CookUi);
|
||||
evt.Payload = cookwareTypePayload.CookwareType;
|
||||
EventBus.Broadcast(evt);
|
||||
return true;
|
||||
}
|
||||
|
@ -1,5 +1,3 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace DDD
|
||||
{
|
||||
public class RestaurantState : ScriptSingleton<RestaurantState>
|
||||
@ -18,5 +16,14 @@ private void OnEnable()
|
||||
PlayerState = CreateInstance<RestaurantPlayerState>();
|
||||
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