W
W
WasTabon2021-03-14 15:57:39
Unity
WasTabon, 2021-03-14 15:57:39

Why is there no method in the button?

604e082dad7cb628004721.png

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;
        }
    }
}


Like public is worth

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2021-03-14
@WasTabon

A method can have only one argument, and only one of the primitive types.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question