TwinTurbine/Assets/MenuController.cs
Abdul Mukheem Shaik a931e783a8 Initial commit
2024-05-03 20:29:08 +02:00

32 lines
756 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class MenuController : MonoBehaviour
{
[SerializeField]
private Transform referencePoint;
private void Start()
{
transform.parent = referencePoint;
transform.localPosition = Vector3.zero;
transform.localRotation = Quaternion.identity;
}
private void Update()
{
if(transform.position == Vector3.zero)
gameObject.SetActive(false);
else
gameObject.SetActive(true);
}
public void OnLoadDemoScene(int iSceneIndex)
{
Debug.Log($"{nameof(OnLoadDemoScene)}:{iSceneIndex}");
SceneManager.LoadScene(iSceneIndex);
}
}