Improved look of main scene

This commit is contained in:
2026-04-21 19:53:45 +01:00
parent b88fb5cc50
commit e2d198269a
11 changed files with 294 additions and 120 deletions

View File

@@ -164,7 +164,7 @@ namespace Fruitomation.UI
UpgradeState.Viewable => $"{formatted}",
UpgradeState.Unlockable => $"{formatted}\n{Cost.AsString()}",
UpgradeState.Unlocked => $"{formatted}\nUnlocked",
_ => throw new ArgumentOutOfRangeException()
var _ => throw new ArgumentOutOfRangeException()
};
}

View File

@@ -0,0 +1,16 @@
using UnityEngine;
public class BuildiingUnlockButton : MonoBehaviour
{
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 062558955cb2e0447a23f174dd90d495

View File

@@ -1,4 +1,5 @@
using Fruitomation.Global;
using System;
using Fruitomation.Global;
using Fruitomation.Game;
using UnityEngine.UI;
using UnityEngine;
@@ -13,16 +14,19 @@ namespace Fruitomation.UI
[SerializeField] private GameObject MenuGrid;
[SerializeField] private GameObject MenuItemPrefab;
[SerializeField] private BuildingRegistry BuildingPrefabs;
private void Update()
{
private void Update() =>
Menu.SetActive(GameStateController.Is(GameState.BuildingMenu));
}
private void Start()
{
foreach (BuildingRegistry.BuildingInfo info in BuildingPrefabs.GetBuildings())
{
if (!UpgradeManager.Is(info.Requirement))
{
continue;
}
GameObject go = Instantiate(MenuItemPrefab, MenuGrid.transform);
Text text = go.GetComponentInChildren<Text>();

View File

@@ -49,7 +49,11 @@ namespace Fruitomation.UI
return result;
}
private void Update() =>
Image.enabled = GameStateController.Is(GameState.Building);
private void Update()
{
Image.enabled =
GameStateController.Is(GameState.Building) ||
GameStateController.Is(GameState.Editing);
}
}
}