using System.Collections; using System.Collections.Generic; using UnityEngine; public class ControlsletterManager : MonoBehaviour { public GameObject LetterPanel; public GameObject _panel; // Start is called before the first frame update void Start() { if (PlayerPrefs.GetInt("ControlLetter.WhereDisplayed") == 0) { _panel = Instantiate(LetterPanel, GameObject.FindGameObjectWithTag("GUI").transform); _panel.transform.Find("Button").GetComponent().onClick.AddListener(DestroyLetter); } } void DestroyLetter() { Destroy(_panel); PlayerPrefs.SetInt("ControlLetter.WhereDisplayed", 1); } }