dynamic loading of gate prefabs

This commit is contained in:
klemek
2020-12-19 20:02:15 +01:00
parent 205a663e07
commit 972a689d9c
61 changed files with 5685 additions and 7662 deletions
+3 -2
View File
@@ -47,7 +47,7 @@ namespace UntitledLogicGame.UI
private IEnumerator Start()
{
yield return new WaitUntil(() => GameManager.Instance != null);
yield return new WaitUntil(() => GameManager.Instance != null && GameManager.Instance.GatePrefabs == null);
CreateGateBar();
UpdateUI();
}
@@ -126,7 +126,8 @@ namespace UntitledLogicGame.UI
var uiGate = Instantiate(UIGatePrefab, parent.transform);
uiGate.GatePrefab = gatePrefab;
uiGate.Rect.anchoredPosition = new Vector2(currentPos, 0);
uiGate.OnClick = () => {
uiGate.OnClick = () =>
{
GameManager.Instance.CreateGate(gatePrefab);
};
currentPos += 100f;