Generating and Displaying Zones
This commit is contained in:
parent
2236ecd129
commit
f756c5fe6a
67 changed files with 1343 additions and 826 deletions
|
|
@ -1,36 +0,0 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
public class TabGroup : MonoBehaviour
|
||||
{
|
||||
public event Action<TabButton> OnTabChange;
|
||||
private TabButton[] _tabButtons;
|
||||
private TabButton _currentButton;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_tabButtons = GetComponentsInChildren<TabButton>();
|
||||
foreach (var thisButton in _tabButtons)
|
||||
{
|
||||
thisButton.OnClick += button =>
|
||||
{
|
||||
if (_currentButton != null)
|
||||
{
|
||||
_currentButton.CurrentState = FlatButtonState.Unselected;
|
||||
_currentButton.Tab.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
_currentButton = thisButton;
|
||||
_currentButton.CurrentState = FlatButtonState.Selected;
|
||||
_currentButton.Tab.gameObject.SetActive(true);
|
||||
OnTabChange?.Invoke(_currentButton);
|
||||
};
|
||||
thisButton.Tab.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
_tabButtons.First().OnPointerClick(null);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue