Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void Awake()
- {
- Button[] buttons = gridWithMaps.GetComponentsInChildren<Button>();
- scrollBar.numberOfSteps = buttons.Length;
- foreach (var button in buttons)
- {
- button.onClick.AddListener( () => onMapClick(button));
- }
- }
- void onMapClick(Button button)
- {
- //todo
- }
Advertisement