MIF_E31211846/Assets/Scripts/TutorScript.cs

66 lines
1.4 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class TutorScript : MonoBehaviour
{
public GameObject TutorPanel;
public GameObject PanelGame;
// Start is called before the first frame update
void Start()
{
// Pastikan TutorPanel tidak null dan aktifkan
if (TutorPanel != null)
{
TutorPanel.SetActive(true);
}
else
{
Debug.LogWarning("TutorPanel is not assigned.");
}
// Pastikan PanelGame tidak null dan nonaktifkan
if (PanelGame != null)
{
PanelGame.SetActive(false);
}
else
{
Debug.LogWarning("PanelGame is not assigned.");
}
}
// Remove Update method if not needed
// void Update() {}
public void LoadScene(string sceneName)
{
SceneManager.LoadScene(sceneName);
}
public void ButtonOK()
{
// Nonaktifkan TutorPanel jika tidak null
if (TutorPanel != null)
{
TutorPanel.SetActive(false);
}
else
{
Debug.LogWarning("TutorPanel is not assigned.");
}
// Aktifkan PanelGame jika tidak null
if (PanelGame != null)
{
PanelGame.SetActive(true);
}
else
{
Debug.LogWarning("PanelGame is not assigned.");
}
}
}