Pull request #83: Destroys unitTree onDestroy

Merge in CGD/gather-and-defend from bugfix/UnitTreeOnDeath to main

* commit 'd126255f4a6c9b8422dd2d1ac6b4d970bc124b7f':
  Destroys unitTree onDestroy
This commit is contained in:
Ader Alisma 01 2024-11-24 20:44:47 +00:00
commit a8ca27ebcd

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);
}
}
}