create main menu
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user