26 lines
741 B
C#
26 lines
741 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class PrologueLetterManager : MonoBehaviour
|
|
{
|
|
public GameObject LetterPanel;
|
|
public GameObject _panel;
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
if (PlayerPrefs.GetInt("PrologueLetter.WhereDisplayed") == 0)
|
|
{
|
|
_panel = Instantiate(LetterPanel, GameObject.FindGameObjectWithTag("GUI").transform);
|
|
_panel.transform.Find("Button").GetComponent<UnityEngine.UI.Button>().onClick.AddListener(DestroyLetter);
|
|
}
|
|
}
|
|
|
|
void DestroyLetter()
|
|
{
|
|
Destroy(_panel);
|
|
PlayerPrefs.SetInt("PrologueLetter.WhereDisplayed", 1);
|
|
}
|
|
}
|