create main menu

This commit is contained in:
2022-11-12 15:15:01 +05:00
parent b9e9cb72fe
commit a488ab8f99
82 changed files with 7068 additions and 989 deletions
+5 -1
View File
@@ -11,6 +11,7 @@ public class UITrainButton : MonoBehaviour, IPointerClickHandler
{
public TrainType trainType;
[SerializeField] private Color selectedColor;
private Color unselectedColor;
private Image buttonBase;
public bool isSelected { get; private set; }
@@ -19,13 +20,16 @@ public class UITrainButton : MonoBehaviour, IPointerClickHandler
void Start()
{
buttonBase = GetComponent<Image>();
locomotionHandler = FindObjectOfType<LocomotionHandler>();
unselectedColor = buttonBase.color;
}
public void Select()
{
if(isSelected) return;
if(locomotionHandler == null)
locomotionHandler = FindObjectOfType<LocomotionHandler>();
var buttons = FindObjectsOfType<UITrainButton>();
foreach(var item in buttons)
{