private void Awake() { if (_levelSelect == null) { DontDestroyOnLoad(this); _levelSelect = this; } else if (_levelSelect != this) { Destroy(this); } }
public void ButtonAction(LevelSelectData data) { if (data.GlobalLevel != -1) { EventManager.TriggerEvent(new SFXPlayEvent(SfxType.TAP, true)); Global.Level = data.GlobalLevel; } else { EventManager.TriggerEvent(new SFXPlayEvent(SfxType.LEFT_RIGHT, true)); } EventManager.TriggerEvent(new LevelSelectButtonEvent(data.ButtonType)); }
public void SetContent() { levelData = ItemDatabase.Instance.LevelDatas[levelDataId]; perkNameText.text = levelData.Name; fillImage.sprite = Resources.Load <Sprite>($"LevelImages/{levelData.ImageLocation}"); }