late goodbye
This commit is contained in:
@@ -1,12 +1,31 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using DG.Tweening;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class UIMainMenu : UICanvas
|
||||
{
|
||||
[SerializeField] private Text stationName;
|
||||
[SerializeField] UITrainButton[] trainButtons;
|
||||
|
||||
public Image aboutTrainButton;
|
||||
public Train currentTrain { get; set; }
|
||||
|
||||
public void ShowAboutTrainButton()
|
||||
{
|
||||
aboutTrainButton.gameObject.SetActive(true);
|
||||
aboutTrainButton.color = new Color(1, 1, 1, 0);
|
||||
aboutTrainButton.DOFade(.7f, 10f);
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if(aboutTrainButton.gameObject.activeSelf && currentTrain != null)
|
||||
aboutTrainButton.rectTransform
|
||||
.position = Camera.main.WorldToScreenPoint(currentTrain.transform.position + Vector3.up * 1.5f);
|
||||
}
|
||||
|
||||
public void UpdateLocationMenu(Location location)
|
||||
{
|
||||
@@ -37,4 +56,13 @@ public class UIMainMenu : UICanvas
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void ResetButtons()
|
||||
{
|
||||
foreach(var button in trainButtons)
|
||||
button.Unselect();
|
||||
|
||||
aboutTrainButton.gameObject.SetActive(false);
|
||||
currentTrain = null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user