Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using UnityEngine;
- using UnityEngine.UI;
- public class InteractableButton : MonoBehaviour
- {
- private const string saveFileName = "save.bxm";
- [SerializeField]
- private Button button;
- private void Start()
- {
- button.interactable = true;
- try
- {
- FileStream file = new FileStream(Path.Combine(Application.streamingAssetsPath, saveFileName), FileMode.Open, FileAccess.Read);
- } catch (FileNotFoundException ex)
- {
- button.interactable = false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement