bad-piggies-0.1.3-porting/Assets/Scripts/Assembly-CSharp/MainMenuButton.cs
2024-02-24 22:40:44 -05:00

23 lines
534 B
C#

using UnityEngine;
public class MainMenuButton : MonoBehaviour
{
private void Update()
{
if (!Input.GetMouseButtonDown(0))
{
return;
}
Camera component = GameObject.Find("MainCamera").GetComponent<Camera>();
Ray ray = component.ScreenPointToRay(Input.mousePosition);
RaycastHit hitInfo;
if (Physics.Raycast(ray, out hitInfo))
{
MainMenuButton component2 = hitInfo.collider.gameObject.GetComponent<MainMenuButton>();
if ((bool)component2)
{
Loader.Instance.LoadLevel("MainMenu", true);
}
}
}
}