using UnityEngine;

public class QuestSpecialResultAnimationHandler : IResultAnimationHandler
{
	private readonly GameObject _resultAnimationAgentObj;

	private readonly QuestSpecialResultAnimationAgent _resultAnimationAgentIns;

	private readonly QuestSpecialBattleResult _resultUI;

	public ResultAnimationAgent m_resultAnimationAgent => _resultAnimationAgentIns;

	public QuestSpecialResultAnimationHandler(BattleCamera battleCamera, QuestSpecialBattleResult resultUI)
	{
		_resultAnimationAgentObj = new GameObject();
		_resultAnimationAgentIns = _resultAnimationAgentObj.AddComponent<QuestSpecialResultAnimationAgent>();
		_resultAnimationAgentIns.GetComponent<QuestSpecialResultAnimationAgent>().SetBattleCamera(battleCamera);
		_resultUI = resultUI;
		UIManager.GetInstance().StartCoroutine(resultUI.LoadCoroutine());
	}

	public void Destroy()
	{
		_resultUI.Unload();
		Object.Destroy(_resultAnimationAgentObj);
	}
}
