Answer the question
In order to leave comments, you need to log in
Why is there no method in the button?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class OpenPanels : MonoBehaviour
{
[Header("0")]
public GameObject PANELWork;
[Header("1")]
public GameObject PANELEntertainment;
[Header("2")]
public GameObject PANELProfile;
[Header("3")]
public GameObject PANELShop;
public GameObject[] Panels;
public bool isPanelsForFor = false;
private void Start()
{
PANELWork = GameObject.Find("PANELWork");
PANELEntertainment = GameObject.Find("PANELEntertainment");
PANELProfile = GameObject.Find("PANELProfile");
PANELShop = GameObject.Find("PANELShop");
PANELWork.SetActive(false);
PANELEntertainment.SetActive(false);
PANELShop.SetActive(false);
Panels[0] = PANELWork;
Panels[1] = PANELEntertainment;
Panels[2] = PANELProfile;
Panels[3] = PANELShop;
}
public void PanelsActivity(GameObject[] Panel, int a)
{
if (isPanelsForFor == false)
{
for (int i = 0; i < Panels.Length; i++)
{
Panel[i] = Panels[i];
}
}
switch (Panel[a].activeSelf)
{
case true:
Panel[a].SetActive(false);
break;
case false:
Panel[a].SetActive(true);
break;
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question