Destroys unitTree onDestroy

This commit is contained in:
Ader Alisma 01 2024-11-10 13:32:33 -05:00
parent bad4685988
commit d126255f4a

View File

@ -1,4 +1,3 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
@ -31,7 +30,7 @@ public class AllyUpgrade : MonoBehaviour, IPointerClickHandler
AssignUpgrades(canvas);
}
}
}
else
{
@ -53,4 +52,13 @@ public class AllyUpgrade : MonoBehaviour, IPointerClickHandler
button.Initialize(_upgradeList[i], gameObject, canvas);
}
}
}}
}
private void OnDestroy()
{
if (_instance != null)
{
Destroy(_instance);
}
}
}