void Start() { loader = GetComponent <LoadingController>(); loader.CreateSlots(); ui = FindObjectOfType <BattleUI>(); if (LevelSettings.GetStructureOfPieces() == null) { ui.ShowLoading(true); LoadSlot(loader.GetCurrentSlot()); } else { ShowStartDialog(); } }
private void OnEnable() { if (LevelSettings.GetStructureOfPieces() != null) { random.isOn = LevelSettings.isLevelRandomOn; firstIsEmpty.isOn = LevelSettings.firstPieceIsEmpty; pieces = LevelSettings.GetStructureOfPieces().levels; UpdateView(); if (AreAllDeselected(pieces)) { SelectAll(); } } else { gameObject.SetActive(false); } }