fix tabs ui
This commit is contained in:
@@ -27,6 +27,7 @@ public class JobSelectorUI : MonoBehaviour
|
||||
[SerializeField]
|
||||
private List<JobsListSO> _jobs;
|
||||
|
||||
private JobTabUITemplate _selectedTab;
|
||||
public void ShowJobSelectionDialog(string title, string description, Action onCancel, Action onConfirm)
|
||||
{
|
||||
UIManager.Instance.Freeze();
|
||||
@@ -62,16 +63,27 @@ public class JobSelectorUI : MonoBehaviour
|
||||
|
||||
public void OnTabEnter(JobTabUITemplate button)
|
||||
{
|
||||
print($"enter to {button._jobListItem.name}");
|
||||
print($"enter to {button.JobListItem.name}");
|
||||
}
|
||||
public void OnTabSelected(JobTabUITemplate button)
|
||||
{
|
||||
print($"selected {button._jobListItem.name}");
|
||||
_selectedTab = button;
|
||||
while (_itemsContainer.childCount > 0)
|
||||
{
|
||||
DestroyImmediate(_itemsContainer.GetChild(0).gameObject);
|
||||
}
|
||||
foreach (var job in _selectedTab.JobListItem.JobPositionsList)
|
||||
{
|
||||
var itemUI = Instantiate(_jobItemUItemplate, _itemsContainer);
|
||||
itemUI.gameObject.SetActive(true);
|
||||
itemUI.GetComponent<JobItemUITemplate>().SetItem((job));
|
||||
}
|
||||
print($"selected {button.JobListItem.name}");
|
||||
}
|
||||
|
||||
public void OnTabExit(JobTabUITemplate button)
|
||||
{
|
||||
print($"exit {button._jobListItem.name}");
|
||||
print($"exit {button.JobListItem.name}");
|
||||
}
|
||||
|
||||
private void CloseDialog()
|
||||
|
||||
Reference in New Issue
Block a user