Toggle on Button in 60 sec | Unity Tutorial

Опубликовано: 10 Октябрь 2024
на канале: 60 Seconds Code
4,238
30

I hope I was able to help you with this video, if that's the case, I would be very happy for a rating and a comment, thank you very much!

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Tutorial : MonoBehaviour
{
public GameObject Inventory;

public void Start()
{
Inventory.gameObject.SetActive(false);
}

public void Switch()
{
if (Inventory.activeSelf == false) Inventory.SetActive(true);
else Inventory.SetActive(false);
}
}