Improved look of main scene
This commit is contained in:
@@ -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()
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
16
Assets/Scripts/UI/BuildiingUnlockButton.cs
Normal file
16
Assets/Scripts/UI/BuildiingUnlockButton.cs
Normal 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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/BuildiingUnlockButton.cs.meta
Normal file
2
Assets/Scripts/UI/BuildiingUnlockButton.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 062558955cb2e0447a23f174dd90d495
|
||||
@@ -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>();
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user