private void LButtonContainer_OnDeselectMap(MapButtonContainer currentSelectedMap) { currentSelectedMap.MapButton.Unfocus(); if (this.currentSelectedMap == currentSelectedMap) { this.currentSelectedMap = null; } }
private void LButtonContainer_OnSelectMap(MapButtonContainer currentSelectedMap) { this.currentSelectedMap?.MapButton.Unfocus(); this.currentSelectedMap = currentSelectedMap; this.currentSelectedMap.MapButton.Focus(); }
private void Start() { int mapCount = MapLoader.Maplist.Count; for (int i = 0; i < mapCount; i++) { MapButtonContainer lButtonContainer = Instantiate(mapButtonContainerTemplate, transform); lButtonContainer.MapButton.mapId = i; lButtonContainer.OnSelectedMapAndDifficulty += LButtonContainer_OnSelectedMapAndDifficulty; lButtonContainer.OnSelectMap += LButtonContainer_OnSelectMap; lButtonContainer.OnDeselectMap += LButtonContainer_OnDeselectMap; mapContainers.Add(lButtonContainer); } }
public void DeselectCurrentMap() { currentSelectedMap?.MapButton.Unfocus(); currentSelectedMap = null; }
private void OnDestroy() { OnSelectedMapAndDifficulty = null; currentSelectedMap = null; }