- Home /
Question by
Zachary_Cejka · Oct 11, 2020 at 08:16 PM ·
popup
2d pop - up research panel
So Ive been working on an idle game, trying to learn unity. I havent gotten much luck from youtube or reddit, so I have been coming here with questions. does any one know how I could make it in a game so that I can press a button, and then a research panel like in civ or other games pops up. In this panel I would be able to place buttons, which I will multiply some of my public variables through buttons with. For now, I cant figure out how to to make the panel I made pop out, so any help is appreciated. This is what I tried`using.
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using UnityEngine.UIElements;
public class popUpWindow : MonoBehaviour
{
public GameObject ResearchPanel;
private void Start()
{
UnityEngine.UI.Button btn = researchButton.GetComponent<UnityEngine.UI.Button>();
btn.onClick.AddListener(TaskOnClick);
}
void TaskOnClick()
{
transform.position = (researchButton.position + new Vector2())
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613013604im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
GUI Popup problem…! 1 Answer
Pop-up kind information box 0 Answers
Display a variable only if the right Enum is selected? 1 Answer
Alternative to EditorGUILayout.Popup for long lists? 0 Answers