You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
696 B
24 lines
696 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
public class UILevelItem : UIButtonEvents {
|
|
|
|
public LevelData levelData;
|
|
|
|
override public void OnSelect(BaseEventData eventData){
|
|
if(Time.time - menuOpenTime > .1f) GlobalAudioPlayer.PlaySFX(SFXOnButtonSelect);
|
|
}
|
|
|
|
override public void OnSubmit(BaseEventData eventData){
|
|
GlobalAudioPlayer.PlaySFX(SFXOnButtonPress);
|
|
GlobalGameSettings.currentLevelId = levelData.levelId;
|
|
LoadScene(levelData.sceneToLoad);
|
|
}
|
|
|
|
override public void OnPointerDown(PointerEventData eventData){
|
|
OnSubmit(new BaseEventData(EventSystem.current));
|
|
}
|
|
}
|
|
|